/* Luppo — sistema visual. Guía en docs/diseno.md.
   Oscuro por defecto ("obsidiana"); el claro queda como opción. La única audacia es el lente (gradiente cromático):
   marca y sello de IA. El resto es tinta sobre papel, o luz sobre obsidiana. */

:root {
  --papel: #f2f4f8;
  --hoja: #ffffff;
  --hueco: #e8ecf3;
  --hueco-2: #dde3ed;
  --tinta: #141b2d;
  --tinta-2: #4a5573;
  --tinta-3: #5f6985;
  --linea: #dce1ea;
  --linea-fuerte: #c4cbd9;
  --cobalto: #2447d6;
  --cobalto-suave: #e6ebff;
  --coral: #e5484d;
  --coral-suave: #fde8e8;
  --gris-matiz: #8a93a8;
  --ambar: #b8690c;
  --ambar-suave: #fbeedc;
  --verde: #1f8a5b;
  --verde-suave: #e2f3ea;
  --lente: linear-gradient(135deg, #18c3e8 0%, #6c5ce7 55%, #ff7a59 100%);
  --lente-conico: conic-gradient(from 200deg, #18c3e8, #6c5ce7, #ff7a59, #ffb021, #18c3e8);
  --sombra-flotante: 0 12px 32px rgba(20, 27, 45, .16), 0 2px 6px rgba(20, 27, 45, .08);
  --primario: var(--tinta); --primario-hover: color-mix(in srgb, var(--tinta) 86%, var(--cobalto)); --primario-texto: var(--papel); --primario-halo: none;
  --brillo: none;
  /* competidores en el mapa del Entorno (paleta categórica validada; los avatares conservan sus tonos) */
  --actor-1: #2a78d6; --actor-2: #eb6834; --actor-3: #1baf7a; --actor-4: #eda100; --actor-5: #e87ba4; --actor-6: #008300; --actor-7: #4a3aa7; --actor-8: #e34948;
  --r-caja: 14px;
  --r-control: 8px;
  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ancho: 1120px;
  --coral-texto: #b9323a; --verde-texto: #17714a; --ambar-texto: #955208;
  --plat-ig: #b03d8f; --plat-ig-suave: #fbe9f4; --plat-fb: #1b62c9; --plat-fb-suave: #e6efff;
  --seg-texto: #fff; --con-seg: #d63a3f;
  --t-12: .75rem; --t-13: .8125rem; --t-14: .875rem; --t-16: 1rem; --t-18: 1.125rem; --t-22: 1.375rem; --t-28: 1.75rem; --t-36: 2.25rem; --t-44: 2.75rem; --medida: 68ch;
  --barra-sup: 0px;
  --lateral: 236px;
  /* semántica de postura (datos) */
  --pro: var(--cobalto);
  --mid: var(--gris-matiz);
  --con: var(--coral);
  --na: #cfd5e1;
  --bar: var(--cobalto);
  --bar-suave: #6f86e2;
  --accent: var(--cobalto);
  --accent-soft: var(--cobalto-suave);
  --ok: var(--verde); --ok-soft: var(--verde-suave);
  --err: var(--coral); --err-soft: var(--coral-suave);
  --warn: var(--ambar); --warn-soft: var(--ambar-suave);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --papel: #07080d; --hoja: #0e1018; --hueco: #161923; --hueco-2: #1e2230;
  --tinta: #eceef5; --tinta-2: #a6abbe; --tinta-3: #7d8397; --linea: #1d2130; --linea-fuerte: #2c3144;
  --cobalto: #97a6ff; --cobalto-suave: #1a1d3a; --coral: #ff7f7f; --coral-suave: #2d1519; --gris-matiz: #858b9e;
  --ambar: #f4b54f; --ambar-suave: #2b2011; --verde: #5fd09a; --verde-suave: #0f2a1f; --na: #2a2f40; --bar-suave: #6d7fd9;
  --coral-texto: var(--coral); --verde-texto: var(--verde); --ambar-texto: var(--ambar); --plat-ig: #f39ad2; --plat-ig-suave: var(--hueco); --plat-fb: #8fb4ff; --plat-fb-suave: var(--hueco); --seg-texto: #07080d; --con-seg: var(--coral);
  --sombra-flotante: 0 16px 40px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);
  --primario: #6353f2; --primario-hover: #7163ff; --primario-texto: #fff; --primario-halo: 0 8px 24px -8px rgba(99, 83, 242, .7);
  --brillo: inset 0 1px 0 rgba(255, 255, 255, .04);
  --actor-1: #3987e5; --actor-2: #d95926; --actor-3: #199e70; --actor-4: #c98500; --actor-5: #d55181; --actor-6: #2e9e2e; --actor-7: #9085e9; --actor-8: #e66767;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--papel); color: var(--tinta);
  font: 400 16px/1.5 var(--sans); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalto); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--sans); line-height: 1.12; margin: 0 0 .5rem; letter-spacing: -.02em; font-weight: 800; text-wrap: balance; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
b, strong { font-weight: 700; }
ul, ol { margin: 0 0 .75rem; padding-left: 1.2rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--hueco); padding: .08rem .35rem; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--cobalto); outline-offset: 2px; border-radius: 4px; }
::selection { background: #6c5ce7; color: #fff; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--tinta); color: var(--papel); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.ic { width: 20px; height: 20px; flex: none; }
.sprite { display: none !important; }

/* rótulos y metadatos: en frase, nunca mayúsculas */
.eyebrow { display: block; font-size: .82rem; font-weight: 600; color: var(--tinta-3); letter-spacing: 0; text-transform: none; margin: 0 0 .3rem; }
h2 .eyebrow, h1 .eyebrow { margin-bottom: .25rem; }
.mono { font-family: var(--mono); font-size: .92em; }
.help { font-size: .86rem; color: var(--tinta-3); margin: 0; }
.help.mono, .mono.help, .ref { font-family: var(--sans); font-size: .82rem; color: var(--tinta-3); }
.inline { display: inline; }
.pre-wrap { white-space: pre-wrap; }
.subcap, .axisnote, .bnote { font-size: .82rem; color: var(--tinta-3); margin: .35rem 0 0; }

/* ---------- estructura: barra lateral + contenido ---------- */
body.con-nav { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); grid-template-rows: minmax(100vh, auto); }
body.con-nav > .lateral { grid-column: 1; grid-row: 1; }
body.con-nav > .wrap { grid-column: 2; grid-row: 1; }
.wrap { width: 100%; max-width: calc(var(--ancho) + 64px); margin: 0 auto; padding: 28px 32px 96px; }
body.sin-nav .wrap { max-width: none; padding: 0; }

.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem;
  padding: 20px 14px 16px; background: var(--hoja); border-right: 1px solid var(--linea);
}
.marca { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--tinta); font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; padding: 4px 8px; }
.lente { position: relative; display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--lente-conico); flex: none; }
.lente::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--hoja); }
.lente::before { content: ""; position: absolute; left: 7px; top: 6px; width: 6px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .85); z-index: 1; transform: rotate(-30deg); }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; text-decoration: none;
  color: var(--tinta-2); font-weight: 600; font-size: .95rem; transition: background .12s, color .12s;
}
.menu a:hover { background: var(--hueco); color: var(--tinta); }
.menu a.activo { background: var(--tinta); color: var(--papel); }
.menu a .ic { color: currentColor; opacity: .85; }
.lateral__pie { margin-top: auto; display: grid; gap: .6rem; border-top: 1px solid var(--linea); padding-top: .9rem; }
.yo { display: grid; grid-template-columns: 36px 1fr; column-gap: .6rem; align-items: center; text-decoration: none; color: var(--tinta); padding: 4px 6px; border-radius: 10px; }
.yo:hover { background: var(--hueco); }
.yo .avatar { width: 36px; height: 36px; font-size: .8rem; grid-row: 1 / span 2; }
.yo__nombre { font-weight: 700; font-size: .92rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yo__sub { font-size: .78rem; color: var(--tinta-3); }
.lateral__acciones { display: flex; gap: .4rem; padding: 0 2px; }
.lateral__acciones form { display: contents; }
.btn--icono { padding: 0; width: 38px; min-height: 38px; justify-content: center; border-color: transparent; background: transparent; color: var(--tinta-2); }
.btn--icono:hover { background: var(--hueco); color: var(--tinta); }
.btn--icono .ic { width: 19px; height: 19px; }
.solo-oscuro { display: none; }
:root[data-theme="dark"] .solo-oscuro { display: block; }
:root[data-theme="dark"] .solo-claro { display: none; }

@media (max-width: 959px) {
  body.con-nav { display: block; }
  .wrap { padding: 20px 16px 96px; }
  .lateral { position: sticky; height: auto; flex-direction: row; align-items: center; gap: .5rem; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--linea); z-index: 30; }
  .marca { font-size: 1.15rem; }
  .menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--hoja); border-top: 1px solid var(--linea); }
  .menu a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .68rem; font-weight: 600; border-radius: 8px; text-align: center; }
  .menu a .ic { width: 22px; height: 22px; }
  .menu a.activo { background: transparent; color: var(--tinta); }
  .menu a.activo .ic { color: var(--cobalto); opacity: 1; }
  .menu a[data-clave="usuarios"] { display: none; } /* seis ítems caben; Usuarios queda enlazado desde Ajustes y Mi cuenta */
  .lateral__pie { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
  .yo { grid-template-columns: 34px; padding: 2px; }
  .yo .avatar { width: 34px; height: 34px; }
  .yo__nombre, .yo__sub { display: none; }
}

