/* Tatami — tema oscuro. El acento es el rojo de la barra del cinturón negro. */
:root {
  --bg: #0d1117;
  --bg-2: #010409;
  --panel: #161b22;
  --panel-2: #1c2128;
  --panel-3: #21262d;
  --line: #30363d;
  --line-2: #3d444d;
  --text: #e6edf3;
  --muted: #9198a1;
  --faint: #6e7681;
  --accent: #4493f8;
  --accent-2: #4493f8;
  --accent-soft: rgba(56, 139, 253, .15);
  --gold: #ffc35a;
  --ok: #3ecf8e;
  --warn: #ffb547;
  --err: #ff5d6c;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(1, 4, 9, .6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  /* colores por categoría (inspirados en los cinturones y la lona) */
  --c-pasajes: #4c8dff;
  --c-guardias: #a67bff;
  --c-derribos: #d58b4f;
  --c-sumisiones: #ff5d6c;
  --c-espalda: #3ecf8e;
  --c-leglocks: #ffc35a;
  --c-escapes: #35c3d6;
  --c-barridas: #ff7ab8;
  --c-otros: #8792a8;
  --c-instruccional: #3fb950;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(56, 139, 253, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(76, 141, 255, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 248px 1fr;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: #8fb6ff; }
[hidden] { display: none !important; }

/* ---------- iconos ---------- */
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- barra lateral ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 0; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-sub { color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  background: none; border: 1px solid transparent; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 14.5px; text-align: left;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: var(--panel); color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: var(--text); border-color: rgba(56, 139, 253, .25); }
.nav-btn.active .ico { color: var(--accent); }
.side-stats { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat-num { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat-lbl { color: var(--faint); font-size: 12px; }
.quit { grid-column: 1 / -1; background: none; border: none; color: var(--faint); font-size: 12px; cursor: pointer; padding: 6px 4px 0; text-align: left; }
.quit:hover { color: var(--err); }
.busy { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; padding: 4px 4px 0; }

/* ---------- vistas ---------- */
.main { min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.view { display: none; height: 100%; overflow-y: auto; padding: 28px 36px 40px; }
.view.active { display: flex; flex-direction: column; }
.view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.view-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; max-width: 70ch; }
.section-title { margin: 30px 0 12px; font-size: 15px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.grid-title { grid-column: 1 / -1; margin: 0 0 2px; }
.hint { color: var(--faint); font-size: 13px; margin: 2px 0 18px; }
.muted { color: var(--muted); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); }
a.btn { text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(56, 139, 253, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; }

/* ---------- barra de herramientas ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-width: 280px; flex: 1; max-width: 560px; }
.search.grow { max-width: none; }
.search:focus-within { border-color: rgba(56, 139, 253, .5); box-shadow: 0 0 0 3px rgba(56, 139, 253, .12); }
.search .ico { color: var(--faint); }
.search input { flex: 1; background: none; border: none; outline: none; padding: 12px 0; font-size: 14.5px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { white-space: nowrap; border: none; background: none; padding: 8px 13px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.seg button.active { background: var(--panel-3); color: var(--text); }
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; user-select: none; }
.toggle input { display: none; }
.toggle span { width: 36px; height: 20px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.toggle input:checked + span { background: var(--accent-soft); border-color: rgba(56, 139, 253, .5); }
.toggle input:checked + span::after { transform: translateX(16px); background: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  --c: var(--c-otros);
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip .n { color: var(--faint); font-weight: 500; }
.chip.active { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel)); }
.chip.all::before { display: none; }

/* ---------- tarjetas de vídeo ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #12151d url(/static/placeholder.svg) center / cover; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.04); }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .75); padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; background: linear-gradient(transparent, rgba(0,0,0,.35)); }
.card:hover .thumb .play { opacity: 1; }
.thumb .play span { width: 46px; height: 46px; border-radius: 50%; background: rgba(56, 139, 253, .92); display: flex; align-items: center; justify-content: center; }
.src-badge { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: rgba(0, 0, 0, .7); }
.src-badge.youtube { background: #e62117; }

.src-badge.gamebar { background: rgba(16, 124, 16, .92); }
.multi { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, .75); color: var(--gold); }
.parts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.parts button { text-align: left; border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.parts button.active { border-color: var(--gold); color: var(--text); background: color-mix(in srgb, var(--gold) 8%, var(--bg-2)); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tech { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { --c: var(--c-otros); font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; color: color-mix(in srgb, var(--c) 80%, white); background: color-mix(in srgb, var(--c) 16%, transparent); }
.tag.plain { --c: #8792a8; }
.empty { color: var(--faint); text-align: center; padding: 60px 0; }

/* ---------- chat ---------- */
#view-coach { padding-bottom: 0; }
.chat { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-bottom: 24px; max-width: 980px; width: 100%; margin: 0 auto; }
.chat-empty { margin: auto; text-align: center; max-width: 640px; padding: 30px 0; }
.chat-empty h2 { font-size: 26px; letter-spacing: -.02em; margin: 22px 0 8px; }
.chat-empty p { color: var(--muted); margin: 0 0 22px; }
/* Cinturón negro de BJJ: negro entero con sus pespuntes a lo largo y la punta roja, sin grados */
.belt-hero { display: inline-flex; height: 18px; width: 230px; border-radius: 3px; overflow: hidden;
  background: #0a0a0c; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 8px 30px rgba(0, 0, 0, .45); }
.belt-hero span { flex: 1; border: 0;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(255, 255, 255, .07) 3px 4px), #0a0a0c; }
.belt-hero .bar { flex: 0 0 60px; position: relative;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(0, 0, 0, .14) 3px 4px), #c8102e; }
.belt-hero .bar::after { content: none; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; text-align: left; }
.suggestion {
  --c: var(--accent);
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2));
  cursor: pointer; color: var(--text); text-align: left; position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.suggestion::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.suggestion:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.sg-cat { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c); }
.sg-t { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.sg-q { color: var(--faint); font-size: 12.5px; line-height: 1.4; }
.chat-empty { max-width: 820px; }
.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--panel-3); }
.avatar img { width: 34px; height: 34px; border-radius: 10px; }
.bubble { max-width: 100%; min-width: 0; }
.msg.user .bubble { background: linear-gradient(135deg, #263048, #1d2436); border: 1px solid #2f3a56; padding: 12px 16px; border-radius: 16px 16px 4px 16px; max-width: 75%; white-space: pre-wrap; line-height: 1.55; }
.msg.bot .bubble { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 18px 22px; }
.md { line-height: 1.65; font-size: 15px; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .45em; letter-spacing: -.01em; line-height: 1.3; }
.md h1 { font-size: 21px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15.5px; }
.md > :first-child { margin-top: 0; }
.md p { margin: .55em 0; }
.md ul, .md ol { margin: .4em 0 .7em; padding-left: 1.35em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--accent); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1.1em 0; }
.md code { background: var(--panel-3); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.md blockquote { margin: .6em 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.md strong { color: #fff; }
.md .table-wrap { overflow-x: auto; margin: .7em 0; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { background: var(--panel-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.md tr:last-child td { border-bottom: none; }
.clipref { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin: 0 2px; border-radius: 999px; background: var(--accent-soft); color: #b9ccff; font-weight: 700; font-size: .85em; cursor: pointer; border: 1px solid rgba(56, 139, 253, .3); }
.clipref:hover { background: rgba(56, 139, 253, .25); }
.steps { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13.5px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .ico { color: var(--ok); width: 15px; height: 15px; }
.step.live .spinner { margin: 0 1px; }
.steps-done { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.steps-done summary { cursor: pointer; color: var(--faint); font-size: 12.5px; list-style: none; }
.steps-done summary::before { content: "▸ "; }
.steps-done[open] summary::before { content: "▾ "; }
.steps-done .steps { margin-top: 8px; }
.steps-live { margin-bottom: 12px; opacity: .75; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: text-bottom; background: var(--accent); margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.clip { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: box-shadow .3s, border-color .3s; }
.clip.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 139, 253, .25); }
.clip video, .clip iframe { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; border: 0; }
.clip-embed-cover { position: relative; aspect-ratio: 16 / 9; background: #000 center / cover; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.clip-embed-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-embed-cover span { position: relative; width: 50px; height: 50px; border-radius: 50%; background: rgba(56, 139, 253, .92); display: flex; align-items: center; justify-content: center; }
.clip-info { padding: 10px 12px 12px; }
.clip-n { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.clip-title { font-weight: 700; font-size: 13.5px; margin: 3px 0 4px; line-height: 1.35; }
.clip-meta { color: var(--faint); font-size: 12px; }
.composer { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end; max-width: 980px; width: 100%; margin: 0 auto; padding: 14px 0 22px; background: linear-gradient(transparent, var(--bg) 30%); }
.composer textarea { flex: 1; resize: none; max-height: 180px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; outline: none; font-size: 15px; line-height: 1.45; }
.composer textarea:focus { border-color: rgba(56, 139, 253, .55); box-shadow: 0 0 0 3px rgba(56, 139, 253, .12); }
.send { width: 50px; height: 50px; padding: 0; border-radius: 14px; }
.error-box { background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .35); color: #ffc2c8; border-radius: 12px; padding: 12px 14px; font-size: 14px; }

/* ---------- reproductor ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 5, 8, .78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal-card { position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: min(1280px, 100%); max-height: calc(100vh - 48px); overflow: hidden; box-shadow: var(--shadow); }
.close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.player-layout { display: grid; grid-template-columns: 1fr 380px; max-height: calc(100vh - 48px); }
/* Cada columna con su propio desplazamiento y como mucho la altura de la pantalla: si no, la ventana corta el
   texto que no cabe y no deja bajar a verlo. */
.player-main, .player-side { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overscroll-behavior: contain; }
.player-main { min-width: 0; overflow-y: auto; }
.player-frame { background: #000; aspect-ratio: 16 / 9; }
.player-frame video, .player-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.player-info { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.player-info h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.01em; }
.player-info p { margin: 0 0 6px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.player-side { border-left: 1px solid var(--line); padding: 60px 16px 18px; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.player-side h3 { margin: 4px 6px 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.chapters { display: flex; flex-direction: column; gap: 8px; }
.chapter { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; background: var(--bg-2); transition: border-color .15s, background .15s; }
.chapter:hover { border-color: var(--line-2); background: var(--panel-2); }
.chapter.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
.ch-head { display: flex; gap: 10px; align-items: baseline; }
.ch-time { color: var(--accent); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }
.ch-title { font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.ch-body { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.ch-body ul { margin: 6px 0 0; padding-left: 1.1em; }
.ch-body li { margin: 3px 0; }
.ch-body .lbl { color: var(--text); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; display: block; }

/* ---------- fuentes y tareas ---------- */
.source-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.scard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.scard-head { display: flex; align-items: center; gap: 12px; }
.scard-ico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.scard-ico.gamebar { background: #107c10; } .scard-ico.youtube { background: #e62117; } .scard-ico.web { background: #5865f2; } .scard-ico.phone { background: #2b3242; }
.scard h3 { margin: 0; font-size: 16px; }
.scard .desc { color: var(--muted); font-size: 13px; margin: 2px 0 0; line-height: 1.45; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count { background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
.count b { color: var(--text); margin-right: 3px; }
.count.err b { color: var(--err); }
.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; outline: none; font-size: 13.5px; }
.addrow input:focus { border-color: rgba(56, 139, 253, .5); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.phone-card code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.phone-card details summary { cursor: pointer; color: var(--text); margin-bottom: 6px; }
.qr { width: 180px; height: 180px; background: #fff; border-radius: 12px; padding: 8px; align-self: center; }
.path { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--faint); word-break: break-all; }
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.task-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.task-head .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pill { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.pill.hecho { background: rgba(62, 207, 142, .14); color: var(--ok); }
.pill.error { background: rgba(255, 93, 108, .14); color: var(--err); }
.pill.curso { background: rgba(255, 181, 71, .14); color: var(--warn); }
.task pre { margin: 10px 0 0; max-height: 220px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.task details summary { cursor: pointer; color: var(--faint); font-size: 12.5px; margin-top: 6px; }

/* ---------- guardar / mi plan ---------- */
.nav-count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.on { border-color: var(--gold); color: var(--gold); }
.btn.danger { color: var(--faint); border-color: transparent; }
.btn.danger:hover { color: var(--err); border-color: rgba(255, 93, 108, .4); background: rgba(255, 93, 108, .08); }
.clip-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--line-2); color: var(--muted); border-radius: 999px; padding: 3px 9px 3px 7px; font-size: 12px; font-weight: 600; cursor: pointer; }
.save-btn:hover { color: var(--text); border-color: var(--gold); }
.save-btn.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.save-btn.on svg { fill: currentColor; }
.plan-progress { margin-bottom: 18px; max-width: 640px; }
.pp-bar { display: flex; height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.pp-dom { background: var(--ok); } .pp-prac { background: var(--warn); }
.pp-legend { color: var(--muted); font-size: 13px; margin-top: 8px; }
.pp-legend b { color: var(--text); font-size: 15px; }
.plan-list { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.plan-item { display: grid; grid-template-columns: 340px 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-left: 3px solid var(--line-2); }
.plan-item.st-practicando { border-left-color: var(--warn); }
.plan-item.st-dominada { border-left-color: var(--ok); }
.plan-media { background: #000; }
.plan-media video, .plan-media iframe, .plan-media .clip-embed-cover, .plan-thumb { width: 100%; aspect-ratio: 16 / 9; display: block; border: 0; }
.plan-thumb { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.plan-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plan-thumb span { position: relative; width: 46px; height: 46px; border-radius: 50%; background: rgba(56, 139, 253, .92); display: flex; align-items: center; justify-content: center; }
.plan-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plan-top { display: flex; justify-content: space-between; align-items: center; }
.plan-body h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.small { font-size: 12.5px; }
.icon-btn.small { width: 30px; height: 30px; color: var(--faint); }
.icon-btn.small:hover { color: var(--err); }
.states { display: flex; gap: 6px; flex-wrap: wrap; }
.st { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.st.active.pendiente { border-color: var(--faint); color: var(--text); }
.st.active.practicando { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--bg-2)); }
.st.active.dominada { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--bg-2)); }
.note { width: 100%; min-height: 70px; resize: vertical; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13.5px; line-height: 1.5; outline: none; }
.note:focus { border-color: rgba(56, 139, 253, .5); }
.saved-hint { color: var(--ok); font-size: 12px; }
.plan-empty { line-height: 1.8; }
@media (max-width: 820px) { .plan-item { grid-template-columns: 1fr; } .nav-count { display: none; } }

/* ---------- intro: el emblema (gafas y cinturón-bigote recortados) se monta pieza a pieza ---------- */
.intro { position: fixed; inset: 0; z-index: 100; background: #0d1117; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.intro.out { animation: clipOut .6s cubic-bezier(.6, 0, .3, 1) forwards; }
@keyframes clipOut { to { opacity: 0; visibility: hidden; } }
.clip-mark { width: min(200px, 46vw); overflow: visible; }
/* 1. aparece el círculo */
.c-disc { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: disc .5s cubic-bezier(.3, 1.35, .5, 1) .1s forwards; }
@keyframes disc { to { transform: scale(1); } }
/* 2. las gafas se dibujan */
.c-draw { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .5s cubic-bezier(.5, 0, .2, 1) both; }
.c-d1 { animation-delay: .5s; } .c-d2 { animation-delay: .65s; } .c-d3 { animation-delay: .88s; animation-duration: .22s; }
.c-d4 { animation-delay: .98s; animation-duration: .2s; } .c-d5 { animation-delay: .98s; animation-duration: .2s; }
@keyframes draw { 0% { opacity: 0; } 1% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }  /* sin puntitos antes de dibujar */
/* 3. el bigote crece desde el nudo */
.c-lobe { transform-box: view-box; transform: scaleX(0); }
.c-left, .c-right { transform-origin: 32px 39px; animation: grow .5s cubic-bezier(.2, 1.4, .4, 1) 1.28s forwards; }
@keyframes grow { to { transform: scaleX(1); } }
.c-knot { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: knot .3s cubic-bezier(.3, 1.7, .5, 1) 1.18s forwards; }
@keyframes knot { to { transform: scale(1); } }
.c-bar { opacity: 0; animation: fade .25s ease 1.7s forwards; }
/* 4. el guiño: el bigote se menea y las gafas dan un saltito */
.c-stache { transform-box: view-box; transform-origin: 32px 40px; animation: wiggle .6s ease-in-out 1.95s; }
@keyframes wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-4deg); } 55% { transform: rotate(3deg); } 80% { transform: rotate(-1.5deg); } }
.c-glasses { transform-box: view-box; transform-origin: 32px 25px; animation: hop .5s cubic-bezier(.3, 1.6, .5, 1) 2.05s; }
@keyframes hop { 0%, 100% { transform: none; } 45% { transform: translateY(-2px); } }
/* 5. el nombre, en el texto claro de la app y sin efectos */
.clip-word { margin-top: 28px; font-size: clamp(26px, 4.6vw, 40px); font-weight: 600; letter-spacing: .24em; padding-left: .24em;
  color: #e6edf3; opacity: 0; transform: translateY(10px); animation: up .5s cubic-bezier(.2, .9, .2, 1) 2.3s forwards; }
@keyframes up { to { opacity: 1; transform: none; } }
.clip-tag { margin-top: 10px; color: #9198a1; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; opacity: 0;
  animation: fade .5s ease 2.6s forwards; }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .intro *, .intro { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ---------- inicio de sesión ---------- */
.auth { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(900px 600px at 50% 30%, #1a0f14 0%, #07080b 70%); animation: fade .4s ease-out; }
.auth-card { width: min(720px, 100%); text-align: center; }
.auth-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.auth h1 { font-size: 30px; letter-spacing: -.02em; margin: 18px 0 6px; }
.auth .sub { margin: 0 auto 24px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.profile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.profile:hover, .profile.sel { transform: translateY(-3px); border-color: rgba(56, 139, 253, .6); box-shadow: var(--shadow); }
.profile .p-name { font-weight: 700; font-size: 15px; }
.profile .p-rank { color: var(--faint); font-size: 12.5px; }
.profile.add { border-style: dashed; color: var(--muted); justify-content: center; min-height: 128px; }
.profile.add .plus { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-3); display: flex; align-items: center; justify-content: center; }
.pin-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.pin-row input { width: 160px; text-align: center; letter-spacing: .4em; font-size: 18px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; outline: none; }
#auth-new { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; margin-top: 18px; }
#auth-new h1, #auth-new .sub { text-align: center; }
#auth-new h1 { margin-top: 0; }
.belt-preview { display: flex; justify-content: center; margin: 4px 0 18px; }
.belt-preview svg { width: min(420px, 100%); height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5)); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; outline: none; font-size: 14.5px; }
.field input:focus { border-color: rgba(56, 139, 253, .5); }
.belt-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.belt-opt { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.belt-opt svg { width: 100%; height: auto; }
.belt-opt.active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
.stripe-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.stripe-picker button { min-width: 42px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-weight: 700; cursor: pointer; }
.stripe-picker button.active { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.auth-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.auth-actions .danger { margin-right: auto; }

/* ---------- sesión (línea discreta en la barra lateral) ---------- */
.side-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; }
.side-foot .quit { grid-column: auto; padding: 0; }
.session-link { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; min-width: 0; }
.session-link:hover { color: var(--text); }
.uc-belt { width: 30px; flex: none; display: inline-flex; }
.uc-belt:empty { display: none; }
.uc-belt svg { width: 100%; height: auto; }
.uc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.auth-card { position: relative; }
.auth-close { position: absolute; top: 0; right: 0; }
.skip-login { margin-top: 18px; }

/* ---------- progreso ---------- */
.week-nav { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.week-nav h3 { margin: 0; font-size: 17px; min-width: 240px; text-align: center; }
.week-nav .icon-btn { font-size: 20px; line-height: 1; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 108px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: rgba(56, 139, 253, .55); }
.day-h { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.day-h b { color: var(--text); font-size: 15px; }
.sess { --c: var(--accent); position: relative; background: color-mix(in srgb, var(--c) 14%, var(--bg-2)); border-left: 3px solid var(--c); border-radius: 8px; padding: 6px 22px 6px 8px; font-size: 12px; line-height: 1.35; }
.sess b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: color-mix(in srgb, var(--c) 75%, white); }
.sess .x { position: absolute; top: 3px; right: 4px; background: none; border: none; color: var(--faint); cursor: pointer; font-size: 13px; }
.sess.k-clase { --c: var(--c-pasajes); } .sess.k-rolling { --c: var(--c-espalda); } .sess.k-competicion { --c: var(--accent); }
.sess.k-fisico { --c: var(--c-derribos); } .sess.k-estudio { --c: var(--c-guardias); }
.pg-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.pg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scard h3 { margin: 0 0 4px; }
.field select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14.5px; }
.kind-chips { margin: 0; }
.kind-chips .chip::before { display: none; }
.stars { display: flex; gap: 4px; }
.stars button { background: none; border: none; font-size: 24px; color: var(--line-2); cursor: pointer; padding: 0 2px; }
.stars button.on { color: var(--gold); }
.goals { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.goal { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 14px; }
.goal input { accent-color: var(--ok); width: 17px; height: 17px; }
.goal.done span { color: var(--faint); text-decoration: line-through; }
.goal .x { margin-left: auto; background: none; border: none; color: var(--faint); cursor: pointer; }
.plan-week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plan-out:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.upload-card { margin-bottom: 18px; }
.drop { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 26px; border: 2px dashed var(--line-2); border-radius: 14px; color: var(--muted); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: rgba(56, 139, 253, .6); background: var(--accent-soft); color: var(--text); }
.drop.has { border-style: solid; border-color: var(--ok); color: var(--text); }
.upload-progress { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.match { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.match:hover { border-color: var(--line-2); transform: translateY(-2px); }
.match h4 { margin: 0; font-size: 15px; }
.match .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.moments { display: flex; flex-direction: column; gap: 10px; }
.moment { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); padding: 11px 12px; border-left: 3px solid var(--err); }
.moment.acierto { border-left-color: var(--ok); }
.moment-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.moment .t { cursor: pointer; color: var(--accent); font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.moment .kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--err); }
.moment.acierto .kind { color: var(--ok); }
.moment p { margin: 4px 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.moment p b { color: var(--text); }
.moment .clips { grid-template-columns: 1fr; margin-top: 8px; }
.priorities { margin: 8px 0 0; padding-left: 1.2em; color: var(--text); font-size: 14px; }
@media (max-width: 1000px) { .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .pg-cols { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-row { grid-template-columns: 1fr; } .week-nav h3 { min-width: 0; font-size: 15px; } }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; max-width: 380px; animation: pop .2s ease-out; }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--err); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* barras de desplazamiento discretas */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- pantallas estrechas ---------- */
@media (max-width: 1000px) {
  .player-layout { grid-template-columns: 1fr; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .player-main, .player-side { max-height: none; overflow: visible; }  /* en una columna baja la ventana entera */
  .player-side { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar { order: 2; flex-direction: row; padding: 8px 10px; gap: 8px; border-right: none; border-top: 1px solid var(--line); }
  .brand, .side-stats { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav-btn { flex-direction: column; gap: 4px; font-size: 10.5px; padding: 8px 2px; white-space: nowrap; min-width: 0; flex: 1; }
  .view { padding: 20px 16px 30px; }
  .view-head { flex-direction: column; }
  .msg.user .bubble { max-width: 90%; }
  .avatar { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; max-width: none; }
  .seg { overflow-x: auto; }
  .seg button { flex: 1; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; max-height: 100vh; height: 100vh; max-height: 100dvh; height: 100dvh; }
  .player-layout { max-height: 100vh; max-height: 100dvh; }
}

/* ---------- Safari (iPhone/iPad) ---------- */
/* Con menos de 16px, Safari en iPhone amplía la página al tocar un campo de texto. */
@media (max-width: 820px) {
  input, textarea, select, .composer textarea { font-size: 16px; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Barra inferior y campo de texto por encima de la zona del gesto de inicio del iPhone. */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 820px) { .sidebar { padding-bottom: calc(8px + env(safe-area-inset-bottom)); } }
}

/* ---------- equipo de mantenimiento (Fuentes) ---------- */
.scard-ico.team { background: #1f6f4a; }
.team-list { display: flex; flex-direction: column; gap: 6px; }
.agent { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 13px; }
.agent summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.agent summary::-webkit-details-marker { display: none; }
.agent .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.agent.ok .dot { background: #3ccf7a; } .agent.aviso .dot { background: #f5b93d; } .agent.error .dot { background: var(--err); }
.agent-role { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.agent-sum { color: var(--text); margin: 8px 0 0; line-height: 1.45; }
.agent ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); line-height: 1.45; }
.agent li.aviso { color: #f5c76a; } .agent li.error { color: #ff9aa4; }

/* ---------- FloGrappling (enlaces con notas; se ven en su web) ---------- */
.scard-ico.flo { background: #1d1d1f; border: 1px solid #3a3a3d; font-size: 12px; }
.src-badge.flograppling { background: #1d1d1f; }
.flo-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 16 / 9; width: 100%;
  background: radial-gradient(120% 120% at 50% 0%, #2a2d36, #121419); color: #fff; text-decoration: none; border-radius: 10px; }
.flo-name { font-weight: 800; letter-spacing: .02em; font-size: 18px; }
.flo-go { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; }
.flo-cover:hover .flo-go { background: rgba(255, 255, 255, .18); }
.flo-frame { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.flo-frame p { color: var(--muted); font-size: 13.5px; margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flo-form { display: flex; flex-direction: column; gap: 8px; }
.flo-form input, .flo-form textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; outline: none;
  font-size: 13.5px; min-width: 0; resize: vertical; }
.flo-form input:focus, .flo-form textarea:focus { border-color: rgba(56, 139, 253, .5); }
.flo-row { display: flex; gap: 8px; } .flo-row input { flex: 1; }
.flo-form .btn { align-self: flex-start; }
@media (max-width: 820px) { .flo-form input, .flo-form textarea { font-size: 16px; } .flo-row { flex-direction: column; } }

/* Barras de opciones en el iPhone: que quepan sin salirse del borde */
@media (max-width: 820px) { .seg { max-width: 100%; } .seg button { padding-left: 8px; padding-right: 8px; min-width: 0; } }

/* ---------- búsqueda online del Coach (Fuentes) ---------- */
.scard-ico.research { background: #2f4fd1; }
.src-status { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.src-status .ok { color: var(--text); } .src-status .off { color: var(--muted); }
.research-card details summary { cursor: pointer; color: var(--text); margin-bottom: 6px; }

/* =====================================================================================================
   METAJITSU · estética sobria, a lo GitHub: superficies planas, bordes finos de 1 px, un solo azul para
   enlaces y selección y el verde de GitHub para la acción principal. Nada brilla: sin degradados, halos
   ni auroras. Los mismos dos colores que el logo (#0d1117 y #e6edf3).
   ===================================================================================================== */
body { background: var(--bg); }
.sidebar { background: var(--bg-2); border-color: var(--line); }
.brand-name { color: var(--text); font-weight: 600; font-size: 16px; letter-spacing: 0; }
.brand { align-items: center; gap: 10px; }
h1 { font-weight: 600; letter-spacing: -.01em; }

/* superficies planas */
.scard, .card, .suggestion, .match, .day, .plan-item, .clip, .profile, .agent { background: var(--panel); box-shadow: none; }
.card:hover, .suggestion:hover, .profile:hover, .profile.sel { transform: none; box-shadow: none; border-color: var(--line-2); }
.modal { background: rgba(1, 4, 9, .8); backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal-card, .toast, .auth-card { box-shadow: var(--shadow); border-radius: 12px; }
.composer { background: linear-gradient(transparent, var(--bg) 35%); }
.composer textarea { background: var(--bg-2); border-radius: 6px; }
.composer textarea:focus, .search:focus-within, .addrow input:focus, .field input:focus, .note:focus,
.flo-form input:focus, .flo-form textarea:focus { border-color: #1f6feb; box-shadow: 0 0 0 1px #1f6feb; }

/* botones como los de GitHub */
.btn { border-radius: 6px; box-shadow: none; }
.btn.primary, .send { background: #238636; border: 1px solid rgba(240, 246, 252, .1); color: #fff; box-shadow: none; }
.btn.primary:hover, .send:hover { background: #2ea043; filter: none; }
.btn.ghost { background: #21262d; border-color: rgba(240, 246, 252, .1); }
.btn.ghost:hover { background: #292e36; border-color: #8b949e; }

/* navegación: fondo gris suave y la marca azul a la izquierda, como la barra lateral de GitHub */
.nav-btn { border-radius: 6px; }
.nav-btn.active { background: rgba(177, 186, 196, .12); border-color: transparent; box-shadow: inset 2px 0 0 #1f6feb; color: var(--text); }
.nav-btn.active .ico { color: var(--text); }
.seg { border-radius: 6px; }
.seg button { border-radius: 5px; }
.seg button.active, .chip.active { background: #21262d; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-count { background: #1f6feb; }

/* mensajes y clips */
.msg.user .bubble { background: var(--panel-3); border: 1px solid var(--line); color: var(--text); border-radius: 12px 12px 4px 12px; }
.clipref { background: rgba(56, 139, 253, .1); color: #79c0ff; border-color: rgba(56, 139, 253, .4); }
.clip-n, .ch-time { color: #79c0ff; }
.thumb .play span, .clip-embed-cover span, .plan-thumb span { background: rgba(1, 4, 9, .72); border: 1px solid rgba(240, 246, 252, .25); box-shadow: none; }
.upload-progress span { background: #238636; }
.toast { border-left-color: #1f6feb; }
.belt-hero { box-shadow: 0 0 0 1px var(--line); }
a { color: #4493f8; }

/* intro: el emblema sobre el fondo de la app, el nombre en el texto claro de la app */
.intro { background: #0d1117; }
.scard-ico.team, .scard-ico.research, .scard-ico.phone { background: #21262d; border: 1px solid var(--line); color: var(--text); }
.lib-more { display: block; margin: 18px auto 6px; }
@media (max-width: 820px) { #lib-source button, #ex-platform button { flex: none; padding-left: 12px; padding-right: 12px; } }

/* «Buscar el momento exacto» en los vídeos de YouTube que encuentra el Coach */
.moments { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.moments .btn .spinner { margin-right: 6px; }
.moment-list { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.moment { text-align: left; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
  padding: 6px 9px; font-size: 13px; cursor: pointer; }
.moment b { color: #79c0ff; margin-right: 6px; font-variant-numeric: tabular-nums; }
.moment:hover, .moment.on { border-color: #1f6feb; }

/* Versión pública (la web): cada persona con su cuenta tiene Mi plan y Progreso; Fuentes, reiniciar, la Game
   Bar y «Añadir a la biblioteca» son solo del dueño */
body.visitor .nav-btn[data-view="sources"],
body.visitor #quit,
body.visitor #lib-source [data-src="gamebar"],
body.visitor [data-import] { display: none !important; }
.need-account { display: none; }
body.visitor.no-account .need-account { display: block; padding: 22px; margin: 0 0 18px; border: 1px solid var(--line-2);
  border-radius: 18px; background: var(--panel); flex-shrink: 0; }
.need-account p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 60ch; }
body.visitor.no-account #view-progress > :not(.view-head):not(.need-account),
body.visitor.no-account #view-plan > :not(.view-head):not(.need-account) { display: none !important; }
.pf-delete { display: block; margin: 16px auto 0; font-size: 13px; }
/* las filas de filtros nunca se aplastan (en el móvil, la de categorías se quedaba en 2 px) */
.chips, .toolbar, .view-head { flex-shrink: 0; }

/* =====================================================================================================
   METAJITSU v3 · minimalista y con chispa. La misma base sobria (fondo #0d1117, bordes de 1 px, azul y verde
   de GitHub), con menos ruido y más respuesta al tacto: cada pulsación se nota, lo nuevo entra con un pequeño
   salto y lo que sale bien se celebra en verde. Sin brillos, halos ni degradados.
   ===================================================================================================== */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --pop: #3fb950;             /* verde de «hecho» */
  --belt: #da3633;            /* la punta roja del cinturón: solo para detalles */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 12px;
}
body { font-family: var(--font); font-feature-settings: "cv11", "ss01"; letter-spacing: -.005em; }

/* menos ruido: cabeceras limpias, más aire */
.view { padding: 32px 40px 48px; }
.view-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.035em; }
.sub { color: var(--faint); }
.section-title { text-transform: none; letter-spacing: -.01em; font-size: 16px; color: var(--text); font-weight: 600; }
.side-stats .stat { background: transparent; border-color: transparent; padding: 6px 8px; }
.side-stats .stat-num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* todo responde al tacto */
.btn, .nav-btn, .chip, .seg button, .suggestion, .card, .clip, .icon-btn, .plat-toggle, .moment, .clipref {
  transition: transform .18s var(--spring), background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:active, .chip:active, .seg button:active, .icon-btn:active, .plat-toggle:active, .moment:active { transform: scale(.96); }
.nav-btn:active { transform: scale(.98); }
.card:hover, .suggestion:hover { transform: translateY(-2px); border-color: #8b949e; }
.card:active, .suggestion:active { transform: translateY(0) scale(.985); }
.card .thumb img { transition: transform .4s var(--ease); }
.card:hover .thumb img { transform: scale(1.04); }
.thumb .play span { transition: transform .2s var(--spring); }
.card:hover .thumb .play span { transform: scale(1.12); }
:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }

/* navegación: la marca activa entra con un pequeño rebote */
.nav-btn { position: relative; }
.nav-btn.active { box-shadow: none; }
.nav-btn.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: #1f6feb; animation: bar-in .3s var(--spring); }
@keyframes bar-in { from { transform: scaleY(.2); opacity: 0; } }

/* sugerencias del Coach: un punto de color por categoría, sin cajas pesadas */
.suggestion { border-radius: var(--radius); position: relative; }
.suggestion .sg-cat { display: inline-flex; align-items: center; gap: 6px; }
.suggestion .sg-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* chat: los mensajes entran con un pequeño salto; los clips, uno detrás de otro */
.msg:last-child, .msg:nth-last-child(2) { animation: rise .32s var(--spring) both; }  /* solo lo nuevo (el chat se repinta entero) */
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.msg.bot .bubble { border-radius: 4px 14px 14px 14px; }
.msg.user .bubble { border-radius: 14px 14px 4px 14px; background: #1f6feb; border-color: #1f6feb; color: #fff; }
.msg:last-child .clips .clip { animation: rise .4s var(--spring) both; border-radius: var(--radius); }
.clips .clip:nth-child(2) { animation-delay: .06s; }
.clips .clip:nth-child(3) { animation-delay: .12s; }
.clips .clip:nth-child(4) { animation-delay: .18s; }
.clips .clip:nth-child(5) { animation-delay: .24s; }
.clips .clip:nth-child(n+6) { animation-delay: .3s; }
.clip:hover { border-color: #8b949e; }
.clip-n { color: var(--pop); letter-spacing: .04em; }
.clipref { border-radius: 999px; }
.clipref:hover { transform: translateY(-1px); background: rgba(56, 139, 253, .2); }

/* composer: el botón de enviar se «enciende» cuando hay algo que mandar */
.composer textarea { border-radius: 14px; padding: 15px 18px; transition: border-color .15s, box-shadow .15s; }
.send { border-radius: 14px; transition: transform .2s var(--spring), background .15s, opacity .15s; }
.composer:has(textarea:placeholder-shown) .send { opacity: .45; transform: scale(.94); }
.composer:has(textarea:not(:placeholder-shown)) .send { transform: scale(1); }
.send:active { transform: scale(.9) !important; }

/* pasos del Coach mientras piensa: una barra fina que avanza */
.steps-live { position: relative; overflow: hidden; }
.steps-live::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #1f6feb, transparent); animation: scan 1.4s var(--ease) infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* avisos: entran desde abajo con rebote; lo que sale bien, en verde y con un check */
.toast { border-radius: var(--radius); animation: toast-in .38s var(--spring) both; border-left-width: 3px; }
.toast.ok { border-left-color: var(--pop); }
.toast.ok::before { content: "\2713"; color: var(--pop); font-weight: 700; margin-right: 8px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* chips y segmentos: la opción elegida da un pequeño salto */
.chip.active, .seg button.active { animation: pick .28s var(--spring); }
@keyframes pick { 50% { transform: scale(1.06); } }

/* tarjetas: más redondeadas y limpias */
.scard, .card, .modal-card, .auth-card { border-radius: var(--radius); }
.card .thumb { border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }

/* plataformas de pago */
.premium-card { grid-column: span 2; }
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.plat { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); overflow: hidden;
  transition: border-color .15s, background .15s; }
.plat.on { border-color: rgba(63, 185, 80, .55); background: rgba(63, 185, 80, .07); }
.plat-toggle { flex: 1; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13.5px; text-align: left; min-width: 0; }
.plat-toggle b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plat.on .plat-toggle { color: var(--text); }
.plat-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; transition: all .25s var(--spring); }
.plat.on .plat-dot { background: var(--pop); border-color: var(--pop); transform: scale(1.15); box-shadow: 0 0 0 3px rgba(63, 185, 80, .18); }
.plat-n { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.plat-login { display: inline-flex; align-items: center; padding: 0 11px; color: var(--faint); border-left: 1px solid var(--line); }
.plat-login:hover { color: var(--text); background: var(--panel-2); }
.scard-ico.flo { background: #21262d; border: 1px solid var(--line); color: var(--text); font-size: 11px; letter-spacing: .06em; }

@media (max-width: 820px) {
  .view { padding: 20px 16px 32px; }
  .nav-btn.active::before { display: none; }
  .premium-card { grid-column: auto; }
  .plat-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* agentes programados (tarjeta Equipo) */
.sched { margin: 12px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: 13px; }
.sched-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.sched-row b { color: var(--text); font-weight: 600; }
.sched-news summary { cursor: pointer; color: var(--text); font-weight: 600; }
.sched-news ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* =====================================================================================================
   METAJITSU v4 · la enciclopedia viva del jiu-jitsu. Moderna, sencilla y con gancho: fondo casi negro, superficies
   con un punto de profundidad, un azul eléctrico para lo principal y el rojo de la punta del cinturón como sello.
   Mucho aire, textos grandes y claros, todo responde al tocar. Sin logo dentro de la app; se abre en el Coach.
   ===================================================================================================== */
:root {
  --bg: #0a0d14;
  --bg-2: #07090e;
  --panel: #11151f;
  --panel-2: #161b27;
  --panel-3: #1d2331;
  --line: #222a3a;
  --line-2: #2f3850;
  --text: #eef2f8;
  --muted: #9aa4b8;
  --faint: #6c768c;
  --accent: #4f7cff;
  --accent-2: #3a63e6;
  --accent-soft: rgba(79, 124, 255, .14);
  --red: #f0454f;           /* la punta roja del cinturón negro: el sello de METAJITSU */
  --pop: #34d17b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --c-atleta: #ff9f43;
  --c-mindset: #c084fc;
}
body { background: var(--bg); }
::selection { background: rgba(79, 124, 255, .35); }

/* barra lateral: limpia, el nombre con su punta roja */
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.brand-name::after { content: ""; width: 18px; height: 6px; border-radius: 2px; background: linear-gradient(90deg, #111 0 58%, var(--red) 58% 100%);
  box-shadow: 0 0 0 1px #2a2f3c; }
.brand-sub { color: var(--faint); }
.nav-btn { border-radius: 12px; font-weight: 600; color: var(--muted); padding: 11px 12px; }
.nav-btn:hover { background: var(--panel); color: var(--text); }
.nav-btn.active { background: var(--panel-2); color: var(--text); }
.nav-btn.active::before { background: var(--accent); }
.nav-btn.active .ico { color: var(--accent); }

/* botones */
.btn { border-radius: 12px; font-weight: 600; }
.btn.primary, .send { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover, .send:hover { background: #6189ff; }
.btn.ghost { background: var(--panel-2); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--panel-3); border-color: #3c4763; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted);
  transition: transform .18s var(--spring), color .15s, background .15s, border-color .15s; }
.icon-btn:hover { color: var(--text); background: var(--panel-3); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.seg { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border-radius: 9px; }
.seg button.active, .chip.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* cabecera del Coach */
.coach-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#kind-seg button.active { background: var(--accent-soft); color: #c9d6ff; box-shadow: inset 0 0 0 1px rgba(79, 124, 255, .45); }
.view-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }

/* inicio del Coach: grande, claro e invitador */
.chat-empty { padding-top: 4vh; }
.chat-empty h2 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; margin: 18px 0 8px; }
.chat-empty > p { color: var(--muted); font-size: 16px; }
.suggestions { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.suggestion { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 15px;
  text-align: left; overflow: hidden; position: relative; }
.suggestion::after { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); opacity: .9; }
.suggestion:hover { border-color: var(--line-2); background: var(--panel-2); transform: translateY(-3px); }
.suggestion .sg-cat { color: var(--c); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.suggestion .sg-t { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.suggestion .sg-q { color: var(--muted); }

/* el campo de texto: una cápsula flotante con clip, micro y enviar */
.composer { gap: 8px; align-items: center; padding: 12px 0 18px; }
.composer textarea { background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; padding: 14px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 124, 255, .18), 0 8px 28px rgba(0, 0, 0, .35); }
.send { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.composer .icon-btn { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.mic.listening { color: #fff; background: var(--red); border-color: var(--red); animation: listen 1.2s ease-in-out infinite; }
@keyframes listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 69, 79, .55); } 50% { box-shadow: 0 0 0 10px rgba(240, 69, 79, 0); } }

/* mensajes */
.msg.user .bubble { background: var(--accent); border-color: var(--accent); border-radius: 18px 18px 6px 18px; }
.msg.bot .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 6px 18px 18px 18px; padding: 18px 22px; }
.md { font-size: 15.5px; line-height: 1.65; }
.md strong { color: #fff; }
.listen-btn { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: transform .18s var(--spring), color .15s, background .15s; }
.listen-btn:hover { color: var(--text); }
.listen-btn.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.listen-btn:active { transform: scale(.95); }
.clip { border-radius: 14px; overflow: hidden; }

/* tarjetas de vídeo */
.card { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.card:hover { border-color: var(--line-2); }
.card-title { font-weight: 700; }

/* ---------------------------------------------------------------- Enciclopedia */
.enc-cat { margin: 6px 0 26px; }
.enc-cat h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.enc-cat h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.enc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.enc-item { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; color: var(--text);
  cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit;
  transition: transform .18s var(--spring), border-color .15s, background .15s; }
.enc-item b { font-size: 15px; font-weight: 700; }
.enc-item span { color: var(--faint); font-size: 12.5px; }
.enc-item:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--panel-2); }
.enc-item:active { transform: scale(.97); }
.enc-athletes { display: flex; flex-wrap: wrap; gap: 8px; }
.enc-athlete { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; font: inherit; font-size: 14px;
  font-weight: 600; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: transform .18s var(--spring), border-color .15s; }
.enc-athlete .avatar { display: inline-flex !important; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; background: var(--panel-3); color: var(--muted); }
.enc-athlete.star .avatar { background: rgba(255, 159, 67, .18); color: var(--c-atleta); }
.enc-athlete:hover { transform: translateY(-2px); border-color: var(--line-2); }
.enc-entry { max-width: 1100px; }
.enc-back { margin-bottom: 14px; }
.enc-head { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; position: relative; overflow: hidden; }
.enc-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.enc-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.035em; margin: 10px 0 6px; }
.enc-syn { color: var(--muted); margin: 0 0 14px; }
.enc-desc { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; margin: 14px 0 6px; }
.enc-writing { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.enc-sec { font-size: 17px; font-weight: 800; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.enc-sec span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

/* móvil: la barra de abajo se desliza (7 secciones) y todo a un dedo */
@media (max-width: 820px) {
  .nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { flex: 0 0 auto; min-width: 66px; padding: 8px 6px; }
  .coach-tools { width: 100%; }
  .hide-sm { display: none; }
  .chat-empty h2 { font-size: 30px; }
  .suggestions { grid-template-columns: 1fr; }
  .composer { gap: 6px; }
  .composer .icon-btn { width: 40px; height: 40px; }
  .send { width: 44px; height: 44px; }
  .enc-grid { grid-template-columns: 1fr 1fr; }
  .enc-head, .enc-desc { padding: 18px; }
}

/* versión pública: los visitantes no suben vídeos */
body.visitor #attach { display: none !important; }

/* ---------------------------------------------------------------- v4.1 · tu nombre, la voz y tus grabaciones */
.session-link { font-size: 13.5px; gap: 9px; }
.uc-belt { width: 36px; }
.uc-name { max-width: 150px; font-weight: 600; }

.voice-wrap { position: relative; display: inline-flex; gap: 6px; }
.coach-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 290px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  animation: rise .2s var(--spring); }
.cm-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cm-voice { display: flex; align-items: center; gap: 4px; }
.cm-pick { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; background: none; border: none;
  border-radius: 10px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.cm-pick:hover { background: var(--panel-2); }
.cm-pick b { font-weight: 600; }
.cm-pick small { margin-left: auto; color: var(--muted); font-size: 12px; }
.cm-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.cm-voice.on .cm-dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px); }
.cm-play { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); cursor: pointer; transition: transform .18s var(--spring); }
.cm-play:hover { color: var(--text); }
.cm-play.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.cm-play:active { transform: scale(.92); }
.cm-rec { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cm-rec .toggle { color: var(--text); }
.cm-help { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
body.visitor .cm-rec { display: none; }

.rec-offer { margin-top: 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start; padding: 14px 16px;
  border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(79, 124, 255, .35); animation: rise .3s var(--spring); }
.ro-ico { color: var(--accent); margin-top: 2px; }
.ro-txt b { display: block; color: #fff; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.ro-txt span { color: var(--muted); font-size: 13px; }
.ro-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .coach-menu { position: fixed; left: 16px; right: 16px; top: auto; bottom: 96px; width: auto; }
  .ro-act .btn { flex: 1; min-height: 40px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .coach-menu, .rec-offer { animation: none; } }

/* =====================================================================================================
   METAJITSU v5 · más clara y más limpia. El mismo oscuro, un punto más luminoso; menos bordes y menos cajas: las
   respuestas del Coach van sobre el fondo, como en las apps de chat. En el móvil encaja al milímetro (iPhone y
   Android): sin scroll lateral, cabecera compacta, campo de texto pegado abajo y 5 botones en la barra.
   ===================================================================================================== */
:root {
  --bg: #11151d;
  --bg-2: #0e1219;
  --panel: #171c26;
  --panel-2: #1c2230;
  --panel-3: #242b3a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f2f5fa;
  --muted: #a6afc0;
  --faint: #7c879c;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
body { background: var(--bg); grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); }
.view { padding: 28px 40px 44px; }

/* el Coach responde sobre el fondo (sin caja); tus preguntas, en una burbuja */
.msg.bot .bubble { background: transparent; border: none; padding: 2px 0; border-radius: 0; }
.msg.user .bubble { background: var(--panel-3); border: none; color: var(--text); border-radius: 20px 20px 6px 20px; padding: 11px 16px; }
.md { font-size: 16px; line-height: 1.68; }
.composer textarea { background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 6px 22px rgba(0, 0, 0, .25); }

/* ideas de inicio: limpias, un punto de color y nada más */
.suggestion { background: var(--panel); border: 1px solid var(--line); }
.suggestion::after { display: none; }
.suggestion .sg-cat { display: inline-flex; align-items: center; gap: 6px; }
.suggestion .sg-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.suggestion:hover { background: var(--panel-2); border-color: var(--line-2); }
.enc-head::before { display: none; }
.enc-head, .enc-desc { border-color: var(--line); }

/* ---------------------------------------------------------------- avatares de los atletas (su foto o sus iniciales) */
.avatar { position: relative; overflow: hidden; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 30px; height: 30px; font-size: 11px; font-weight: 800; background: var(--panel-3); color: var(--muted); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; }
.avatar.md { width: 42px; height: 42px; font-size: 14px; }
.avatar.lg { width: 92px; height: 92px; font-size: 30px; }
.enc-athlete { padding: 5px 14px 5px 5px; }
.enc-athlete .avatar { width: 32px; height: 32px; }
.enc-item span { color: var(--muted); line-height: 1.35; }
.enc-def { font-size: 16px; color: var(--muted); margin: 0 0 8px; }
.enc-head.athlete { display: flex; gap: 20px; align-items: center; }
.enc-head-txt { min-width: 0; flex: 1; }
.enc-head-txt h2 { margin-top: 6px; }
.enc-syn a { color: var(--faint); font-size: 12.5px; }

/* ---------------------------------------------------------------- «Dónde ver»: YouTube, gratis y de pago */
.where { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.where-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.where-head small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.where-head b { font-size: 17px; }
.where-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.where-tabs::-webkit-scrollbar { display: none; }
.where-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2); }
.where-tabs button span { font-size: 11.5px; opacity: .75; }
.where-tabs button.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.where-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 6px; overscroll-behavior-x: contain; }
.where-row > * { scroll-snap-align: start; min-width: 0; }
.paid-list { display: flex; flex-direction: column; gap: 8px; }
.paid { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.paid-main { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: none; border: none;
  color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.paid-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--muted); }
.paid-ico svg { width: 18px; height: 18px; }
.paid.open .paid-ico { background: rgba(52, 209, 123, .15); color: var(--pop); }
.paid-txt { flex: 1; min-width: 0; }
.paid-txt b { display: block; font-size: 15px; }
.paid-txt small { color: var(--muted); font-size: 12.5px; }
.paid-go { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.paid.open .paid-go { color: var(--pop); border-color: rgba(52, 209, 123, .4); }
.paid-more { padding: 0 14px 14px; }
.paid-more p { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 10px; }
body.visitor .owner-only { display: none !important; }

/* «Más» (solo móvil): Progreso, Explorar y Fuentes */
.nav-more { display: none; }
.more-sheet { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 8px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 2px; animation: rise .2s var(--spring); }
.sheet-btn { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border: none; border-radius: 12px; background: none;
  color: var(--text); font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; text-align: left; }
.sheet-btn:active, .sheet-btn:hover { background: var(--panel-2); }
body.visitor .sheet-btn[data-view="sources"] { display: none; }

/* ---------------------------------------------------------------- móvil (iPhone y Android) */
@media (max-width: 820px) {
  html, body { height: 100%; height: 100dvh; }
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; overscroll-behavior: none; }
  .main, .sidebar { min-width: 0; }
  .view { padding: calc(10px + env(safe-area-inset-top)) 16px 20px; }
  .view-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
  .view-head h1 { font-size: 24px; }
  .view-head .sub { font-size: 14px; margin-top: 2px; }
  /* Coach: cabecera de una línea (la barra de abajo ya dice dónde estás) */
  #view-coach .view-head { margin-bottom: 6px; }
  #view-coach .view-head > div:first-child { display: none; }
  .coach-tools { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 6px; }
  .coach-tools .icon-btn { width: 40px; height: 40px; }
  #kind-seg button { padding: 7px 11px; font-size: 13.5px; }
  #new-chat { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .voice-wrap { margin-left: auto; }
  /* barra de abajo: 5 botones del mismo ancho */
  .sidebar { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .nav { overflow: visible; justify-content: space-between; gap: 0; }
  .nav-btn { flex: 1 1 0; min-width: 0; padding: 7px 2px; font-size: 10.5px; border-radius: 12px; }
  .nav-btn span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-btn[data-view="progress"], .nav-btn[data-view="explore"], .nav-btn[data-view="sources"] { display: none; }
  .nav-more { display: flex; }
  .nav-btn.active::before { display: none; }
  /* inicio del Coach */
  .chat-empty { padding: 4px 0 8px; margin: auto 0; width: 100%; }
  .chat-empty h2 { font-size: 27px; margin: 12px 0 6px; }
  .chat-empty > p { font-size: 15px; margin-bottom: 16px; }
  .belt-hero { transform: scale(.8); }
  .suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .suggestion { padding: 12px 12px 13px; border-radius: 14px; min-height: 84px; }
  .suggestion .sg-cat { font-size: 10.5px; }
  .suggestion .sg-t { font-size: 14.5px; line-height: 1.3; }
  .suggestion .sg-q { display: none; }
  /* conversación */
  .chat { gap: 18px; padding-bottom: 12px; }
  .msg { gap: 0; }
  .msg.user .bubble { max-width: 85%; }
  .clips, .grid { grid-template-columns: minmax(0, 1fr); }
  .where-row { grid-auto-columns: 78%; }
  /* campo de texto: pegado abajo, todo dentro de la pantalla */
  .composer { gap: 6px; padding: 8px 0 10px; align-items: flex-end; }
  .composer textarea { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 22px; min-height: 44px; }
  .composer .icon-btn { width: 40px; height: 40px; }
  .send { width: 44px; height: 44px; }
  /* Enciclopedia */
  .enc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .enc-item { padding: 11px 12px; }
  .enc-item b { font-size: 14.5px; }
  .enc-head.athlete { flex-direction: column; align-items: flex-start; gap: 12px; }
  .avatar.lg { width: 76px; height: 76px; font-size: 26px; }
  .enc-head h2 { font-size: 28px; }
  /* avisos y menús por encima de la barra de abajo */
  .toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
@media (max-width: 380px) {
  #kind-seg button { padding: 7px 8px; font-size: 13px; }
  .nav-btn { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .more-sheet { animation: none; } }
.suggestion::before { display: none; }
.where-row .card-tech, .where-row .card-foot { display: none; }
.where-row .card-title { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.where-row .card-body { padding: 10px 12px 12px; }
@media (max-width: 820px) { .where-row { grid-auto-columns: 62%; } }
@media (max-width: 820px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: none; }
}

/* ---------------------------------------------------------------- análisis de combates: cada fallo y su corrección */
.mm-score { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px; }
.mm-score span { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.mm-score b { font-size: 22px; font-weight: 800; }
.mm-score .bad { background: rgba(240, 69, 79, .12); color: #ff8a92; }
.mm-score .good { background: rgba(52, 209, 123, .12); color: #6be3a2; }
.mm-timeline { position: relative; height: 26px; margin: 4px 0 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.tl-mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--bg);
  background: var(--pop); cursor: pointer; padding: 0; }
.tl-mark.error { background: var(--red); }
.tl-mark.error.baja { background: #f5b93d; }
.tl-mark.error.alta { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.tl-mark:hover { transform: scale(1.3); }
.mm-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(245, 185, 61, .12); color: #f5cf7a; font-size: 13.5px; }
.mm-sec { margin: 4px 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mm-sec.bad { color: #ff8a92; }
.mm-sec.good { color: #6be3a2; margin-top: 18px; }
.mm-card { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 14px; background: var(--panel); padding: 12px 14px;
  margin-bottom: 10px; }
.mm-card.error.baja { border-left-color: #f5b93d; }
.mm-card.acierto { border-left-color: var(--pop); }
.mm-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.mm-t { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 10px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--panel-3); color: var(--text); font: inherit; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mm-kind { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #ff8a92; }
.mm-card.error.baja .mm-kind { color: #f5cf7a; }
.mm-card.acierto .mm-kind { color: #6be3a2; }
.mm-pos { font-size: 12px; color: var(--muted); }
.mm-card p { margin: 4px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.mm-card .mm-tech { color: var(--text); font-weight: 700; }
.mm-why b, .mm-drill b { color: var(--text); }
.mm-fix { margin: 8px 0 6px; padding: 10px 12px; border-radius: 12px; background: rgba(52, 209, 123, .1); border: 1px solid rgba(52, 209, 123, .25); }
.mm-fix b { display: inline-flex; align-items: center; gap: 6px; color: #6be3a2; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.mm-card .mm-fix p { color: var(--text); margin: 4px 0 0; }
.mm-card .clips { grid-template-columns: 1fr; margin-top: 8px; }
@media (max-width: 820px) { .mm-score b { font-size: 20px; } .mm-card p { font-size: 15px; } }

/* iniciales de colores para quien aún no tiene foto; botón de texto para cambiarla */
.avatar { background: hsl(var(--h, 220) 32% 24%); color: hsl(var(--h, 220) 75% 84%); }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.mm-ok { color: #6be3a2; }
#match-modal .close { z-index: 6; background: var(--panel-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
@media (max-width: 820px) { #match-modal .close { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; } }



.legal-link { margin: 18px 0 0; text-align: center; font-size: 12.5px; }
.legal-link a, .sheet-legal { color: var(--faint); text-decoration: none; }
.sheet-legal { font-size: 13.5px; font-weight: 500; min-height: 40px; }

/* Enciclopedia: salen todos los atletas; el dueño puede ver solo a quién le falta la foto */
.enc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; }

/* Grappling DNA (antes «Enciclopedia»): en la barra del móvil no cabe entero, sale «DNA» */
@media (max-width: 520px) {
  .nav-btn [data-short] { font-size: 0; }
  .nav-btn [data-short]::after { content: attr(data-short); font-size: 10.5px; }
}
