/* =========================================================
   Concepto: papel y máquina.
   La oficina es papel claro; donde trabaja el robot hay una consola azul noche.
   El amarillo marcador se usa SOLO para señalar dónde actúa el robot.
   ========================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #141B2D;
  --muted: #596276;
  --rule: #D6DCE4;
  --cobalt: #1F45D8;
  --cobalt-dark: #1736B0;
  --marker: #FFD84A;
  --console: #101C3D;
  --console-2: #182957;
  --console-rule: #2A3B6B;
  --console-text: #DCE3F5;
  --console-muted: #93A1C6;
  --ok: #13804D;
  --fail: #C93636;
  --warn: #A86A12;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--marker); color: var(--ink); }
img, video { max-width: 100%; display: block; }
a { color: var(--cobalt); text-underline-offset: .18em; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.container { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); margin: 0; font-optical-sizing: auto; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); font-weight: 760; line-height: 1.02; letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.55rem); font-weight: 720; line-height: 1.08; letter-spacing: -.025em; }
h3 { font-size: 1.28rem; font-weight: 680; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 54ch; }

/* ---------- cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(243 245 247 / .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.site-header .container { display: flex; align-items: center; gap: 2rem; height: 68px; }
.brand { font-family: var(--display); font-weight: 750; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand small { font-family: var(--body); font-weight: 400; font-size: .9rem; color: var(--muted); letter-spacing: 0; margin-left: .5rem; }
.site-nav { display: flex; align-items: center; gap: 1.8rem; margin-left: auto; font-size: .97rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--cobalt); }
@media (max-width: 760px) { .site-nav a:not(.btn) { display: none; } .brand small { display: none; } }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--body); padding: .95rem 1.35rem; border-radius: 8px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-small { padding: .6rem 1rem; font-size: .93rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-on-console { background: var(--marker); color: var(--console); }
.btn-on-console:hover { background: #ffe57f; color: var(--console); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--cobalt); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

/* ---------- consola (donde trabaja el robot) ---------- */
.console { background: var(--console); color: var(--console-text); border-radius: 14px; }
.console-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--console-rule); font-size: .85rem; color: var(--console-muted); min-width: 0; }
.console-bar .address { font-family: var(--mono); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-badge { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--console-muted); white-space: nowrap; }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--console-rule); }
.live-badge:not(.off) { color: var(--marker); }
.live-badge:not(.off)::before { background: var(--marker); }
@media (prefers-reduced-motion: no-preference) { .live-badge:not(.off)::before { animation: blink 1.1s steps(2, start) infinite; } }
@keyframes blink { to { visibility: hidden; } }

.screen { position: relative; background: #fff; border-radius: 0 0 14px 14px; overflow: hidden; aspect-ratio: 1100 / 700; }
.screen img, .screen video { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.screen.live-screen img { object-fit: contain; background: #fff; }
.skeleton { display: grid; place-items: center; color: var(--console-muted); background: var(--console-2); font-size: .95rem; text-align: center; padding: 1.5rem; }

/* ---------- portada ---------- */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.hero .container { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.hero h1 { max-width: 13ch; }
.hero .lead { margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero figure { margin: 0; min-width: 0; }
.hero figure .console { overflow: hidden; }
.hero figure .screen { aspect-ratio: 1000 / 640; }
.hero figcaption { margin-top: .8rem; font-size: .92rem; color: var(--muted); max-width: 64ch; }
.hero figcaption strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } }

.proof { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface); }
.proof ul { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.proof li { padding: 1.4rem 1.6rem 1.4rem 0; font-size: .98rem; color: var(--muted); }
.proof li + li { padding-left: 1.6rem; border-left: 1px solid var(--rule); }
.proof strong { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin-bottom: .15rem; }
@media (max-width: 760px) { .proof ul { grid-template-columns: 1fr; } .proof li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); } }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { max-width: 62ch; margin-bottom: 2.6rem; }
.section-head p { margin-top: .9rem; color: var(--muted); font-size: 1.08rem; }

/* demos en vivo */
.demo-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3.2rem 2.6rem; }
.demo-item { display: grid; gap: 1rem; align-content: start; }
.demo-item .console { overflow: hidden; display: block; }
.demo-item .screen { border-radius: 0; aspect-ratio: 1000 / 600; }
.demo-item h3 { font-size: 1.45rem; }
.demo-item h3 a { color: inherit; text-decoration: none; }
.demo-item h3 a:hover { color: var(--cobalt); }
.demo-item p { color: var(--muted); max-width: 52ch; }
.demo-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; font-size: .9rem; }
.demo-facts div { display: flex; gap: .35rem; }
.demo-facts dt { color: var(--muted); }
.demo-facts dd { margin: 0; font-weight: 600; }
.demo-item .btn { justify-self: start; margin-top: .2rem; }
@media (max-width: 820px) { .demo-list { grid-template-columns: 1fr; } }