/* ---------- cabecera de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1.4rem; }
.page-head h1 { margin: 0; }
.page-head .help { margin-top: .25rem; }
.page-head > .acciones, .page-head > .btn { margin-left: auto; }

/* ---------- cajas ---------- */
.card { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; }
.card h2 { margin-top: 1.4rem; font-size: 1.12rem; }
.card > p.mono { font-family: var(--sans); font-size: .95rem; color: var(--tinta-2); }
.card > h2:first-child, .card > .form > h2:first-child, .card h2:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 > .field, .grid2 > label { align-self: start; }
.callout { background: var(--hueco); border-left: 3px solid var(--tinta-3); padding: .75rem 1rem; border-radius: 0 var(--r-control) var(--r-control) 0; margin: 1rem 0; }
.callout--warn { border-color: var(--ambar); background: var(--ambar-suave); }
.callout--error { border-color: var(--coral); background: var(--coral-suave); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.flash { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: var(--r-control); margin: 0 0 1.2rem; border: 1px solid var(--linea); background: var(--hoja); font-weight: 500; }
.flash--ok { border-color: color-mix(in srgb, var(--verde) 40%, transparent); background: var(--verde-suave); color: var(--verde); }
.flash--error { border-color: color-mix(in srgb, var(--coral) 40%, transparent); background: var(--coral-suave); color: var(--coral); }
.flash--aviso { border-color: color-mix(in srgb, var(--ambar) 40%, transparent); background: var(--ambar-suave); color: var(--ambar); }
.empty { text-align: center; color: var(--tinta-2); padding: 2.4rem 1rem; border: 1px dashed var(--linea-fuerte); border-radius: var(--r-caja); background: color-mix(in srgb, var(--hoja) 60%, transparent); margin-bottom: 1.1rem; }
.empty .lente { width: 44px; height: 44px; margin-bottom: .8rem; opacity: .9; }
.empty .lente::after { inset: 6px; background: var(--papel); }
.empty .lente::before { left: 12px; top: 10px; width: 10px; height: 6px; }
.empty p { max-width: 42ch; margin: 0 auto .9rem; }

/* ---------- formularios ---------- */
.form { display: grid; gap: .9rem; max-width: 600px; }
.form.card { max-width: 720px; }
.field { display: grid; gap: .3rem; }
.field > span { font-size: .86rem; font-weight: 600; color: var(--tinta-2); }
.input, .select, .textarea {
  font: inherit; font-size: 16px; color: var(--tinta); background: var(--hoja); border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-control); padding: .6rem .75rem; width: 100%; transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 6.5rem; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cobalto); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalto) 22%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--tinta-3); }
.field-error { color: var(--coral); background: var(--coral-suave); padding: .55rem .8rem; border-radius: var(--r-control); margin: 0; font-size: .92rem; }
.field--check { display: flex; gap: .6rem; align-items: flex-start; }
.field--check input { margin-top: .3rem; accent-color: var(--cobalto); }
.field--check > span { font-weight: 500; color: var(--tinta); }
.opciones summary { cursor: pointer; color: var(--cobalto); font-weight: 600; }
.opciones[open] summary { margin-bottom: .75rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2;
  padding: .55rem 1rem; min-height: 40px; border-radius: var(--r-control); border: 1px solid var(--linea-fuerte); background: var(--hoja); color: var(--tinta);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--hueco); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primario); border-color: var(--primario); color: var(--primario-texto); box-shadow: var(--primario-halo); }
.btn--primary:hover { background: var(--primario-hover); border-color: var(--primario-hover); }
.btn--danger { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 50%, transparent); }
.btn--danger:hover { background: var(--coral-suave); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--tinta-2); }
.btn--ghost:hover { background: var(--hueco); color: var(--tinta); }
.btn--sm { padding: .3rem .7rem; min-height: 32px; font-size: .85rem; }
.btn .ic { width: 18px; height: 18px; }

