:root {
  --bg: #f6f6f4; --panel: #ffffff; --ink: #1d1f22; --muted: #6b7078; --line: #e2e2de; --soft: #efefeb;
  --accent: #2f5d8a; --warn: #a15c00; --bad: #a33a3a; --ok: #2f7a4b;
  --A: #2f6fd0; --B: #2b9a5b; --M: #8a55c2; --discard: #9a9a9a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --side: 220px; --pw: 440px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15171a; --panel: #1d2024; --ink: #e6e6e3; --muted: #9aa0a8; --line: #2e3237; --soft: #24282d;
          --accent: #7aa7d6; --warn: #d9a04a; --bad: #e07a7a; --ok: #6cc290;
          --A: #6b9ff0; --B: #5cc48a; --M: #b48ae6; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); }
a { color: var(--accent); cursor: pointer; text-decoration: none; }
#side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--panel); border-right: 1px solid var(--line);
        padding: 16px 14px; overflow-y: auto; }
.brand { font-weight: 650; font-size: 17px; letter-spacing: .2px; margin-bottom: 14px; }
.brand span { color: var(--muted); font-weight: 400; }
.runsel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.runsel select { width: 100%; margin-top: 4px; }
#nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
#nav a:hover { background: var(--soft); }
#nav a.on { background: var(--soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.principle { font-size: 11.5px; color: var(--muted); margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
#main { min-width: 0; overflow-x: hidden; margin-left: var(--side); margin-right: calc(var(--pw) + 24px); padding: 20px 24px 80px; min-height: 100vh; }
h1 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 15px; margin: 22px 0 8px; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.player { position: fixed; right: 12px; top: 12px; width: var(--pw); background: var(--panel); border: 1px solid var(--line);
          border-radius: 10px; padding: 8px; z-index: 20; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.player video { width: 100%; border-radius: 6px; background: #000; display: block; }
.player.folded video { display: none; }
.phead { display: flex; justify-content: space-between; align-items: center; font: 12px var(--mono); color: var(--muted); padding: 0 2px 6px; }
.phead button { border: 0; background: var(--soft); color: var(--ink); border-radius: 4px; width: 24px; cursor: pointer; }
@media (max-width: 1100px) {
  :root { --pw: 320px; }
}
@media (max-width: 820px) {
  #side { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  #main { margin: 0; padding: 16px; }
  .player { position: sticky; top: 0; width: auto; right: auto; margin: 0 16px; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; }
.g3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { overflow-wrap: break-word; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.ts { font: 12px var(--mono); color: var(--accent); white-space: nowrap; cursor: pointer; }
.ts:hover { text-decoration: underline; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; background: var(--soft); color: var(--ink); margin: 0 3px 3px 0; white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.error { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.chip.waiting, .chip.pendiente { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.role { display: inline-block; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 4px; color: #fff; font-weight: 600; font-size: 12px; }
.rA { background: var(--A); } .rB { background: var(--B); } .rM { background: var(--M); } .rdiscard, .r\? { background: var(--discard); }
.bA { border-left: 4px solid var(--A); } .bB { border-left: 4px solid var(--B); } .bM { border-left: 4px solid var(--M); } .b\? { border-left: 4px solid var(--discard); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
select, input[type=text], textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
textarea { width: 100%; min-height: 34px; }
button.btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button.btn:hover { background: var(--soft); }
button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.seg { font: 12px var(--sans); border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 3px 9px; cursor: pointer; margin-right: -1px; }
button.seg:first-child { border-radius: 6px 0 0 6px; } button.seg:last-child { border-radius: 0 6px 6px 0; }
button.seg.on { color: #fff; }
button.seg.on.sA { background: var(--A); border-color: var(--A); } button.seg.on.sB { background: var(--B); border-color: var(--B); }
button.seg.on.sM { background: var(--M); border-color: var(--M); } button.seg.on.sdiscard { background: var(--discard); border-color: var(--discard); }
.thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.thumbs img { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; cursor: pointer; outline: 3px solid transparent; }
.thumbs img.ovA { outline-color: var(--A); } .thumbs img.ovB { outline-color: var(--B); } .thumbs img.ovM { outline-color: var(--M); } .thumbs img.ovdiscard { outline-color: var(--discard); }
.shot img { width: 100%; border-radius: 6px; display: block; }
.turn { padding: 8px 12px; margin-bottom: 6px; background: var(--panel); border-radius: 6px; }
.turn.disc { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.kv b { font-weight: 600; } .kv span { font-variant-numeric: tabular-nums; }
.stat { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.base { font-size: 11.5px; color: var(--muted); }
pre { font: 12px/1.4 var(--mono); background: var(--soft); padding: 10px; border-radius: 6px; overflow: auto; max-height: 60vh; white-space: pre-wrap; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.mbox { background: var(--panel); width: min(900px, 92vw); max-height: 86vh; overflow: auto; border-radius: 10px; padding: 18px; position: relative; }
.mclose { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink); }
canvas.tl { width: 100%; display: block; cursor: crosshair; border-radius: 6px; background: var(--panel); }
.heat { width: 100%; display: block; image-rendering: pixelated; border-radius: 4px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }
.qa img { width: 100%; border-radius: 6px; cursor: pointer; }
.savebar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 0; margin-top: 10px; display: flex; gap: 12px; align-items: center; }

button.play { border: 1px solid var(--line); background: var(--panel); color: var(--accent); border-radius: 50%; width: 22px; height: 22px; font-size: 10px; line-height: 1; cursor: pointer; padding: 0; }
button.play:hover { background: var(--accent); color: #fff; }
.ficha .portrait { width: 100%; aspect-ratio: 1 / 1.05; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.ficha .portrait.empty { background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cmp { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmp:last-child { border-bottom: 0; }
.cmpl { font-weight: 600; font-size: 13px; }
.cmprow { display: grid; grid-template-columns: 28px 1fr 80px minmax(120px, 34%); gap: 8px; align-items: center; margin: 3px 0; }
.track { background: var(--soft); border-radius: 4px; height: 12px; overflow: hidden; }
.fill { height: 100%; border-radius: 4px; }
.cmpv { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.autab td.zc { min-width: 90px; }
.zb { position: relative; height: 8px; background: var(--soft); border-radius: 3px; }
.zb::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.zf { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.zf.pos { background: #cd463c; } .zf.neg { background: #3c6ecd; }
.zc span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .cmp { grid-template-columns: 1fr; } .cmprow { grid-template-columns: 28px 1fr 70px; } .cmprow .base { display: none; } }
.kv { grid-template-columns: minmax(120px, 45%) 1fr; }

.stack { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--soft); margin: 4px 0; }
.stack div { height: 100%; }
.interp-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 10px; text-align: center; line-height: 14px; font-style: italic; margin-left: 4px; }
.interp-chip { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); font-weight: 600; }
.interp-banner { border-left: 4px solid var(--warn); }
.turn.interp { border-right: 3px dashed color-mix(in srgb, var(--warn) 60%, transparent); }
.lexrow { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 40px 46px; gap: 6px; align-items: center; margin: 2px 0; cursor: pointer; font-size: 13px; }
.lexrow:hover .lt { text-decoration: underline; }
.chip.ver-coincide { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.ver-matiz { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.ver-no_coincide { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.chip.ver-sin_fuente_fiable, .chip.ver-no_verificable { background: var(--soft); color: var(--muted); }

.claim { display: grid; grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1.2fr) 150px; gap: 14px; background: var(--panel);
         border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.claim .cq { font-size: 14px; } .claim .cif { margin-top: 6px; } .claim .cr textarea { margin-top: 6px; }
@media (max-width: 1300px) { .claim { grid-template-columns: 120px 1fr; } .claim .cv, .claim .cr { grid-column: 2; } }

.noimg { background: var(--soft); color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; min-height: 64px; border-radius: 6px; }
.metodo h2, .metodo h3, .metodo h4 { margin: 16px 0 6px; } .metodo table { margin: 8px 0; } .metodo td { font-size: 12.5px; }
a.btn { display: inline-block; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px; color: var(--ink); }
a.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
code { font: 12px var(--mono); background: var(--soft); padding: 0 4px; border-radius: 3px; }
.unsaved { position: sticky; top: 0; z-index: 5; border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.chip.rev { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* sincronización con el vídeo */
.now { box-shadow: inset 0 0 0 2px var(--accent) !important; background: color-mix(in srgb, var(--accent) 9%, var(--panel)) !important; transition: background .2s; }
tr.now td { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.plotwrap { position: relative; }
.vline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); pointer-events: none; display: none; z-index: 3; }
#pfollow { width: auto; padding: 0 6px; font-size: 11px; }
#pfollow.on { background: var(--accent); color: #fff; }

.contact label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.contact input[type=text], .contact input[type=email], .contact textarea { display: block; width: 100%; margin-top: 4px; font-size: 14px; }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* marca */
.brand { display: flex; justify-content: space-between; align-items: center; }
.brandlink { color: var(--ink); cursor: pointer; } .brandlink span { color: var(--muted); font-weight: 400; }
#menubtn { display: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; font-size: 18px; padding: 2px 10px; cursor: pointer; }
/* inicio */
.hero { margin: 8px 0 18px; }
.htitle { font-size: 30px; font-weight: 700; letter-spacing: -.3px; } .htitle span { color: var(--muted); font-weight: 400; }
.hlead { font-size: 16px; line-height: 1.55; max-width: 760px; color: var(--ink); }
a.hcard { color: var(--ink); display: block; transition: transform .12s, box-shadow .12s; }
a.hcard:hover, a.hlink:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.hcard .portrait { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.hstats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.hstats b { color: var(--ink); font-variant-numeric: tabular-nums; }
a.hlink { display: flex; flex-direction: column; gap: 4px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
/* afirmaciones sin columna de estado */
.claim.nostate { grid-template-columns: 130px minmax(0, 1.4fr) minmax(0, 1.3fr); }
/* vídeo minimizado a icono */
.pmini { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 52px; height: 52px; border-radius: 50%;
         border: 0; background: var(--accent); color: #fff; font-size: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
body.pmin #player { display: none; }
body.pmin .pmini { display: block; }
body.pmin #main { margin-right: 24px; }
/* móvil: menú plegable y vídeo fijo abajo */
@media (max-width: 820px) {
  #side { position: sticky; top: 0; z-index: 25; padding: 10px 16px; }
  #menubtn { display: block; }
  #side .runsel, #side #nav, #side .principle { display: none; }
  body.menu-open #side #nav { display: block; margin-top: 8px; max-height: 70vh; overflow-y: auto; }
  body.menu-open #side .principle { display: block; }
  .player { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto !important; width: auto; margin: 0; border-radius: 12px 12px 0 0; z-index: 20; padding: 6px; }
  .player video { max-height: 30vh; }
  #main { padding-bottom: calc(30vh + 60px); }
  body.pmin #main { padding-bottom: 90px; margin-right: 0; }
  .claim.nostate { grid-template-columns: 1fr; }
  .claim { grid-template-columns: 1fr; }
  .htitle { font-size: 24px; }
}
