/* ==========================================================================
   JAYU v19.1.0 · Plantilla editorial de informes (reutilizable)
   Obsidian Universe · editorial, institucional, legible en móvil.
   Prefijo "html body.jr:not(#jr0)" para convivir con las capas Obsidian.
   Nombres de clase sin "card/panel/section/grid/box..." para que la capa
   spatial 18.0.14 no les retire superficie.
   ========================================================================== */
html body.jr:not(#jr0) {
  --r-ink: #eeecf9;
  --r-ink-2: #c9cbe0;
  --r-muted: #9097b2;
  --r-line: rgba(185, 165, 255, .14);
  --r-line-2: rgba(185, 165, 255, .28);
  --r-violet: #8b5cf6;
  --r-lav: #c4b5fd;
  --r-cyan: #5ee6e0;
  --r-gold: #f3c777;
  --r-rose: #ff8fa6;
  --r-up: #3ee0a1;
  --r-down: #ff6f8a;
  --r-glass: linear-gradient(180deg, rgba(24, 20, 48, .62), rgba(9, 10, 22, .58));
  --r-max: 1240px;
  --r-gut: clamp(16px, 4vw, 48px);
  margin: 0;
  color: var(--r-ink);
  font-family: Inter, "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background: transparent;
}
html body.jr:not(#jr0) * { box-sizing: border-box; }
html body.jr:not(#jr0) img { display: block; max-width: 100%; height: auto; }
html body.jr:not(#jr0) a { color: var(--r-cyan); text-underline-offset: .2em; text-decoration-thickness: 1px; }
html body.jr:not(#jr0) a:hover { color: #fff; }
html body.jr:not(#jr0) :focus-visible { outline: 2px solid var(--r-lav); outline-offset: 3px; }
html body.jr:not(#jr0) .jr-wrap { width: min(100%, var(--r-max)); margin-inline: auto; padding-inline: var(--r-gut); }
html body.jr:not(#jr0) .skip-link { position: absolute; left: 12px; top: -60px; z-index: 600; padding: 8px 14px; border-radius: 10px; background: var(--r-cyan); color: #04121a; font-weight: 700; }
html body.jr:not(#jr0) .skip-link:focus { top: 12px; }

/* Barra superior */
html body.jr:not(#jr0) .jr-nav {
  position: sticky; top: 0; z-index: 300;
  background: rgba(6, 6, 15, .78) !important; border-bottom: 1px solid var(--r-line) !important;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
html body.jr:not(#jr0) .jr-nav .jr-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
html body.jr:not(#jr0) .jr-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--r-ink); text-decoration: none; font-weight: 800; letter-spacing: .14em; font-size: 12.5px; }
html body.jr:not(#jr0) .jr-brand i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-style: normal; letter-spacing: 0; background: linear-gradient(135deg, #7c4dff, #a78bfa); color: #fff; font-size: 15px; }
html body.jr:not(#jr0) .jr-nav nav { display: flex; gap: clamp(10px, 2vw, 22px); }
html body.jr:not(#jr0) .jr-nav nav a { color: var(--r-ink-2); text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
html body.jr:not(#jr0) .jr-nav nav a:hover { color: #fff; }
@media (max-width: 560px) { html body.jr:not(#jr0) .jr-brand span { display: none; } }

/* Portada */
html body.jr:not(#jr0) .jr-cover { padding-block: clamp(40px, 7vw, 96px) clamp(28px, 4vw, 48px); }
html body.jr:not(#jr0) .jr-layout > * { min-width: 0; }
html body.jr:not(#jr0) .jr-cover .jr-wrap:first-child { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
html body.jr:not(#jr0) .jr-kicker { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; color: var(--r-lav); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
html body.jr:not(#jr0) .jr-kicker .jr-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--r-line-2); color: var(--r-gold); letter-spacing: .12em; }
html body.jr:not(#jr0) .jr-kicker .jr-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--r-gold); }
html body.jr:not(#jr0) .jr-cover h1 {
  margin: 0 0 20px; font-size: clamp(2.2rem, 4.6vw, 4.1rem); line-height: 1.02; letter-spacing: -.04em; font-weight: 800;
  overflow-wrap: normal; word-break: normal; hyphens: manual; text-wrap: balance; max-width: 20ch;
}
html body.jr:not(#jr0) .jr-cover h1 em { font-style: normal; background: linear-gradient(100deg, #d6ccff, #8b5cf6 55%, #5ee6e0); -webkit-background-clip: text; background-clip: text; color: transparent; }
html body.jr:not(#jr0) .jr-lede { margin: 0 0 26px; max-width: 58ch; color: var(--r-ink-2); font-size: clamp(1.05rem, 1.6vw, 1.22rem); }
html body.jr:not(#jr0) .jr-actions { display: flex; flex-wrap: wrap; gap: 10px; }
html body.jr:not(#jr0) .jr-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 14.5px; text-decoration: none; border: 1px solid var(--r-line-2); color: var(--r-ink); background: rgba(13, 11, 28, .55); }
html body.jr:not(#jr0) .jr-btn.is-primary { background: linear-gradient(135deg, #6d3ff0, #8b5cf6); border-color: transparent; color: #fff; box-shadow: 0 14px 34px -16px rgba(124, 77, 255, .95); }
html body.jr:not(#jr0) .jr-hero-fig { margin: 0; position: relative; }
html body.jr:not(#jr0) .jr-hero-fig a { display: block; border-radius: 18px; overflow: hidden; border: 1px solid var(--r-line-2); box-shadow: 0 40px 90px -40px rgba(124, 77, 255, .6), 0 0 0 1px rgba(255, 255, 255, .03); }
html body.jr:not(#jr0) .jr-hero-fig::before { content: ""; position: absolute; inset: -12% -8%; z-index: -1; background: radial-gradient(closest-side, rgba(139, 92, 246, .3), transparent 70%); filter: blur(10px); }
html body.jr:not(#jr0) .jr-hero-fig figcaption { margin-top: 10px; color: var(--r-muted); font-size: 12.5px; }

/* Indicadores clave */
html body.jr:not(#jr0) .jr-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: clamp(28px, 4vw, 44px); }
html body.jr:not(#jr0) .jr-kpi { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--r-line); background: var(--r-glass); min-width: 0; }
html body.jr:not(#jr0) .jr-kpi small { display: block; color: var(--r-muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
html body.jr:not(#jr0) .jr-kpi b { display: block; margin: 4px 0 2px; font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; }
html body.jr:not(#jr0) .jr-kpi span { display: block; color: var(--r-ink-2); font-size: 12.5px; line-height: 1.4; }
html body.jr:not(#jr0) .jr-kpi.is-up b { color: var(--r-up); }
html body.jr:not(#jr0) .jr-kpi.is-down b { color: var(--r-down); }

/* Disposición: índice lateral + capítulos */
html body.jr:not(#jr0) .jr-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-bottom: 64px; }
html body.jr:not(#jr0) .jr-toc { position: sticky; top: 84px; align-self: start; display: grid; gap: 2px; padding: 14px; border-radius: 16px; border: 1px solid var(--r-line); background: rgba(10, 9, 22, .6); }
html body.jr:not(#jr0) .jr-toc b { margin: 0 0 6px; color: var(--r-muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
html body.jr:not(#jr0) .jr-toc a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; color: var(--r-ink-2); text-decoration: none; font-size: 13.5px; }
html body.jr:not(#jr0) .jr-toc a:hover { background: rgba(139, 92, 246, .14); color: #fff; }
html body.jr:not(#jr0) .jr-toc a i { font-style: normal; width: 18px; text-align: center; color: var(--r-lav); }

/* Capítulo */
html body.jr:not(#jr0) .jr-chap { padding-block: clamp(30px, 4vw, 48px); border-top: 1px solid var(--r-line); scroll-margin-top: 80px; }
html body.jr:not(#jr0) .jr-chap:first-child { border-top: 0; padding-top: 0; }
html body.jr:not(#jr0) .jr-agent { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--r-lav); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
html body.jr:not(#jr0) .jr-agent i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; letter-spacing: 0; border: 1px solid var(--r-line-2); background: rgba(139, 92, 246, .14); color: #fff; font-size: 14px; }
html body.jr:not(#jr0) .jr-agent span { color: var(--r-muted); letter-spacing: .1em; font-weight: 600; }
html body.jr:not(#jr0) .jr-chap h2 { margin: 0 0 16px; font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; max-width: 26ch; text-wrap: balance; }
html body.jr:not(#jr0) .jr-chap h3 { margin: 26px 0 10px; font-size: 1.05rem; letter-spacing: .02em; color: #fff; }
html body.jr:not(#jr0) .jr-chap p { max-width: 70ch; color: var(--r-ink-2); }
html body.jr:not(#jr0) .jr-chap p strong { color: #fff; }

/* Leyenda y etiquetas epistemológicas */
html body.jr:not(#jr0) .jr-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; padding: 0; list-style: none; }
html body.jr:not(#jr0) .jr-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; line-height: 1.6; }
html body.jr:not(#jr0) .jr-tag.t-fact { color: var(--r-cyan); }
html body.jr:not(#jr0) .jr-tag.t-read { color: var(--r-lav); }
html body.jr:not(#jr0) .jr-tag.t-scen { color: var(--r-gold); }
html body.jr:not(#jr0) .jr-tag.t-hyp { color: var(--r-rose); }
html body.jr:not(#jr0) .jr-tag.t-miss { color: var(--r-muted); }

html body.jr:not(#jr0) .jr-facts { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
html body.jr:not(#jr0) .jr-facts li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(185, 165, 255, .08); color: var(--r-ink-2); max-width: none; }
html body.jr:not(#jr0) .jr-facts li:last-child { border-bottom: 0; }
html body.jr:not(#jr0) .jr-facts li > .jr-tag { justify-self: start; }
html body.jr:not(#jr0) .jr-num { font-variant-numeric: tabular-nums; color: #fff; font-weight: 650; white-space: nowrap; }

html body.jr:not(#jr0) .jr-quote { margin: 18px 0; padding: 16px 20px; border-left: 2px solid var(--r-violet); border-radius: 0 14px 14px 0; background: linear-gradient(90deg, rgba(139, 92, 246, .14), transparent); color: var(--r-ink); max-width: 72ch; }
html body.jr:not(#jr0) .jr-quote .jr-tag { margin-bottom: 6px; }
html body.jr:not(#jr0) .jr-quote p { margin: 6px 0 0; color: var(--r-ink); }

/* Escenarios */
html body.jr:not(#jr0) .jr-scen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
html body.jr:not(#jr0) .jr-scen > div { padding: 18px; border-radius: 16px; border: 1px solid var(--r-line); background: var(--r-glass); }
html body.jr:not(#jr0) .jr-scen > div.is-bull { border-top: 2px solid var(--r-up); }
html body.jr:not(#jr0) .jr-scen > div.is-bear { border-top: 2px solid var(--r-down); }
html body.jr:not(#jr0) .jr-scen h4 { margin: 0 0 10px; font-size: .98rem; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html body.jr:not(#jr0) .jr-scen dl { margin: 0; display: grid; gap: 8px; }
html body.jr:not(#jr0) .jr-scen dt { color: var(--r-muted); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
html body.jr:not(#jr0) .jr-scen dd { margin: 0; color: var(--r-ink-2); font-size: 15px; line-height: 1.55; }

/* Tablas de niveles y agenda */
html body.jr:not(#jr0) .jr-table { width: 100%; margin-top: 16px; overflow-x: auto; border-radius: 14px; border: 1px solid var(--r-line); background: rgba(9, 9, 20, .55); }
html body.jr:not(#jr0) .jr-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
html body.jr:not(#jr0) .jr-table th { text-align: left; padding: 10px 14px; color: var(--r-muted) !important; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid var(--r-line) !important; max-width: none; }
html body.jr:not(#jr0) .jr-table td { padding: 10px 14px; border-bottom: 1px solid rgba(185, 165, 255, .07) !important; color: var(--r-ink-2); vertical-align: top; max-width: none; }
html body.jr:not(#jr0) .jr-table tr:last-child td { border-bottom: 0 !important; }
html body.jr:not(#jr0) .jr-table td:first-child { font-variant-numeric: tabular-nums; color: #fff; font-weight: 650; white-space: nowrap; }
html body.jr:not(#jr0) .jr-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--r-line-2); color: var(--r-ink-2); white-space: nowrap; }
html body.jr:not(#jr0) .jr-pill.p-up { color: var(--r-up); border-color: rgba(62, 224, 161, .4); }
html body.jr:not(#jr0) .jr-pill.p-down { color: var(--r-down); border-color: rgba(255, 111, 138, .4); }
html body.jr:not(#jr0) .jr-pill.p-key { color: var(--r-gold); border-color: rgba(243, 199, 119, .45); }

/* Figuras */
html body.jr:not(#jr0) .jr-fig { margin: 18px 0 0; }
html body.jr:not(#jr0) .jr-fig a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--r-line); background: #06070f; }
html body.jr:not(#jr0) .jr-fig img { width: 100%; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
html body.jr:not(#jr0) .jr-fig a:hover img { transform: scale(1.012); }
html body.jr:not(#jr0) .jr-fig figcaption { margin-top: 8px; color: var(--r-muted); font-size: 12.5px; line-height: 1.5; }
html body.jr:not(#jr0) .jr-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html body.jr:not(#jr0) .jr-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 16px; }
html body.jr:not(#jr0) .jr-gallery .jr-fig { margin: 0; }

/* Protocolo */
html body.jr:not(#jr0) .jr-steps { counter-reset: s; margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html body.jr:not(#jr0) .jr-steps li { counter-increment: s; position: relative; padding: 14px 14px 14px 46px; border-radius: 14px; border: 1px solid var(--r-line); background: rgba(10, 9, 22, .55); color: var(--r-ink-2); font-size: 14.5px; line-height: 1.5; max-width: none; }
html body.jr:not(#jr0) .jr-steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 14px; top: 13px; color: var(--r-lav); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Pie */
html body.jr:not(#jr0) .jr-foot { padding-block: 32px 120px; border-top: 1px solid var(--r-line); color: var(--r-muted); font-size: 13.5px; }
html body.jr:not(#jr0) .jr-foot p { max-width: 80ch; }

/* Responsive */
@media (max-width: 1080px) {
  html body.jr:not(#jr0) .jr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  html body.jr:not(#jr0) .jr-cover .jr-wrap:first-child { grid-template-columns: 1fr; }
  html body.jr:not(#jr0) .jr-layout { grid-template-columns: 1fr; }
  html body.jr:not(#jr0) .jr-toc {
    position: sticky; top: 60px; z-index: 50; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--r-gut)); padding: 8px var(--r-gut); border-radius: 0; border-width: 0 0 1px;
    background: rgba(6, 6, 15, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  html body.jr:not(#jr0) .jr-toc::-webkit-scrollbar { display: none; }
  html body.jr:not(#jr0) .jr-toc b { display: none; }
  html body.jr:not(#jr0) .jr-toc a { flex: 0 0 auto; border: 1px solid var(--r-line); border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 13px; }
  html body.jr:not(#jr0) .jr-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html body.jr:not(#jr0) { font-size: 16px; }
  html body.jr:not(#jr0) .jr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body.jr:not(#jr0) .jr-kpi:last-child { grid-column: 1 / -1; }
  html body.jr:not(#jr0) .jr-scen, html body.jr:not(#jr0) .jr-pair { grid-template-columns: 1fr; }
  html body.jr:not(#jr0) .jr-facts li { grid-template-columns: 1fr; gap: 4px; }
  html body.jr:not(#jr0) .jr-table table { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { html body.jr:not(#jr0) .jr-fig img { transition: none; } }
@media print {
  html body.jr:not(#jr0) { color: #111; background: #fff; }
  html body.jr:not(#jr0) .jr-nav, html body.jr:not(#jr0) .jr-toc { display: none; }
  html body.jr:not(#jr0) .jr-layout { grid-template-columns: 1fr; }
}