/* ---------- chips, badges ---------- */
.chip { display: inline-block; font-size: .74rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: var(--hueco); color: var(--tinta-2); white-space: nowrap; vertical-align: middle; text-decoration: none; }
a.chip:hover { background: var(--hueco-2); }
.chip--A, .chip--F { background: var(--cobalto-suave); color: var(--cobalto); }
.chip--R, .chip--D { background: var(--coral-suave); color: var(--coral); }
.chip--M { background: var(--hueco-2); color: var(--tinta-2); }
.chip--host1 { background: var(--ambar-suave); color: var(--ambar); }
.chip--host2 { background: var(--coral-suave); color: var(--coral); }
.chip--plat-ig { color: #b03d8f; background: #fbe9f4; }
.chip--plat-fb { color: #1b62c9; background: #e6efff; }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .18rem .6rem .18rem .5rem; border-radius: 999px; background: var(--hueco); color: var(--tinta-2); white-space: nowrap; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tinta-3); flex: none; }
.badge--lista::before, .badge--listo::before { background: var(--verde); }
.badge--lista, .badge--listo { background: var(--verde-suave); color: var(--verde); }
.badge--error { background: var(--coral-suave); color: var(--coral); }
.badge--error::before { background: var(--coral); }
.badge--en_cola::before, .badge--pendiente::before { background: var(--gris-matiz); }
.badge--extrayendo, .badge--clasificando, .badge--analizando, .badge--corriendo { background: var(--cobalto-suave); color: var(--cobalto); }
.badge--extrayendo::before, .badge--clasificando::before, .badge--analizando::before, .badge--corriendo::before { background: var(--cobalto); animation: pulso 1.4s ease-in-out infinite; }
.badge--pausado { background: var(--ambar-suave); color: var(--ambar); }
.badge--pausado::before { background: var(--ambar); }
@keyframes pulso { 50% { opacity: .25; transform: scale(.7); } }
.tag { display: inline-block; background: var(--hoja); border: 1px solid var(--linea); border-radius: 999px; padding: .25rem .7rem; font-size: .86rem; text-decoration: none; color: var(--tinta); }
a.tag:hover { border-color: var(--linea-fuerte); background: var(--hueco); }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.confiab { font-size: .76rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; }
.confiab--alta { background: var(--verde-suave); color: var(--verde); }
.confiab--media { background: var(--ambar-suave); color: var(--ambar); }
.confiab--baja { background: var(--coral-suave); color: var(--coral); }
.secreto { user-select: all; background: var(--ambar-suave); color: var(--ambar); padding: .15rem .45rem; border-radius: 4px; font-weight: 700; }

/* sello de IA: el lente */
.ai-note { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--tinta-2); margin: .1rem 0 .9rem; padding: .3rem .7rem .3rem .4rem; border-radius: 999px; background: var(--hoja); border: 1px solid var(--linea); }
.ai-note .lente { width: 18px; height: 18px; }
.ai-note .lente::after { inset: 3px; }
.ai-note .lente::before { left: 5px; top: 4px; width: 4px; height: 3px; }
.ai-note b { font-weight: 700; color: var(--tinta); }

/* ---------- tablas ---------- */
.tblwrap { overflow-x: auto; background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); margin-bottom: 1.1rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tbl th { font-size: .8rem; font-weight: 600; color: var(--tinta-3); background: var(--hoja); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--hueco) 55%, transparent); }
.tbl td.mono, .tbl th.mono { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.tbl--comentarios .texto { white-space: pre-wrap; font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.tbl--comentarios .chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.tbl--comentarios .why { font-size: .84rem; color: var(--tinta-2); margin-top: .35rem; }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1rem 0; font-size: .9rem; color: var(--tinta-2); }
.tip { position: fixed; z-index: 50; max-width: 300px; background: var(--tinta); color: var(--papel); font-size: .8rem; line-height: 1.4; padding: .4rem .6rem; border-radius: 6px; pointer-events: none; box-shadow: var(--sombra-flotante); }
@media (max-width: 640px) {
  .tblwrap { background: transparent; border: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl tr { display: block; border: 1px solid var(--linea); border-radius: 12px; margin-bottom: .6rem; padding: .5rem .3rem; background: var(--hoja); }
  .tbl td { display: block; border: 0; padding: .3rem .8rem; }
  .tbl td[data-th]::before { content: attr(data-th); display: block; color: var(--tinta-3); font-size: .72rem; font-weight: 600; }
  .tbl tbody tr:hover td { background: transparent; }
}

/* ---------- actores ---------- */
.avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95rem; flex: none; letter-spacing: 0; }
.avatar--1, .swatch--1 span { background: #4b5b8e; } .avatar--2, .swatch--2 span { background: #8a6a36; }
.avatar--3, .swatch--3 span { background: #3f7a68; } .avatar--4, .swatch--4 span { background: #7d4d70; }
.avatar--5, .swatch--5 span { background: #37698f; } .avatar--6, .swatch--6 span { background: #9a5a3c; }
.avatar--7, .swatch--7 span { background: #5d6470; } .avatar--8, .swatch--8 span { background: #4b7d38; }
.avatar--u { background: var(--lente); }
.actor-card__head, .actor-head { display: flex; gap: .85rem; align-items: center; }
.actor-card { display: flex; flex-direction: column; gap: .5rem; transition: border-color .12s; }
.actor-card:hover { border-color: var(--linea-fuerte); }
.actor-card h2 { margin: 0; font-size: 1.12rem; }
.actor-card h2 a { text-decoration: none; color: var(--tinta); }
.actor-card h2 a:hover { text-decoration: underline; }
.actor-card__cuentas { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.actor-card .mono.help { margin-top: auto; }
.swatches { display: flex; gap: .45rem; flex-wrap: wrap; padding-top: .2rem; }
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch input:checked + span { border-color: var(--tinta); box-shadow: 0 0 0 2px var(--hoja); }
.swatch input:focus-visible + span { outline: 2px solid var(--cobalto); outline-offset: 2px; }

/* ---------- publicaciones ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .8rem .9rem; }
.filters .select, .filters .input { width: auto; min-width: 150px; flex: 1; padding: .5rem .65rem; font-size: .95rem; }
.post-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin: 0 0 .25rem; }
.post-head h1 { font-size: 1.4rem; margin: 0; }
.post-head h1 a { color: inherit; text-decoration: none; }
.post-head h1 a:hover { text-decoration: underline; }
.post-head .help { margin-top: .3rem; max-width: 70ch; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--linea); margin: .6rem 0 1.4rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--tinta-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; margin-bottom: -1px; }
.tabs a:hover { color: var(--tinta); }
.tabs a[aria-current="page"] { color: var(--tinta); border-bottom-color: var(--tinta); }
.steps { display: flex; gap: .3rem; list-style: none; padding: 0; margin: .6rem 0; flex-wrap: wrap; font-size: .84rem; }
.steps li { padding: .22rem .7rem; border-radius: 999px; background: var(--hueco); color: var(--tinta-3); font-weight: 600; }
.steps li.done { background: var(--verde-suave); color: var(--verde); }
.steps li.now { background: var(--tinta); color: var(--papel); }
.job .badge { margin-bottom: .2rem; }
.track { height: 8px; background: var(--hueco-2); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--bar); border-radius: 999px; transition: width .5s ease; }
.job > .hbar { display: block; margin: .6rem 0; }
.url-check { list-style: none; padding: 0; margin: .25rem 0 .5rem; font-size: .9rem; }
.url-check li { padding: .2rem 0; }
.en-curso { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.en-curso li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem .8rem; background: var(--hoja); border: 1px solid var(--linea); border-radius: 10px; }
.en-curso li a { font-weight: 600; }
.run p { margin: .25rem 0; }
.run .badge { margin-right: .4rem; }
.pre { white-space: pre-wrap; font-family: var(--mono); font-size: .8rem; background: var(--hueco); padding: .6rem .75rem; border-radius: var(--r-control); }
.post-card { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 0; transition: border-color .12s; }
.post-card:hover { border-color: var(--linea-fuerte); }
.post-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.post-card h3 a { color: var(--tinta); text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card .eyebrow { margin-bottom: .2rem; }
.cifras { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: .6rem; margin: 0; padding-top: .6rem; border-top: 1px solid var(--linea); }
.cifras div { display: grid; gap: .05rem; }
.cifras dt { font-size: .74rem; color: var(--tinta-3); font-weight: 600; }
.cifras dd { margin: 0; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pos { color: var(--cobalto); } .neg { color: var(--coral); }

/* ---------- evidencia (citas) ---------- */
.ev { list-style: none; padding: 0; margin: 0; }
.ev li { padding: .7rem 0; border-bottom: 1px solid var(--linea); }
.ev li:last-child { border-bottom: 0; }
.ev .ref { display: block; margin-bottom: .15rem; }
.ev q { quotes: "“" "”"; display: block; margin: .1rem 0; font-family: var(--serif); font-size: 1.03rem; line-height: 1.55; color: var(--tinta); }
.ev .why { display: block; font-size: .85rem; color: var(--tinta-2); margin-top: .2rem; }
.ev b { display: block; margin: .1rem 0 .15rem; }
.ev ul.ev { margin: .5rem 0 0 .5rem; padding-left: .8rem; border-left: 2px solid var(--linea); }
.ev ul.ev li { padding: .4rem 0; border: 0; }
.ev ul.ev q { font-size: .96rem; }

/* ---------- gráficos (primitivas CSS, sin librerías) ---------- */
figure { margin: 1.4rem 0; padding: 0; min-width: 0; }
figcaption { font-weight: 700; margin: 0 0 .6rem; letter-spacing: -.01em; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.stack { display: flex; gap: 2px; width: 100%; border-radius: 8px; overflow: hidden; background: transparent; }
.seg { display: flex; align-items: center; justify-content: center; min-width: 3px; font-size: .8rem; font-weight: 700; color: #fff; transition: width .3s; border-radius: 3px; font-variant-numeric: tabular-nums; }
.seg span { padding: 0 .3rem; white-space: nowrap; }
.s-pro { background: var(--pro); } .s-mid { background: var(--mid); } .s-con { background: var(--con); } .s-na { background: var(--na); color: var(--tinta-2); }
.stackrow { display: grid; grid-template-columns: 150px 1fr; gap: .7rem; align-items: center; margin: .4rem 0; }
.rowlab { font-size: .86rem; color: var(--tinta-2); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--tinta-2); margin: .6rem 0 0; }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.hbars { display: grid; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(130px, 34%) 1fr auto; gap: .7rem; align-items: center; font-size: .88rem; }
.hbar .barlab { color: var(--tinta-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .barlab .chip { margin-left: .2rem; }
.hbar .track { position: relative; height: 10px; background: var(--hueco-2); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--bar-suave); border-radius: 999px; }
.hbar.hi .fill { background: linear-gradient(90deg, var(--cobalto), color-mix(in srgb, var(--cobalto) 70%, #18c3e8)); }
.hbar.hi .barlab { color: var(--tinta); font-weight: 600; }
.hbar.warn .fill { background: var(--ambar); } .hbar.con .fill { background: var(--coral); }
.hbar .val { font-size: .8rem; color: var(--tinta-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ambar); }
.tl { display: flex; gap: .5rem; align-items: flex-end; height: 190px; padding: .5rem 0 0; overflow-x: auto; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; min-width: 46px; height: 100%; }
.col .cb { width: 72%; background: linear-gradient(180deg, color-mix(in srgb, var(--cobalto) 80%, #18c3e8), var(--cobalto)); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.col.dim .cb { background: var(--bar-suave); }
.col .cn { font-size: .78rem; font-weight: 700; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.col .cd { font-size: .72rem; color: var(--tinta-3); white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: .7rem; }
.tile { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: .9rem 1rem .85rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tile .k { font-size: .78rem; font-weight: 600; color: var(--tinta-3); letter-spacing: 0; text-transform: none; }
.tile .tile-v { font-size: 2.15rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile.pos .tile-v { color: var(--cobalto); } .tile.neg .tile-v { color: var(--coral); } .tile.warn .tile-v { color: var(--ambar); }
.tile .d { font-size: .8rem; color: var(--tinta-2); line-height: 1.35; }
.dbars { display: grid; gap: .5rem; }
.dbar { display: grid; grid-template-columns: minmax(130px, 36%) 1fr auto; gap: .7rem; align-items: center; font-size: .86rem; }
.dbar .barlab { color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbar .track { position: relative; height: 12px; background: var(--hueco-2); border-radius: 999px; overflow: visible; }
.dbar .centro { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--linea-fuerte); }
.dbar .fill { position: absolute; top: 0; height: 100%; }
.dbar .fill.pro { left: 50%; background: var(--pro); border-radius: 0 999px 999px 0; }
.dbar .fill.con { right: 50%; background: var(--con); border-radius: 999px 0 0 999px; }
.dbar .val { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.blockgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.block { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.1rem; min-width: 0; }
.block h3 { margin-top: 0; }
.block ul:not(.ev) { padding-left: 1.1rem; }
.block ul:not(.ev) li { margin: .3rem 0; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.finding { display: grid; grid-template-columns: 12px 1fr; gap: .7rem; align-items: start; font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; max-width: 72ch; }
.finding .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cobalto); margin-top: .5rem; }
.finding .dot.warnDot { background: var(--ambar); } .finding .dot.midDot { background: var(--gris-matiz); }
.finding b { font-family: var(--sans); font-weight: 700; }
.interes { display: grid; gap: .8rem; }
.interes > article { position: relative; background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.2rem 1rem 1.35rem; overflow: hidden; }
.interes > article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lente); }
.interes h3 { margin: .1rem 0 .35rem; font-size: 1.12rem; }
.interes .eyebrow { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.interes .prioridad-alta { color: var(--coral); font-weight: 700; } .interes .prioridad-media { color: var(--ambar); font-weight: 700; } .interes .prioridad-baja { color: var(--tinta-3); font-weight: 700; }
.interes > article > p { max-width: 72ch; }
.interes .ev { margin-top: .4rem; }
.ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem 1.2rem; margin: 1rem 0 0; font-size: .88rem; }
.ficha dt { font-size: .76rem; font-weight: 600; color: var(--tinta-3); letter-spacing: 0; text-transform: none; }
.ficha dd { margin: 0; font-weight: 600; }
.masthead { padding: .6rem 0 1.2rem; border-bottom: 1px solid var(--linea); margin-bottom: 1rem; }
.masthead .eyebrow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.masthead h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -.035em; max-width: 24ch; margin: .4rem 0 .6rem; line-height: 1.05; }
.lede { font-family: var(--serif); font-size: 1.2rem; line-height: 1.55; color: var(--tinta-2); max-width: 64ch; margin-bottom: .6rem; }
.toc { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem 0 .75rem; }
@media (max-width: 640px) { .toc { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; } }
.toc::-webkit-scrollbar { display: none; }
.toc a { white-space: nowrap; font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--linea); background: var(--hoja); text-decoration: none; color: var(--tinta-2); scroll-snap-align: start; }
.toc a:hover { color: var(--tinta); border-color: var(--linea-fuerte); }
.report h2 { font-size: 1.55rem; margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid var(--linea); scroll-margin-top: 1rem; }
.report h2:first-of-type { border-top: 0; padding-top: 0; }
.report .prose { font-family: var(--serif); font-size: 1.05rem; line-height: 1.62; max-width: 70ch; }
.report details > summary { cursor: pointer; font-weight: 600; color: var(--tinta-2); padding: .4rem 0; }
.report details[open] > summary { margin-bottom: .6rem; }
.sr-toggle { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 500; color: var(--tinta-2); cursor: pointer; user-select: none; }
.switch::before { content: ""; width: 30px; height: 18px; border-radius: 999px; background: var(--hueco-2); border: 1px solid var(--linea-fuerte); display: inline-block; position: relative; transition: background .15s; }
#pond:checked ~ .report-body .switch::before { background: var(--cobalto); border-color: var(--cobalto); }
#pond:checked ~ .report-body .v-raw { display: none; }
#pond:not(:checked) ~ .report-body .v-pond { display: none; }
.gasto { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.4rem; align-items: center; background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.2rem; margin-bottom: 1.1rem; }
.gasto__cifra { font-size: 1.8rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.gasto__cifra small { font-size: .9rem; font-weight: 600; color: var(--tinta-3); letter-spacing: 0; }
.gasto .track { height: 10px; }
.gasto.warn .fill { background: var(--ambar); } .gasto.con .fill { background: var(--coral); }
.gasto .help { grid-column: 1 / -1; }

/* ---------- inicio ---------- */
.inicio-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 1.4rem 2rem; align-items: start; margin-bottom: 1rem; }
.inicio-grid--una { grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr); }
.inicio-grid--una .semana .help { max-width: 46ch; }
.inicio-grid > section > h2:first-child { margin-top: 0; }
.semana { margin: 0; }
.semana .hbars { gap: .7rem; }
.semana .hbar { grid-template-columns: minmax(150px, 38%) 1fr auto; font-size: .95rem; }
.semana .hbar .barlab { white-space: normal; line-height: 1.3; }
.semana .en-curso { margin-top: .4rem; }
.semana .hbar .track { height: 14px; }
.senalado { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.senalado li { background: var(--hoja); border: 1px solid var(--linea); border-radius: 12px; padding: .7rem .9rem; display: grid; gap: .15rem; }
.senalado li a { font-weight: 700; color: var(--tinta); text-decoration: none; }
.senalado li a:hover { text-decoration: underline; }
.senalado .ref { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.informes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .inicio-grid { grid-template-columns: 1fr; } }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.entrada__panel { position: relative; overflow: hidden; background: #07080d; color: #e8ebf4; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.entrada__panel .marca { color: #fff; padding: 0; }
.entrada__panel .lente::after { background: #07080d; }
.entrada__texto { max-width: 26ch; position: relative; z-index: 1; }
.entrada__texto h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 1rem; color: #fff; }
.entrada__texto p { color: #aeb6cc; font-size: 1.05rem; max-width: 40ch; }
.entrada__pie { color: #7f889f; font-size: .82rem; position: relative; z-index: 1; margin: 0; }
.anillos { position: absolute; right: -140px; bottom: -160px; width: 560px; height: 560px; pointer-events: none; }
.anillos i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(143, 164, 255, .28); animation: respirar 6s ease-in-out infinite; }
.anillos i:nth-child(2) { inset: 70px; animation-delay: .4s; border-color: rgba(24, 195, 232, .28); }
.anillos i:nth-child(3) { inset: 140px; animation-delay: .8s; border-color: rgba(255, 122, 89, .3); }
.anillos i:nth-child(4) { inset: 210px; background: var(--lente-conico); border: 0; opacity: .9; animation: none; }
.anillos i:nth-child(4)::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: #07080d; }
@keyframes respirar { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.04); opacity: .45; } }
.entrada__form { display: grid; place-items: center; padding: 48px 24px; }
.entrada__form .card { width: min(100%, 400px); margin: 0; padding: 1.8rem 1.8rem 1.6rem; }
.entrada__form .marca { display: none; margin-bottom: 1rem; padding: 0; }
.entrada__form h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.entrada__form .form { max-width: none; margin-top: 1rem; }
.entrada__form .btn { width: 100%; min-height: 44px; }
@media (max-width: 860px) {
  .entrada { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .entrada__panel { padding: 28px 20px 36px; min-height: 0; }
  .entrada__texto h2 { font-size: 1.5rem; max-width: 18ch; margin: 0; }
  .entrada__texto p, .entrada__pie { display: none; }
  .anillos { width: 280px; height: 280px; right: -120px; bottom: -130px; }
  .anillos i:nth-child(2) { inset: 35px; } .anillos i:nth-child(3) { inset: 70px; }
  .anillos i:nth-child(4) { inset: 105px; } .anillos i:nth-child(4)::after { inset: 12px; }
  .entrada__form { min-height: 0; padding: 20px 16px 40px; align-content: start; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.55rem; }
  .stackrow { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile .tile-v { font-size: 1.8rem; }
  .card { padding: 1rem 1rem; }
  .gasto { grid-template-columns: 1fr; }
  .masthead h1 { font-size: 1.8rem; }
  .lede { font-size: 1.08rem; }
  .filters .select, .filters .input { min-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ============================================================
   Revisión visual r4: contraste, escala tipográfica, gráficos, móvil.
   Va después de las reglas base para ganar en la cascada.
   ============================================================ */
/* escala tipográfica (9 tamaños) y medida de prosa */
h1 { font-size: var(--t-28); }
h2, .report h2 { font-size: var(--t-22); }
h3, .card h2, .actor-card h2, .interes h3, .post-card h3, figcaption, .block h3, .card h3 { font-size: var(--t-18); }
.masthead h1 { font-size: clamp(var(--t-28), 3.6vw, var(--t-44)); }
.tile .tile-v { font-size: var(--t-36); } .gasto__cifra { font-size: var(--t-28); } .lede { font-size: var(--t-18); }
.eyebrow, .ref, .help, .subcap, .axisnote, .bnote, .tbl th, .tile .k, .ficha dt, .cifras dt, .legend, .hbar .val, .dbar .val, .toc a, .switch, .ai-note, .steps, .yo__sub, .col .cn, .help.mono, .mono.help, .meta { font-size: var(--t-13); }
.chip, .confiab, .col .cd, .tbl td[data-th]::before { font-size: var(--t-12); }
.hbar, .dbar, .rowlab, .tag, .btn, .tbl, .field > span, .tbl--comentarios .why, .ev .why, .tile .d, .menu a, .pager, .en-curso__progreso { font-size: var(--t-14); }
.btn--sm { font-size: var(--t-13); }
.chip { padding: .14rem .55rem; }
.ev q, .ev .why, .finding, .interes > article > p, .report .prose, .lede, .post-head .help { max-width: var(--medida); }

/* contraste de textos de estado */
.field-error, .flash--error, .badge--error, .chip--R, .chip--D, .chip--host2, .confiab--baja, .btn--danger, .neg, .prioridad-alta { color: var(--coral-texto); }
.flash--ok, .badge--lista, .badge--listo, .confiab--alta { color: var(--verde-texto); }
.flash--aviso, .chip--host1, .badge--pausado, .confiab--media, .secreto, .prioridad-media { color: var(--ambar-texto); }
.prioridad-alta, .prioridad-media, .prioridad-baja { font-weight: 700; } .prioridad-baja { color: var(--tinta-3); }
.chip--plat-ig { color: var(--plat-ig); background: var(--plat-ig-suave); }
.chip--plat-fb { color: var(--plat-fb); background: var(--plat-fb-suave); }
.steps li { color: var(--tinta-2); }
.steps li.done::before { content: "✓ "; }

/* botones de icono y avatar sin gradiente */
.btn.btn--icono { padding: 0; width: 38px; min-height: 38px; justify-content: center; border-color: transparent; background: transparent; color: var(--tinta-2); }
.btn.btn--icono:hover { background: var(--hueco); color: var(--tinta); }
.avatar--u { background: var(--tinta); color: var(--papel); }

/* cabecera del informe: una sola */
.post-head--compacta .avatar { width: 36px; height: 36px; font-size: .8rem; }
.post-head--compacta .post-head__titulo { font-size: var(--t-18); font-weight: 700; letter-spacing: -.01em; margin: 0; }
.post-head--compacta .post-head__titulo a { color: inherit; text-decoration: none; }
.post-head--compacta .post-head__titulo a:hover { text-decoration: underline; }
.post-head--compacta .post-head__titulo time { margin-left: .4rem; font-weight: 500; color: var(--tinta-2); }
.ficha { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.toc a { padding: .28rem .6rem; font-size: var(--t-12); }

/* secciones: eyebrow fuera del h2, un solo tamaño de h2 */
.report h2 { margin-top: 0; padding-top: 0; border-top: 0; scroll-margin-top: calc(var(--barra-sup) + 1rem); }
.eyebrow--seccion { margin: 2.8rem 0 .25rem; padding-top: 1.4rem; border-top: 1px solid var(--linea); }
.eyebrow--primera { border-top: 0; padding-top: 0; margin-top: 0; }
.card > h3:first-child, .card > .form > h3:first-of-type, .card > .form > h2:first-of-type { margin-top: 0; }
.card h3 { margin-top: 1.4rem; }
figcaption h3 { margin: 0; }
.form > .btn { justify-self: start; }

/* metadatos como lista con espacio */
.meta { display: flex; flex-wrap: wrap; gap: .15rem .8rem; color: var(--tinta-3); margin: 0; }
.meta > * { white-space: nowrap; }
.ev .meta { margin-bottom: .15rem; }

/* tablero: cifras a la misma altura */
.tile { display: grid; grid-template-rows: minmax(2.4em, auto) auto 1fr; gap: .2rem; }
.tile .k { align-self: end; line-height: 1.2; }
.tile .d { max-width: 24ch; }

/* barras apiladas legibles */
.seg { color: var(--seg-texto); min-width: 6px; }
.s-mid { background: var(--mid); color: #141b2d; }
.s-con { background: var(--con-seg); }
.s-na { background: var(--na); color: var(--tinta-2); box-shadow: inset 0 0 0 1px var(--linea-fuerte); }
.stackrow { align-items: start; }
.stack-nums { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: var(--t-13); color: var(--tinta-2); margin: .3rem 0 0; }
.stack-nums i { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }

/* barras horizontales: sin degradados, secundarias visibles, valor con jerarquía */
.hbar.hi .fill { background: var(--cobalto); }
.col .cb { background: var(--cobalto); }
.col.dim .cb { background: var(--bar-suave); }
.job > .hbar { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; margin: .6rem 0; }
.job > .hbar .fill { background: var(--cobalto); }
.job > .hbar .track { height: 10px; }
.hbar .val b { display: inline-block; min-width: 3ch; text-align: right; font-weight: 700; color: var(--tinta); margin-right: .45rem; }
.hbar .val small { font-size: var(--t-13); color: var(--tinta-3); margin-left: .1rem; }
.semana .hbar { grid-template-columns: minmax(200px, 44%) 1fr auto; }
.semana .hbar .barlab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--tinta); }

/* gráficos del actor */
.tl--aviso .col .cb { background: var(--ambar); }
.tl--aviso { justify-content: flex-start; gap: 1rem; border-bottom: 1px solid var(--linea); }
.tl--aviso .col { flex: 0 1 72px; }
.dbar .centro { width: 2px; background: var(--tinta-3); }
.dbar .fill { min-width: 4px; border-radius: 2px; }
.dbar.na .track { opacity: .4; }
.dbar.na .val { color: var(--tinta-3); font-weight: 500; }
.dbar .barlab { white-space: normal; line-height: 1.25; font-size: var(--t-13); }
.dbar--eje .eje { display: flex; justify-content: space-between; font-size: var(--t-12); color: var(--tinta-3); }

/* interruptor con perilla y foco */
.switch::before { background: radial-gradient(circle at 9px 50%, var(--hoja) 5.5px, transparent 6.5px), var(--hueco-2); }
#pond:checked ~ .report-body .switch::before { background: radial-gradient(circle at 21px 50%, #fff 5.5px, transparent 6.5px), var(--cobalto); border-color: var(--cobalto); }
#pond:focus-visible ~ .report-body .switch::before { outline: 2px solid var(--cobalto); outline-offset: 2px; }
#pond:checked ~ .report-body .switch::after { content: "ponderado"; font-weight: 600; color: var(--cobalto); }

/* superficies: la caja solo para lo que se opera */
.filters.card { background: transparent; border: 0; border-radius: 0; padding: .4rem 0 .8rem; border-bottom: 1px solid var(--linea); margin-bottom: 1.1rem; }
.filters .select:has(option:checked:not([value=""])) { border-color: var(--cobalto); color: var(--cobalto); font-weight: 600; }
.en-curso { gap: 0; background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); overflow: hidden; }
.en-curso li { border: 0; border-radius: 0; border-top: 1px solid var(--linea); }
.en-curso li:first-child { border-top: 0; }
.en-curso li a { font-weight: 600; text-decoration: none; }
.en-curso li a:hover { text-decoration: underline; }
.en-curso li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem; align-items: baseline; }
.en-curso li > .badge { grid-row: 1; }
.en-curso li > a { grid-row: 1; justify-self: start; }
.en-curso li > .help { grid-column: 2; }
.en-curso .en-curso__progreso { color: var(--tinta-2); }
.senalado { gap: 0; }
.senalado li { background: transparent; border: 0; border-radius: 0; padding: .6rem 0; border-bottom: 1px solid var(--linea); display: block; }
.senalado li a { display: block; margin-top: .1rem; }
.senalado__actor { font-weight: 600; font-size: var(--t-13); color: var(--tinta-3); padding: .9rem 0 .2rem; border: 0; }
.taxonomia { display: grid; grid-template-columns: 200px 1fr; gap: .7rem 1rem; align-items: start; margin: 0; }
.taxonomia dt { font-weight: 600; } .taxonomia dd { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.card > p.mono:not(.help) { font-family: var(--sans); font-size: .95rem; color: var(--tinta-2); }

/* tarjetas de informe y medidor de gasto */
.post-card .cifras { margin-top: auto; }
.post-card .actor-card__head { align-items: flex-start; }
.post-card h3 { text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cifras dd.na { color: var(--tinta-3); font-weight: 500; }
.cifras dd.warn { color: var(--ambar-texto); }
.gasto .track { position: relative; overflow: visible; }
.gasto .fill { min-width: 6px; border-radius: 999px 3px 3px 999px; }
.gasto .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ambar); }
.gasto .meta { grid-column: 1 / -1; }

/* tablas */
.tbl td.mono, .tbl td[data-th="Fecha"] { white-space: nowrap; }
.tbl td[data-th="Publicación"] { min-width: 22ch; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .pos { color: var(--cobalto); } .tbl .neg { color: var(--coral-texto); } .tbl .warn { color: var(--ambar-texto); } .tbl .na { color: var(--tinta-3); }

/* comentarios: menos sopa de chips */
.tbl--comentarios .chips { gap: .15rem .8rem; }
.tbl--comentarios .chips .chip:not([class*="chip--"]) { background: none; padding: 0; font-weight: 500; color: var(--tinta-3); }
.chip .ic { width: 12px; height: 12px; vertical-align: -2px; margin-right: .15rem; }

/* accesibilidad */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.finding .tono { font-family: var(--sans); font-size: var(--t-13); font-weight: 600; color: var(--tinta-2); margin-left: .35rem; }
fieldset.field { border: 0; padding: 0; margin: 0; } fieldset.field legend { font-size: var(--t-14); font-weight: 600; color: var(--tinta-2); padding: 0; margin-bottom: .3rem; }
.swatch input:checked + span::after { content: "✓"; color: #fff; font-weight: 800; display: grid; place-items: center; height: 100%; }
.legend .sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.solo-movil { display: none; }

/* móvil */
@media (max-width: 959px) {
  :root { --barra-sup: 60px; }
  html { scroll-padding-top: calc(var(--barra-sup) + 12px); }
  .btn.btn--icono { width: 44px; min-height: 44px; }
  .yo { grid-template-columns: 40px; } .yo .avatar { width: 40px; height: 40px; }
  .btn--sm { min-height: 40px; padding: .45rem .9rem; font-size: var(--t-14); }
  .tabs a { padding: .7rem .9rem; }
  a.chip { padding: .38rem .7rem; font-size: var(--t-13); }
  .switch { min-height: 44px; }
  .filters .select, .filters .input, .btn { min-height: 44px; }
  .menu a { font-size: var(--t-12); letter-spacing: 0; }
  .menu a.activo { font-weight: 700; }
  .menu a.activo::after { content: ""; display: block; width: 18px; height: 3px; border-radius: 2px; background: var(--cobalto); margin: 2px auto 0; }
}
@media (max-width: 640px) {
  .solo-movil { display: inline-flex; }
  .pubs { display: flex; flex-direction: column; }
  .pubs > #nueva { order: 9; margin-top: 1.5rem; }
  #nueva .textarea { min-height: 4.5rem; }
  .filters { gap: .5rem; }
  .filters .select, .filters .input { flex: 1 1 100%; min-width: 0; min-height: 44px; }
  .filters .btn { min-height: 44px; flex: 1 1 100%; }
  .filters--carril { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 1rem; border-radius: 0; padding: .6rem 16px; }
  .filters--carril .select, .filters--carril .input { flex: none; width: auto; min-width: 0; }
  .filters--carril .input { width: 160px; }
  .filters--carril .btn { display: none; }
  .hbars { gap: .5rem; }
  .hbar, .dbar, .semana .hbar { grid-template-columns: 1fr auto; grid-template-areas: "lab val" "track track"; gap: .15rem .7rem; }
  .hbar .barlab, .dbar .barlab, .semana .hbar .barlab { grid-area: lab; white-space: normal; line-height: 1.25; }
  .hbar .val, .dbar .val { grid-area: val; align-self: end; }
  .hbar .track, .dbar .track { grid-area: track; }
  .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ficha { grid-template-columns: 1fr 1fr; gap: .55rem .9rem; }
  .ficha > div:first-child { grid-column: 1 / -1; }
  .ficha dd { overflow-wrap: anywhere; }
  .toc { scroll-snap-type: x proximity; padding-right: 32px; mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .taxonomia { grid-template-columns: 1fr; } .taxonomia dd { margin-bottom: .6rem; }
  .tbl td.num { text-align: left; }
  .tbl--pubs tr { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; padding: .85rem 1rem; }
  .tbl--pubs td { display: block; padding: 0; }
  .tbl--pubs td[data-th]::before { display: none; }
  .tbl--pubs td[data-th="Publicación"] { flex: 1 1 100%; order: -2; font-weight: 600; font-size: 1rem; line-height: 1.35; min-width: 0; }
  .tbl--pubs td[data-th="Publicación"] a { color: var(--tinta); text-decoration: none; }
  .tbl--pubs td[data-th="Estado"] { flex: 1 1 100%; order: -1; }
  .tbl--pubs td[data-th="Actor"], .tbl--pubs td[data-th="Fecha"], .tbl--pubs td[data-th="Comentarios"] { font-size: var(--t-13); color: var(--tinta-2); }
  .tbl--pubs td[data-th="Comentarios"]::after { content: " comentarios"; }
  .tbl--pubs td[data-th="Acciones"] { display: none; }
  .tbl--comentarios tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .6rem; padding: .8rem 1rem; }
  .tbl--comentarios td { display: block; padding: 0; }
  .tbl--comentarios td[data-th]::before { display: none; }
  .tbl--comentarios td[data-th="#"], .tbl--comentarios td[data-th="Fecha"], .tbl--comentarios td[data-th="Likes"] { font-size: var(--t-13); color: var(--tinta-3); }
  .tbl--comentarios td[data-th="Likes"]::after { content: " likes"; }
  .tbl--comentarios td[data-th="Comentario"] { flex: 1 1 100%; margin-top: .3rem; }
  .tbl--comentarios .chip { font-size: var(--t-13); padding: .22rem .6rem; }
  .tbl--comentarios .chips { gap: .35rem; margin-top: .55rem; }
}

/* ---------- impresión ---------- */
/* ---------- entorno: el mapa del territorio ---------- */
.entorno__filtros { align-items: center; }
.segmentado { display: inline-flex; border: 1px solid var(--linea-fuerte); border-radius: var(--r-control); overflow: hidden; padding: 0; margin: 0; }
.segmentado label { position: relative; display: flex; }
.segmentado input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmentado span { padding: .5rem .8rem; font-size: .9rem; color: var(--tinta-2); }
.segmentado input:checked + span { background: var(--tinta); color: var(--papel); font-weight: 600; }
.segmentado input:focus-visible + span { outline: 2px solid var(--cobalto); outline-offset: -2px; }
.casilla { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--tinta-2); }
.entorno__datos { margin: .2rem 0 .6rem; }
.entorno__frase { font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; max-width: 70ch; margin: 0 0 1.2rem; }
.entorno__frase .libre { color: var(--verde-texto); }
.entorno__frase .blando { color: var(--ambar-texto); }
.entorno { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .entorno { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.entorno__mapa { position: relative; margin: 0 auto; width: 100%; max-width: 720px; aspect-ratio: 800 / 720; }
.entorno__svg, .entorno__pubs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.entorno__pubs { pointer-events: none; }
.entorno__pubs a { pointer-events: auto; }
.etq { position: absolute; font-size: 13px; line-height: 1.15; max-width: 8.5em; color: var(--tinta-2); text-decoration: none; transition: opacity .16s; }
.etq[data-anclaje="start"] { transform: translate(0, -50%); }
.etq[data-anclaje="end"] { transform: translate(-100%, -50%); text-align: right; }
.etq[data-anclaje="middle"] { transform: translate(-50%, -50%); text-align: center; }
a.etq:hover { color: var(--tinta); text-decoration: underline; }
.etq--fam { font-size: 11px; font-weight: 600; color: var(--tinta-3); pointer-events: none; white-space: nowrap; max-width: none; }
.etq.perfil { color: var(--cobalto); font-weight: 600; }
.arco-a { cursor: pointer; }
.arco { fill: none; }
.arco--seg { stroke: var(--hueco-2); stroke-width: 16; }
.arco--libre { stroke: var(--linea-fuerte); stroke-width: 2; stroke-dasharray: 4 5; }
.arco--sin { stroke: var(--linea-fuerte); stroke-width: 16; opacity: .5; }
.arco-seg { fill: none; stroke-width: 16; }
.arco-blando { fill: none; stroke: var(--ambar); stroke-width: 3; stroke-linecap: round; }
.arco-hit { fill: none; stroke: transparent; stroke-width: 22; }
.nodo-tema circle { fill: var(--hoja); stroke-width: 2; transition: opacity .16s; }
.nodo-tema.enfocado circle { stroke-width: 3.5; }
.actor-g { cursor: pointer; }
.actor-hit { fill: transparent; }
.actor-disco { stroke: var(--hoja); stroke-width: 3; }
.actor-g.enfocado .actor-disco { stroke: var(--tinta); }
.actor-g:focus-visible .actor-disco { stroke: var(--cobalto); stroke-width: 4; }
.ini { font-size: 13px; font-weight: 800; fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.nombre { font-size: 12px; font-weight: 600; fill: var(--tinta); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--papel); stroke-width: 3px; stroke-linejoin: round; }
.hilo { fill: none; color: var(--c-actor); stroke: currentColor; stroke-linecap: round; opacity: .55; transition: opacity .16s; }
.capa-resultado .hilo, .capa-resultado .cuerda { color: var(--c-res); }
.capa-resultado .hilo[data-solidez="sin_base"], .capa-resultado .cuerda[data-solidez="sin_base"] { opacity: .3; }
.con-perfil [data-perfil="0"], .con-perfil .etq--tema:not(.perfil) { opacity: .25; }
.hilo-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.hilo-g.apagado .hilo { opacity: .12; }
.entorno.con-foco .hilo-g:not(.apagado) .hilo { opacity: .95; }
.entorno .semi { opacity: .3; }
@media (hover: hover) { .hilo-g:not(.apagado):hover .hilo { opacity: .95; filter: drop-shadow(0 0 5px currentColor); } }
@media (prefers-reduced-motion: reduce) { .hilo, .etq, .nodo-tema circle { transition: none; } }
.entorno__panel { background: var(--hueco); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.05rem; font-size: .9rem; }
@media (min-width: 960px) { .entorno__panel { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; } }
.entorno__panel h3 { font-size: 1rem; margin: 0 0 .4rem; }
.entorno__panel .quitar { float: right; margin: -.2rem -.3rem .3rem .5rem; }
.terreno, .compartidos { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .35rem; }
.terreno a, .compartidos a { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; align-items: baseline; padding: .45rem .6rem; border-radius: 8px; background: var(--hoja); border: 1px solid var(--linea); color: inherit; text-decoration: none; }
.terreno a:hover, .compartidos a:hover { border-color: var(--cobalto); }
.terreno .por { grid-column: 1 / -1; font-size: .8rem; color: var(--tinta-3); }
.perfil-rombo { color: var(--cobalto); }
.blando-marca { color: var(--ambar-texto); }
.chip--libre { background: var(--verde-suave); color: var(--verde-texto); }
.chip--disputa { background: var(--coral-suave); color: var(--coral-texto); }
.chip--tomado { background: var(--hueco-2); color: var(--tinta); }
.chip--blando { background: var(--ambar-suave); color: var(--ambar-texto); }
.compartidos .quienes { font-size: .8rem; color: var(--tinta-2); display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.mini { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: .62rem; font-weight: 800; }
.terreno__mas summary { cursor: pointer; font-size: .85rem; color: var(--tinta-2); margin-bottom: .3rem; }
.aviso-foco { color: var(--ambar-texto); }
.volver-mapa { display: none; font-size: .85rem; margin-bottom: .5rem; }
@media (max-width: 959px) { .volver-mapa { display: inline-block; } }
.terreno li { display: grid; gap: .2rem; }
.ver-op { font-size: .78rem; justify-self: end; margin-right: .3rem; }
.entorno__leyenda { margin-top: 1rem; }
.leyenda { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; font-size: .8rem; color: var(--tinta-3); margin: 0 0 .4rem; }
.leyenda .muestra { display: inline-flex; align-items: center; gap: .35rem; }
.leyenda .muestra line { stroke: var(--tinta-2); stroke-linecap: round; }
.solo-resultado { display: none; }
.entorno.capa-resultado ~ .entorno__leyenda .solo-resultado { display: inline; }
.pub { cursor: pointer; }
.pub .relleno { fill: var(--plat-fb); }
.pub--ig .relleno { fill: var(--plat-ig); }
.pub .mitad-ig { fill: var(--plat-ig); }
.pub .mitad-fb { fill: var(--plat-fb); }
.pub .borde { fill: none; stroke: var(--hoja); stroke-width: 1.5; }
.pub:hover .borde, .pub:focus-visible .borde { stroke: var(--tinta); }
.panel-titulo { display: flex; align-items: center; gap: .5rem; }
.mini--grande { width: 26px; height: 26px; font-size: .72rem; }
.entorno__panel h4 { font-size: .85rem; margin: 1rem 0 .35rem; color: var(--tinta-2); }
.panel-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin: .7rem 0; }
.panel-tiles div { background: var(--hoja); border: 1px solid var(--linea); border-radius: 10px; padding: .45rem .55rem; min-width: 0; }
.panel-tiles b { display: block; font-size: 1.05rem; letter-spacing: -.02em; overflow-wrap: normal; hyphens: manual; }
.panel-tiles .panel-sol { font-size: .82rem; font-weight: 700; letter-spacing: 0; }
.panel-tiles span { font-size: .72rem; color: var(--tinta-3); }
.tono-pos { color: var(--cobalto); }
.tono-neg { color: var(--coral); }
.panel-barras { display: grid; gap: .3rem; }
.panel-barras a { display: grid; grid-template-columns: 7.5em 1fr auto; gap: .5rem; align-items: center; font-size: .82rem; color: inherit; text-decoration: none; padding: .15rem .2rem; border-radius: 6px; }
.panel-barras a:hover { background: var(--hoja); }
.panel-barras i { display: block; height: 8px; border-radius: 4px; background: var(--hueco-2); overflow: hidden; }
.panel-barras i b { display: block; height: 100%; border-radius: 4px; }
.panel-barras .num { color: var(--tinta-2); font-size: .78rem; white-space: nowrap; }
.panel-contenidos, .panel-citas { list-style: none; margin: .3rem 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.panel-contenidos li { display: grid; gap: .1rem; padding: .45rem .55rem; background: var(--hoja); border: 1px solid var(--linea); border-radius: 8px; font-size: .82rem; }
.panel-contenidos .cap { font-weight: 600; }
.panel-citas q { font-family: var(--serif); font-size: .95rem; }
.entorno__escalera { display: none; }
@media (max-width: 719px) {
  .entorno__mapa { display: none; }
  .entorno__escalera { display: block; }
}
@media (max-width: 959px) { .entorno__panel { scroll-margin-top: calc(var(--barra-sup) + 12px); } }
.bip { position: relative; display: grid; grid-template-columns: 96px minmax(56px, 1fr) 142px; gap: 0 6px; }
.bip__col { position: relative; height: 100%; }
.bip__centro svg { display: block; width: 100%; }
.fila { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: .45rem; padding: 0 .35rem; border-radius: 10px; text-decoration: none; color: inherit; transition: opacity .16s; }
.fila:hover { background: var(--hueco); }
.fila--actor { height: 56px; }
.fila--actor .txt { display: grid; line-height: 1.15; min-width: 0; }
.fila--actor .txt b { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila--actor .txt span { font-size: .72rem; color: var(--tinta-3); }
.fila--actor.enfocado { background: var(--hueco); box-shadow: inset 0 0 0 1px var(--linea-fuerte); }
.fila--tema { height: 36px; flex-direction: column; align-items: flex-start; justify-content: center; gap: .18rem; }
.fila--tema.libre { border: 1px dashed var(--linea-fuerte); }
.fila--tema.enfocado { background: var(--hueco); }
.fila--tema .nom { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fila--tema .est { font-size: .68rem; color: var(--tinta-3); margin-left: .15rem; }
.fila--tema .med { width: 100%; height: 4px; border-radius: 2px; background: var(--hueco-2); display: flex; overflow: hidden; }
.fila--tema .med b { display: block; height: 100%; }
.cabecera-fam { position: absolute; left: 0; right: 0; height: 24px; padding: .35rem .35rem 0; font-size: .72rem; font-weight: 600; color: var(--tinta-3); }
.cuerda { fill: none; color: var(--c-actor); stroke: currentColor; opacity: .6; transition: opacity .16s; }
.cuerda-hit { fill: none; stroke: transparent; stroke-width: 14; }
.cuerda-g.apagado .cuerda { opacity: .12; }
.entorno.con-foco .cuerda-g:not(.apagado) .cuerda { opacity: .95; }
.puntos-capa { position: absolute; inset: 0; pointer-events: none; }
.puntos { position: absolute; left: calc(100% + 2px); display: flex; gap: 3px; align-items: center; transform: translateY(-50%); pointer-events: auto; z-index: 2; }
.punto { display: block; border-radius: 50%; background: var(--plat-fb); box-shadow: 0 0 0 1.5px var(--papel); }
.punto--ig { background: var(--plat-ig); }
.punto--par { background: linear-gradient(90deg, var(--plat-ig) 50%, var(--plat-fb) 50%); }
.puntos .mas { font-size: .7rem; color: var(--tinta-3); margin-left: 2px; }
@media (prefers-reduced-motion: reduce) { .fila, .cuerda { transition: none; } }
.entorno__tabla { margin-top: 1.4rem; }
.entorno__tabla summary { cursor: pointer; font-weight: 600; color: var(--tinta-2); margin-bottom: .6rem; }
.tbl--entorno th, .tbl--entorno td { font-size: .78rem; white-space: nowrap; }
@media print {
  .entorno__escalera, .entorno__filtros, .entorno__panel .quitar { display: none !important; }
  .entorno__mapa { display: block !important; max-width: 640px; }
  .entorno { display: block; }
  .entorno__panel { position: static; margin-top: 1rem; max-height: none; overflow: visible; }
  .entorno__tabla > summary { display: none; }
  :root, :root[data-theme="dark"] { --actor-1: #2a78d6; --actor-2: #eb6834; --actor-3: #1baf7a; --actor-4: #eda100; --actor-5: #e87ba4; --actor-6: #008300; --actor-7: #4a3aa7; --actor-8: #e34948; }
  .entorno__svg, .entorno__pubs { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ---------- obsidiana: lo que el oscuro hace distinto ---------- */
/* Luz ambiente: tres halos del lente, muy tenues y fijos, detrás de todo. */
:root[data-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 42% -18%, rgba(108, 92, 231, .2), transparent 62%),
    radial-gradient(760px 440px at 102% 4%, rgba(24, 195, 232, .09), transparent 60%),
    radial-gradient(900px 600px at 72% 115%, rgba(255, 122, 89, .06), transparent 60%);
}
/* Vidrio: la barra lateral deja pasar la luz ambiente. */
:root[data-theme="dark"] .lateral { background: rgba(10, 12, 18, .62); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
:root[data-theme="dark"] .lente::after { background: #0b0d14; }
:root[data-theme="dark"] .menu a.activo { background: rgba(108, 92, 231, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(143, 130, 255, .26); }
:root[data-theme="dark"] .menu a.activo .ic { color: var(--cobalto); opacity: 1; }
/* Superficies: un filo de luz arriba, como vidrio ahumado. */
:root[data-theme="dark"] :is(.card, .tile, .block, .tblwrap, .interes > article, .gasto, .en-curso, .grabar, .oportunidad, .sugerencias, .senalado li) { box-shadow: var(--brillo); }
:root[data-theme="dark"] .oportunidad:target { box-shadow: var(--brillo), 0 0 0 3px color-mix(in srgb, var(--cobalto) 18%, transparent); }
:root[data-theme="dark"] :is(.input, .select, .textarea) { background: var(--hueco); border-color: var(--linea-fuerte); }
@media (max-width: 959px) {
  /* backdrop-filter en la barra volvería a .lateral el contenedor del menú fijo inferior: en móvil el vidrio va solo en el menú. */
  :root[data-theme="dark"] .lateral { background: rgba(10, 12, 18, .94); -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-theme="dark"] .menu { background: rgba(10, 12, 18, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  :root[data-theme="dark"] .menu a.activo { background: transparent; box-shadow: none; }
}

@media print {
  .lateral, .menu, .tabs, .toc, .btn, .acciones, .switch, #tip, .skip-link, .flash, .filters { display: none !important; }
  body, body.con-nav { display: block; background: #fff; color: #000; font-size: 11.5pt; }
  .wrap { max-width: none; padding: 0; }
  .card, .tile, .block, .interes > article, .tblwrap { box-shadow: none; border-color: #bbb; }
  .v-pond { display: none !important; } .v-raw { display: block !important; }
  figure, .tile, .ev li, .interes > article, .block, .finding { break-inside: avoid; }
  h2 { break-after: avoid; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  @page { margin: 16mm; }
}

/* ---------- contenidos en dos redes ---------- */
.tbl--canales td small { display: block; font-size: var(--t-12); color: var(--tinta-3); font-weight: 400; }
.tbl--canales td.mayor { font-weight: 800; color: var(--tinta); }
.tbl--canales tr.clara th { font-weight: 700; }
.tbl--canales th[scope="row"] { font-weight: 600; color: var(--tinta); white-space: nowrap; }
.temas-canal { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.4rem; margin: 0 0 1rem; }
.temas-canal dt { font-weight: 700; margin-bottom: .3rem; }
.temas-canal dd { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.sugerencias { background: var(--hoja); border: 1px solid var(--linea); border-left: 3px solid var(--cobalto); border-radius: 0 var(--r-caja) var(--r-caja) 0; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.sugerencias h2 { margin: 0 0 .2rem; font-size: var(--t-18); }
.sugerencias__lista { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .6rem; }
.sugerencias__lista li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: center; padding-top: .6rem; border-top: 1px solid var(--linea); }
.sugerencias__lista li:first-child { border-top: 0; padding-top: 0; }
.sugerencias__lista .meta { margin-top: .15rem; }
.pareja { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--linea); align-items: flex-end; }
.pareja .field { flex: 1 1 280px; }
tr.par td[data-th="Plataforma"] .chip + .chip { margin-left: .2rem; }

/* ---------- oportunidades ---------- */
.para-grabar { margin: 0 0 1.8rem; }
.para-grabar h2 { margin-top: 0; }
.para-grabar__lista { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.grabar { position: relative; background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.1rem 1rem 1.3rem; overflow: hidden; }
.grabar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lente); }
.grabar h3 { margin: .25rem 0 .4rem; font-size: var(--t-18); line-height: 1.25; }
.grabar h3 a { color: var(--tinta); text-decoration: none; }
.grabar h3 a:hover { text-decoration: underline; }
.grabar__gancho { font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; margin: 0; color: var(--tinta-2); }
.seccion-op { margin-top: 2.2rem; }
.seccion-op > h2 { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .2rem; }
.cuenta { font-size: var(--t-14); font-weight: 600; color: var(--tinta-3); }
.seccion-op > .help { max-width: var(--medida); margin-bottom: .8rem; }
.vacio { color: var(--tinta-2); padding: .8rem 1rem; border: 1px dashed var(--linea-fuerte); border-radius: var(--r-control); max-width: var(--medida); }
.oportunidades { display: grid; gap: .8rem; }
.oportunidad { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--r-caja); padding: 1rem 1.2rem; scroll-margin-top: calc(var(--barra-sup) + 1rem); }
.oportunidad header h3 { margin: .3rem 0 .25rem; font-size: var(--t-18); }
.oportunidad__resumen { color: var(--tinta-2); margin: 0 0 .5rem; font-size: var(--t-14); }
.oportunidad .ev { margin: .2rem 0 .4rem; }
.oportunidad .ev li { padding: .45rem 0; }
.oportunidad .ev .meta a { font-weight: 600; }
.oportunidad:target { border-color: var(--cobalto); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalto) 18%, transparent); }
.plegado { margin-top: 1rem; }
.plegado > summary { cursor: pointer; font-weight: 600; color: var(--tinta-2); padding: .3rem 0; }
.plegado[open] > summary { margin-bottom: .6rem; }
.idea { position: relative; margin-top: .8rem; padding: .9rem 1rem 1rem 1.2rem; border-radius: var(--r-control); background: color-mix(in srgb, var(--hueco) 55%, var(--hoja)); overflow: hidden; }
.idea::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lente); }
.idea .ai-note { margin: 0 0 .6rem; background: var(--hoja); }
.idea__angulo { font-family: var(--serif); font-size: 1.06rem; line-height: 1.5; margin: 0 0 .6rem; max-width: var(--medida); }
.idea__ganchos { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .45rem; }
.idea__ganchos li { display: grid; gap: .1rem; }
.idea__tipo { font-size: var(--t-12); font-weight: 600; color: var(--tinta-3); }
.idea__ganchos q { quotes: "“" "”"; font-weight: 700; font-size: 1.02rem; }
.idea__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .4rem 1.2rem; margin: 0 0 .7rem; }
.idea__meta dt { font-size: var(--t-12); font-weight: 600; color: var(--tinta-3); }
.idea__meta dd { margin: 0; font-size: var(--t-14); }
.idea-en-cola { margin: .6rem 0 0; padding: .5rem .8rem; border-radius: var(--r-control); background: var(--cobalto-suave); color: var(--cobalto); font-weight: 600; font-size: var(--t-14); }

@media (max-width: 640px) {
  .tbl--canales tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .1rem .6rem; padding: .7rem .9rem; }
  .tbl--canales th[scope="row"] { grid-column: 1 / -1; display: block; padding: 0 0 .2rem; border: 0; }
  .tbl--canales td { padding: 0; text-align: left; }
  .tbl--canales td[data-th="Diferencia"] { grid-column: 1 / -1; }
  .tbl--canales td[data-th="Diferencia"]:empty { display: none; }
  .tbl--canales td[data-th="Diferencia"]::before { display: none; }
}