/* bajo demanda: directorio por departamento */
.on-demand { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.directory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6rem 3rem; }
.dept h3 { font-size: 1.1rem; padding-bottom: .7rem; border-bottom: 2px solid var(--ink); margin-bottom: .3rem; }
.dept ul { list-style: none; margin: 0; padding: 0; }
.dept li { border-bottom: 1px solid var(--rule); }
.dept a { display: block; padding: .85rem 0; text-decoration: none; color: var(--ink); }
.dept a strong { display: block; font-weight: 600; }
.dept a span { display: block; font-size: .93rem; color: var(--muted); margin-top: .15rem; }
.dept a:hover strong { color: var(--cobalt); text-decoration: underline; text-underline-offset: .18em; }
.on-demand-cta { margin-top: 2.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
.on-demand-cta p { color: var(--muted); max-width: 52ch; }
@media (max-width: 960px) { .directory { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .directory { grid-template-columns: 1fr; } }

/* método: es una secuencia real, por eso va numerado */
.method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: step; border-top: 2px solid var(--ink); }
.method li { counter-increment: step; padding: 1.4rem 1.6rem 0 0; }
.method li::before { content: counter(step); display: block; font-family: var(--display); font-size: 2.6rem; font-weight: 750; line-height: 1; color: var(--cobalt); margin-bottom: .8rem; }
.method .when { font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.method p { color: var(--muted); font-size: .98rem; margin-top: .5rem; }
@media (max-width: 860px) { .method { grid-template-columns: repeat(2, 1fr); gap: 1rem 0; } }
@media (max-width: 520px) { .method { grid-template-columns: 1fr; } }

/* contacto */
.contact { padding: clamp(2.4rem, 6vw, 4rem); display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: end; }
.contact h2 { color: #fff; max-width: 16ch; }
.contact p { color: var(--console-muted); margin-top: 1rem; max-width: 46ch; }
.contact .email { display: block; font-family: var(--display); font-size: clamp(1.05rem, 1.9vw, 1.35rem); font-weight: 650; color: var(--marker); text-decoration: none; margin-bottom: 1rem; overflow-wrap: anywhere; }
.contact .email:hover { text-decoration: underline; color: var(--marker); }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

.site-footer { padding: 2.4rem 0 3rem; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.6rem; }

/* =========================================================
   Páginas de demo
   ========================================================= */
.demo-page { padding: 2.2rem 0 1rem; }
.back { display: inline-block; font-size: .95rem; margin-bottom: 1.6rem; }
.demo-head { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.demo-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); max-width: 16ch; }
.demo-head .lead { margin-top: 1.1rem; }
.what-you-see { margin: 1.6rem 0 0; padding: 0; list-style: none; display: grid; gap: .55rem; max-width: 56ch; }
.what-you-see li { padding-left: 1.4rem; position: relative; color: var(--ink); }
.what-you-see li::before { content: ""; position: absolute; left: 0; top: .62em; width: .6rem; height: .6rem; background: var(--marker); border: 1.5px solid var(--ink); border-radius: 2px; }
@media (max-width: 900px) { .demo-head { grid-template-columns: 1fr; } }

.controls { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.5rem; display: grid; gap: 1.1rem; }
.controls h2 { font-size: 1.15rem; letter-spacing: -.01em; }
.field-label { display: grid; gap: .45rem; font-size: .93rem; font-weight: 600; color: var(--ink); }
.input, .controls select {
  width: 100%; font: 400 1rem var(--body); color: var(--ink); background: var(--surface);
  border: 1.5px solid #B8C1CE; border-radius: 8px; padding: .8rem .9rem;
}
.input:focus, .controls select:focus { outline: 3px solid rgb(31 69 216 / .3); border-color: var(--cobalt); }
.hint { font-size: .9rem; color: var(--muted); }
.form-error { color: var(--fail); font-weight: 600; font-size: .95rem; }
.examples { font-size: .92rem; color: var(--muted); }
.examples button { margin: 0 .35rem; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid #B8C1CE; border-radius: 8px; overflow: hidden; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .75rem .8rem; text-align: center; font-size: .95rem; font-weight: 500; color: var(--muted); }
.segmented label + label span { border-left: 1.5px solid #B8C1CE; }
.segmented input:checked + span { background: var(--ink); color: #fff; font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: -3px; }

/* zona de trabajo del robot */
.workspace { margin-top: 2.4rem; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.workspace .console-side { padding: 1.3rem; border-right: 1px solid var(--console-rule); display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.workspace .console-main { min-width: 0; display: flex; flex-direction: column; }
.workspace .screen { border-radius: 0 0 14px 0; }
.workspace h2 { font-family: var(--body); font-size: .95rem; font-weight: 600; color: var(--console-text); letter-spacing: 0; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace .console-side { border-right: 0; border-top: 1px solid var(--console-rule); order: 2; }
  .workspace .screen { border-radius: 0; }
}

.progress-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .93rem; }
.progress-list li { display: grid; grid-template-columns: 18px 1fr; gap: .65rem; align-items: start; color: var(--console-muted); line-height: 1.4; }
.progress-list .dot { width: 16px; height: 16px; margin-top: .1rem; border-radius: 50%; border: 2px solid var(--console-rule); display: grid; place-items: center; font-size: .6rem; font-weight: 800; }
.progress-list li.running { color: #fff; }
.progress-list li.running .dot { border-color: var(--marker); background: var(--marker); }
@media (prefers-reduced-motion: no-preference) { .progress-list li.running .dot { animation: pulse-dot 1s ease-in-out infinite; } }
@keyframes pulse-dot { 50% { transform: scale(.7); } }
.progress-list li.done { color: var(--console-text); }
.progress-list li.done .dot { border-color: #4FD08E; background: #4FD08E; color: var(--console); }
.progress-list li.done .dot::after { content: "✓"; }
.progress-list li.failed { color: #FF9C9C; }
.progress-list li.failed .dot { border-color: #FF7A7A; background: #FF7A7A; color: var(--console); }
.progress-list li.failed .dot::after { content: "✕"; }
.progress-list:empty::before { content: "Los pasos aparecerán aquí en cuanto pongas el robot en marcha."; color: var(--console-muted); font-size: .9rem; }

.log { font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: #B9C4E2; background: #0A1330; border-radius: 8px; padding: .8rem; height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log:empty::before { content: "Registro de acciones del robot"; color: #5D6E9B; }
.log .t { color: #5D6E9B; }

.meter { height: 6px; background: var(--console-rule); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--marker); transition: width .3s; }
.counter { font-size: .88rem; color: var(--console-muted); min-height: 1.3em; }

/* auditoría: escritorio + móvil */
.screens { display: grid; grid-template-columns: 1fr 190px; gap: 1rem; padding: 1rem; align-items: start; }
.screens .frame-label { font-size: .82rem; color: var(--console-muted); margin-top: .5rem; }
.shot { aspect-ratio: 1366 / 768; border-radius: 6px; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone .shot { aspect-ratio: 390 / 700; border-radius: 18px; border: 6px solid #0A1330; }
@media (max-width: 640px) { .screens { grid-template-columns: 1fr; } .phone { max-width: 200px; } }

/* resultados */
.results { margin-top: 2rem; display: grid; gap: 1.6rem; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(1.2rem, 3vw, 1.8rem); min-width: 0; }
.panel > h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 1.4rem; border-top: 1px solid var(--rule); }
.kpi { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--rule); }
.kpi strong { display: block; font-family: var(--display); font-size: 2rem; font-weight: 720; line-height: 1.1; letter-spacing: -.02em; }
.kpi span { display: block; font-size: .9rem; color: var(--muted); margin-top: .2rem; }
.kpi small { display: block; color: var(--muted); font-size: .82rem; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-fail { color: var(--fail); }
.bg-ok { background: #E3F4EA; } .bg-warn { background: #FBF0DA; } .bg-fail { background: #FBE6E6; }

.verdict { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 720; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 1.2rem; }

.compare { display: grid; gap: .7rem; max-width: 640px; }
.bar { display: grid; grid-template-columns: 110px 1fr 80px; gap: .8rem; align-items: center; font-size: .92rem; }
.bar .track { height: 12px; background: var(--paper); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ink); border-radius: 3px; }
.bar .fill.human { background: #9AA4B5; }
.bar .fill.robot { background: var(--cobalt); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bars { display: grid; gap: .5rem; }
.bars .bar { grid-template-columns: 70px 1fr 36px; }
.bars .fill { background: var(--cobalt); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

.table-wrap { overflow: auto; max-height: 440px; border: 1px solid var(--rule); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th { position: sticky; top: 0; background: var(--paper); text-align: left; font-weight: 600; padding: .65rem .85rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data-table td { padding: .6rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table a { color: var(--ink); text-decoration: none; }
.data-table a:hover { color: var(--cobalt); text-decoration: underline; }
.data-table img { width: 30px; height: 40px; object-fit: cover; border-radius: 2px; }
.data-table tr.current td { background: #FFF3C2; }
.data-table tr.appear td { animation: appear 1.2s ease-out; }
@keyframes appear { from { background: #FFF1B0; } }
.empty-row td { color: var(--muted); text-align: center; padding: 1.4rem; }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 4px; white-space: nowrap; }
.pill.ok { color: var(--ok); background: #E3F4EA; }
.pill.fail { color: var(--fail); background: #FBE6E6; }
.pill.pending { color: var(--muted); background: var(--paper); }
.stars { color: #B07800; letter-spacing: 1px; white-space: nowrap; }

.tests { list-style: none; margin: 0; padding: 0; display: grid; }
.test { display: grid; grid-template-columns: 170px 1fr; gap: 1.2rem; padding: 1rem 0; border-top: 1px solid var(--rule); align-items: start; }
.test:first-child { border-top: 0; padding-top: 0; }
.test img { width: 100%; border-radius: 6px; border: 1px solid var(--rule); cursor: zoom-in; }
.test h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; letter-spacing: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.test p { font-size: .88rem; color: var(--muted); margin-top: .2rem; }
.test .error { color: var(--fail); font-size: .92rem; margin-top: .45rem; max-width: 70ch; }
@media (max-width: 560px) { .test { grid-template-columns: 1fr; } }

dialog.zoom { border: 0; padding: 0; background: transparent; max-width: min(1100px, 95vw); }
dialog.zoom::backdrop { background: rgb(16 28 61 / .8); }
dialog.zoom img { width: 100%; border-radius: 8px; }

/* informe de auditoría */
.report-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.6rem; align-items: center; }
@media (max-width: 720px) { .report-head { grid-template-columns: 1fr; } }
.ring { --size: 124px; width: var(--size); height: var(--size); position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .value { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 2.3rem; font-weight: 750; letter-spacing: -.03em; }
.ring.small { --size: 62px; }
.ring.small .value { font-size: 1.05rem; }
.report-meta h3 { font-size: 1.3rem; word-break: break-word; }
.report-meta p { color: var(--muted); font-size: .92rem; word-break: break-all; margin-top: .2rem; }
.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cat-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: 1.6rem 0; }
.cat-score { display: grid; justify-items: center; gap: .4rem; padding: .9rem .4rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.cat-score:hover { border-color: var(--ink); }
.cat-score span { font-size: .88rem; color: var(--muted); }
details.cat { border-top: 1px solid var(--rule); }
details.cat:last-of-type { border-bottom: 1px solid var(--rule); }
details.cat summary { list-style: none; cursor: pointer; padding: 1rem 0; display: flex; align-items: center; gap: .8rem; font-family: var(--display); font-weight: 680; font-size: 1.15rem; }
details.cat summary::-webkit-details-marker { display: none; }
details.cat summary::after { content: "+"; margin-left: .4rem; font-family: var(--body); color: var(--muted); font-size: 1.3rem; font-weight: 400; }
details.cat[open] summary::after { content: "−"; }
.score-pill { margin-left: auto; font-family: var(--body); font-size: .85rem; font-weight: 600; padding: .15rem .55rem; border-radius: 4px; }
.checks { list-style: none; margin: 0; padding: 0 0 1rem; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: .7rem; padding: .6rem 0; border-top: 1px dashed var(--rule); font-size: .96rem; }
.checks li small { display: block; color: var(--muted); font-size: .88rem; word-break: break-word; }
.status-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: #fff; margin-top: .2rem; }
.status-icon.ok { background: var(--ok); }
.status-icon.warn { background: var(--warn); }
.status-icon.fail { background: var(--fail); }
.broken-list { padding: 0 0 1rem 1.9rem; font-size: .88rem; display: grid; gap: .2rem; }
.broken-list a { word-break: break-all; }

/* dónde encaja (páginas de demo) */
.fit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 2rem; border-top: 2px solid var(--ink); }
.fit div { padding-top: 1.2rem; }
.fit p { color: var(--muted); font-size: .97rem; margin-top: .5rem; }
@media (max-width: 900px) { .fit { grid-template-columns: repeat(2, 1fr); gap: 1.2rem 2rem; } }
@media (max-width: 520px) { .fit { grid-template-columns: 1fr; } }

/* 404 */
.not-found { padding: 6rem 0; max-width: 40ch; }
.not-found p { color: var(--muted); margin: 1rem 0 2rem; }

/* ---------- impresión / PDF ---------- */
@media print {
  body { background: #fff; }
  .site-header, .controls, .examples, .workspace, .report-actions, .no-print, .site-footer, .back { display: none !important; }
  .panel { border: 0; padding: 0; }
  details.cat > *:not(summary) { display: block !important; }
  details.cat, .checks li { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- versión estática (Cloudflare) vs. con servidor ---- */
[data-only="static"] { display: none !important; }
html[data-mode="static"] [data-only="live"] { display: none !important; }
html[data-mode="static"] [data-only="static"] { display: revert !important; }
html[data-mode="static"] .audit-workspace { grid-template-columns: 1fr; }
html[data-mode="static"] .audit-workspace .log { max-height: 16rem; }
.replay-note { font-size: .86rem; color: var(--muted); margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--rule); }
.screen video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ---- demos que se ejecutan en el navegador del visitante ---- */
.sheet { background: #fff; color: var(--ink); border-radius: 0 0 14px 0; overflow: auto; height: 470px; position: relative; }
.sheet .data-table { font-size: .86rem; }
.sheet .data-table th { background: #EEF1F5; }
.sheet .placeholder { display: grid; place-items: center; height: 100%; padding: 2rem; text-align: center; color: var(--muted); }
.data-table td.changed { background: #FFF6D1; }
.data-table td.bad { color: var(--fail); font-weight: 600; }
.data-table tr.dup td { color: #8A93A6; background: #F6F7F9; }
.data-table tr.dup td .cell-old { display: none; }
.cell-old { display: block; font-size: .76rem; color: var(--muted); text-decoration: line-through; font-weight: 400; }
.pill.warn { color: var(--warn); background: #FBF0DE; }
.sources { display: grid; gap: .45rem; }
.source { display: flex; gap: .65rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-size: .95rem; line-height: 1.35; }
.source:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.source input { accent-color: var(--cobalt); margin: 0; flex: none; }
.drop { position: relative; display: grid; gap: .35rem; justify-items: center; text-align: center; padding: 1.2rem 1rem; border: 2px dashed var(--rule); border-radius: 10px; cursor: pointer; font-size: .93rem; font-weight: 600; }
.drop:hover, .drop.over { border-color: var(--cobalt); background: #EEF2FD; }
.drop:focus-within { outline: 3px solid rgb(31 69 216 / .3); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop small { color: var(--muted); font-weight: 400; font-size: .82rem; }
.sample-link { font-size: .86rem; color: var(--muted); }
.panel h3.sub { font-family: var(--body); font-size: 1.02rem; font-weight: 700; margin: 1.6rem 0 .7rem; letter-spacing: 0; }
.issue-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.issue-list li { padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.issue-list li span { color: var(--muted); }
.verdict.c-warn { color: var(--warn); }
.private-note { display: flex; gap: .5rem; align-items: baseline; font-size: .86rem; color: var(--muted); margin: 0; }
.private-note::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 2px; background: var(--ok); transform: translateY(-.05rem); }
@media (max-width: 900px) { .sheet { height: 380px; border-radius: 0 0 14px 14px; } }
.sheet .data-table td { white-space: nowrap; }
.invoice-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 1.2rem; padding: 1.2rem; min-height: 100%; background: #E9EDF2; }
.invoice-page { background: #fff; box-shadow: 0 1px 3px rgb(20 27 45 / .18); align-self: start; }
.invoice-page canvas { width: 100%; height: auto; display: block; }
.fields { margin: 0; display: grid; gap: .35rem; align-content: start; }
.fields div { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: .45rem .7rem; transition: background .2s; }
.fields dt { font-size: .74rem; color: var(--muted); }
.fields dd { margin: 0; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.fields div.current { background: var(--marker); border-color: #E5BC1F; }
.fields div.found dd { color: var(--ink); }
.fields div.missing dd { color: var(--fail); font-weight: 400; }
@media (max-width: 700px) { .invoice-view { grid-template-columns: 1fr; } .sheet:has(.invoice-view) { height: auto; max-height: 640px; } }
.mail-list { display: grid; border-top: 1px solid var(--rule); }
.mail { border-bottom: 1px solid var(--rule); }
.mail summary { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; padding: .8rem 0; cursor: pointer; list-style: none; }
.mail summary::-webkit-details-marker { display: none; }
.mail summary .who { flex-basis: 100%; color: var(--muted); font-size: .88rem; }
.mail-body { margin: 0 0 .6rem; font-size: .95rem; }
.why { font-size: .86rem; color: var(--muted); margin: 0 0 .7rem; }
.reply { white-space: pre-wrap; font: inherit; font-size: .93rem; background: var(--paper); border-left: 3px solid var(--cobalt); padding: .8rem 1rem; margin: 0 0 1rem; border-radius: 0 6px 6px 0; }
.team-bar { grid-template-columns: 170px 1fr 36px !important; }
.try textarea { width: 100%; min-height: 7rem; resize: vertical; font: inherit; padding: .8rem; border: 1px solid var(--rule); border-radius: 8px; }
.try textarea:focus { outline: 3px solid rgb(31 69 216 / .3); border-color: var(--cobalt); }
.try .examples { margin: .6rem 0 1rem; }
.kpis.small .kpi strong { font-size: 1.25rem; }
.sheet .data-table td.wrap { white-space: normal; min-width: 16rem; }
.topic { display: inline-block; font-size: .76rem; padding: .05rem .4rem; border-radius: 3px; background: var(--paper); color: var(--muted); margin: 0 .15rem .15rem 0; }
.topic.up { background: #E3F4EA; color: var(--ok); }
.topic.down { background: #FBE6E6; color: var(--fail); }
.diverging { display: grid; gap: .35rem; max-width: 720px; }
.dv-head, .dv-row { display: grid; grid-template-columns: 1fr 150px 1fr; gap: .8rem; align-items: center; }
.dv-head { font-size: .8rem; color: var(--muted); }
.dv-head span:first-child { text-align: right; }
.dv-head span:nth-child(2) { text-align: center; }
.dv-name { text-align: center; font-size: .92rem; font-weight: 600; }
.dv-neg, .dv-pos { display: flex; align-items: center; gap: .45rem; height: 14px; }
.dv-neg { justify-content: flex-end; }
.dv-neg i, .dv-pos i { display: block; height: 12px; border-radius: 2px; min-width: 0; }
.dv-neg i { background: var(--fail); }
.dv-pos i { background: var(--ok); }
.dv-neg b, .dv-pos b { font-size: .85rem; font-variant-numeric: tabular-nums; }
.segmented.tone { margin-bottom: .8rem; max-width: 22rem; }
.wa-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.wa { border: 1px solid var(--rule); border-radius: 10px; padding: 1rem; display: grid; gap: .6rem; align-content: start; background: var(--surface); }
.wa.mine { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
.wa header { display: grid; gap: .1rem; }
.wa header span { font-size: .86rem; color: var(--muted); }
.bubble { margin: 0; background: #E7F6E9; border-radius: 10px 10px 10px 2px; padding: .7rem .8rem; font-size: .92rem; white-space: pre-wrap; }
.wa .btn { justify-self: start; }
.data-table tr.mine td { font-weight: 600; }
.controls textarea.input { min-height: 6.5rem; resize: vertical; font: inherit; line-height: 1.45; }
.vars { font-size: .82rem; color: var(--muted); }
.vars code { font-family: var(--mono); font-size: .8rem; background: var(--paper); padding: 0 .25rem; border-radius: 3px; }
.chart { width: 100%; height: auto; display: block; margin: .4rem 0 .6rem; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .b-cur { fill: #1F45D8; }
.chart .b-prev { fill: #9AA4B5; }
.chart .hit { fill: transparent; }
.chart .day:hover .hit { fill: rgb(31 69 216 / .06); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .85rem; color: var(--muted); margin: 0; }
.legend.small { font-size: .8rem; margin-top: .6rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.sw-cur { background: #1F45D8; } .sw-prev { background: #9AA4B5; }
.table-view summary { cursor: pointer; font-size: .86rem; color: var(--cobalt); margin-bottom: .6rem; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 1rem 2.5rem; }
.report-cols section:first-child { grid-row: span 2; }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .8rem; }
.report-head h2 { margin: 0; }
@media (max-width: 1100px) { .report-cols { grid-template-columns: 1fr; } .report-cols section:first-child { grid-row: auto; } }
.rank { display: grid; gap: .45rem; }
.rank-row { display: grid; grid-template-columns: 7.5rem minmax(80px, 1fr) 5.5rem 4rem 2.8rem; gap: .5rem; align-items: center; font-size: .86rem; font-variant-numeric: tabular-nums; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { position: relative; height: 14px; }
.rank-track i { position: absolute; left: 0; border-radius: 0 3px 3px 0; }
.rank-prev { top: 0; height: 14px; background: #D5DAE3; }
.rank-cur { top: 3px; height: 8px; background: #1F45D8; }
.rank-val { text-align: right; }
.rank-ch { text-align: right; font-size: .8rem; }
.rank-ch.up, .delta.up { color: var(--ok); } .rank-ch.down, .delta.down { color: var(--fail); }
.rank-share { text-align: right; color: var(--muted); font-size: .8rem; }
.kpi .delta { font-size: .8rem; margin-top: .15rem; }
.auto-text { border-left: 3px solid var(--cobalt); padding-left: 1rem; max-width: 70ch; }
.auto-text p { margin: 0 0 .4rem; }
@media (max-width: 560px) { .rank-row { grid-template-columns: 6rem 1fr 4.6rem 3.6rem; } .rank-share { display: none; } }
@media print {
  body > header, body > footer, .site-header, .site-footer, nav, .back, .demo-head, .controls, .workspace, .demo-page > .section, .no-print, .table-view, .private-note, .form-error { display: none !important; }
  #summary .report-cols section { break-inside: avoid; }
  .chart { break-inside: avoid; }
  #summary { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .chart .b-cur, .rank-cur, .sw-cur { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rank-prev, .chart .b-prev, .sw-prev { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.legend.small .sw-prev { background: #D5DAE3; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 2.6rem; border-top: 1px solid var(--rule); }
.tool-list li { border-bottom: 1px solid var(--rule); }
.tool-list a { display: grid; gap: .3rem; padding: 1.3rem 0 1.4rem; color: inherit; text-decoration: none; height: 100%; }
.tool-list strong { font-size: 1.2rem; line-height: 1.25; }
.tool-list a:hover strong, .tool-list a:focus-visible strong { color: var(--cobalt); text-decoration: underline; text-underline-offset: .2em; }
.tool-dept { font-size: .82rem; color: var(--muted); }
.tool-summary { color: var(--muted); max-width: 52ch; }
.tool-input { font-size: .88rem; color: var(--cobalt); font-weight: 600; margin-top: .2rem; }
@media (max-width: 820px) { .tool-list { grid-template-columns: 1fr; } }
