/* Estudio de video TerraFunded. Sistema de diseño de Atlas (mismo manual de marca, 26 nov 2026):
   todas las pantallas se arman solo con estos valores. Espacios en múltiplos de 4; esquinas 8 (controles), 12 (tarjetas), redondo (píldoras). */
:root {
  --fondo: #0A0D12;      /* página */
  --s1: #11151B;         /* tarjetas */
  --s2: #171C24;         /* campos */
  --s3: #1E2530;         /* activo */
  --linea: #1C222B;      /* divisiones */
  --linea-f: #2A323E;    /* bordes de campos */
  --texto: #F2F4F7;
  --texto2: #A9B2BF;
  --texto3: #7C8796;
  /* Mismo sistema de Atlas, pero con el verde de TerraFunded: el azul se queda para Atlas (Rodrigo, 26 nov 2026) */
  --marca: #00D582;      /* logo, foco */
  --boton: #00D582;      /* acción principal (texto oscuro encima) */
  --boton-hover: #00C077;
  --boton-tinta: #00251A;
  --enlace: #3FE0A0;
  --bien: #3CCB7F;
  --atencion: #F0B44C;
  --error: #F26D6D;
  --r-control: 8px;
  --r-tarjeta: 12px;
  /* nombres viejos (receta.html y los diálogos de acceso.js los usan) */
  --bg: var(--fondo); --panel: var(--s1); --panel-2: var(--s2); --line: var(--linea); --text: var(--texto);
  --muted: var(--texto2); --brand: var(--marca); --brand-ink: #fff; --bad: var(--error); --radius: var(--r-tarjeta);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 400 15px/22px Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--enlace); }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.etiqueta { font: 600 12px/16px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); }
.meta { color: var(--texto3); font-size: 13px; line-height: 18px; }

/* ---------- Marca ---------- */
.marca { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--marca); }
.marca-simbolo { align-self: center; flex: none; width: 34px; height: 14px; background: var(--marca); -webkit-mask: url(/marca.png) center / contain no-repeat; mask: url(/marca.png) center / contain no-repeat; margin-right: 4px; }
.marca-nombre { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.marca-app { font-size: 12px; font-weight: 500; letter-spacing: .18em; color: var(--texto2); }

/* ---------- Esqueleto: barra lateral + contenido ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; border-right: 1px solid var(--linea); background: var(--fondo); }
.side .marca { padding: 0 8px; }
.side-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-control); color: var(--texto2); font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--s1); color: var(--texto); }
.nav-item.on { background: var(--s3); color: var(--texto); }
.nav-item.on .ico { color: var(--marca); }
.nav-item .num { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: #0b2e21; color: var(--enlace); font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.nav-item .num.alerta { background: #3a2a10; color: var(--atencion); }
.side-sep { height: 1px; background: var(--linea); margin: 8px 4px; }
.side-pie { margin-top: auto; display: grid; gap: 16px; }
.side-ia { padding: 12px; border: 1px solid var(--linea); border-radius: var(--r-tarjeta); font-size: 12px; line-height: 16px; color: var(--texto2); }
.side-ia p { margin: 0; }
.side-ia .en { color: var(--texto3); margin-top: 6px; }
.sesion { display: grid; gap: 8px; }
.usuario { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--texto2); }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--s3); color: var(--texto); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.usuario .correo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario button { margin-left: auto; color: var(--texto3); font-size: 13px; }
.usuario button:hover { color: var(--texto); }

.main { min-width: 0; padding: 40px 48px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { margin: 4px 0 0; color: var(--texto2); }
.page-acciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Botones y controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-control); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn.prim { background: var(--boton); color: var(--boton-tinta); }
.btn.prim:hover { background: var(--boton-hover); }
.btn.sec { background: var(--s1); color: var(--texto); border: 1px solid var(--linea-f); }
.btn.sec:hover { background: var(--s2); }
.btn.peq { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ancho { width: 100%; }
.pildora { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linea-f); color: var(--texto2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pildora:hover { color: var(--texto); border-color: #3a4452; }
.pildora.on { background: var(--texto); border-color: var(--texto); color: #0A0D12; }
.pildora .n { color: var(--texto3); font-weight: 500; }
.pildora.on .n { color: #5b6573; }
.segmentado { display: inline-flex; padding: 4px; gap: 4px; background: var(--s1); border: 1px solid var(--linea); border-radius: 999px; }
.segmentado button { height: 32px; padding: 0 14px; border-radius: 999px; color: var(--texto2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.segmentado button.on { background: var(--s3); color: var(--texto); }
.segmentado .n { color: var(--texto3); font-weight: 500; margin-left: 4px; }
select, input[type=url], input[type=text], input[type=email], textarea {
  background: var(--s2); color: var(--texto); border: 1px solid var(--linea-f); border-radius: var(--r-control); font: inherit; font-size: 14px; }
select { height: 40px; padding: 0 12px; max-width: 260px; }
input[type=url], input[type=text], input[type=email] { height: 40px; padding: 0 12px; width: 100%; }
textarea { width: 100%; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--texto3); }
.campo-select { display: flex; align-items: center; gap: 8px; color: var(--texto3); font-size: 13px; }

/* ---------- Filtros de piezas ---------- */
#filtros { display: grid; gap: 16px; margin-bottom: 24px; }
.fila-filtros { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grupos, .areas { display: flex; gap: 8px; flex-wrap: wrap; }
.areas { padding: 12px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); }
.areas:empty { display: none; }
.areas .pildora { height: 28px; padding: 0 12px; font-size: 12.5px; }
.conteo { color: var(--texto3); font-size: 13px; }
.fincas-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fincas-bar .lbl { margin-right: 4px; }
.finca-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-control); text-align: left; }
.finca-chip b { font-size: 13px; font-weight: 600; }
.finca-chip small { font-size: 12px; color: var(--texto3); }
.finca-chip.on { border-color: var(--marca); background: #0b2a1f; }

/* ---------- Tarjetas de piezas ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.grid.vertical { grid-template-columns: repeat(auto-fill, minmax(min(46%, 200px), 1fr)); }
.grid.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cargando, .vacio { color: var(--texto3); padding: 32px 0; grid-column: 1 / -1; }
.card { display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: var(--linea-f); }
.card.borrado { opacity: .55; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.card.vert .thumb { aspect-ratio: 9 / 16; }
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: #0A0D12cc; backdrop-filter: blur(6px); font-size: 12px; font-weight: 600; line-height: 22px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--atencion); }
.estado-me_gusta .badge::before { background: var(--bien); }
.finca-tag { position: absolute; bottom: 12px; left: 12px; padding: 2px 10px; border-radius: 999px; background: #0A0D12cc; backdrop-filter: blur(6px); font-size: 12px; font-weight: 600; line-height: 22px; }
.body { display: flex; flex-direction: column; gap: 4px; padding: 16px; flex: 1; }
.body h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.card.vert .body h3 { font-size: 13px; line-height: 18px; }
.rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 12px; }
.rate button { height: 40px; border-radius: var(--r-control); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rate .like { background: var(--boton); color: var(--boton-tinta); }
.rate .like.on { background: #0f2a1d; color: var(--bien); box-shadow: inset 0 0 0 1px #1f5c3d; }
.rate .dislike { background: var(--s1); border: 1px solid var(--linea-f); color: var(--texto); }
.rate .dislike:hover { border-color: #5a2a2a; color: var(--error); }
.audio { height: 100%; display: grid; place-items: center; gap: 8px; padding: 12px; background: var(--s2); }
.audio span { font-size: 40px; color: var(--marca); }
.audio audio { width: 100%; }
.grupo { grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--linea); font-size: 17px; line-height: 24px; font-weight: 600; }
.grupo:first-child { margin-top: 0; }
.grupo small { font-size: 13px; font-weight: 400; color: var(--texto3); }

/* ---------- Diálogos ---------- */
dialog { background: var(--s1); color: var(--texto); border: 1px solid var(--linea-f); border-radius: var(--r-tarjeta); padding: 0; }
dialog::backdrop { background: #000c; }
.detalle { width: min(1100px, 96vw); max-height: 94vh; }
.det-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--linea); }
.det-head h2 { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 700; }
.det-media { background: #000; }
.det-media video, .det-media img { width: 100%; max-height: 62vh; display: block; object-fit: contain; background: #000; }
.det-media.vert video { max-height: 72vh; }
.det-media .audio { min-height: 200px; }
.det-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 20px 24px 24px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 12px 0; }
dt { color: var(--texto3); }
dd { margin: 0; }
pre { margin: 0; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--r-control); padding: 12px; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
h4 { margin: 20px 0 8px; font: 600 12px/16px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); }
.file { display: inline-block; margin-top: 12px; color: var(--enlace); font-weight: 600; font-size: 13px; }
.coms { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; font-size: 14px; }
.coms li { padding: 12px; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--r-control); }
#com-form { display: grid; gap: 8px; justify-items: end; }
.hint { color: var(--texto3); font-size: 13px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #3a1717; color: #fff; border: 1px solid #5a2a2a; padding: 12px 16px; border-radius: var(--r-control); font-size: 14px; z-index: 99; }
.toast.ok { background: #123a26; border-color: #1f5c3d; }

/* ---------- Publicaciones (Alejandra) ---------- */
.pubs { grid-column: 1 / -1; display: grid; gap: 32px; }
.dia { display: grid; gap: 8px; }
.dia-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.dia-head .etiqueta.hoy { color: var(--enlace); }
.dia-head .etiqueta.tarde { color: var(--error); }
.pub { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 20px; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); cursor: pointer; text-align: left; width: 100%; }
.pub:hover { border-color: var(--linea-f); }
.pub-thumb { width: 64px; aspect-ratio: 9 / 16; border-radius: var(--r-control); overflow: hidden; background: var(--s2); }
.pub-thumb video, .pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-info { display: grid; gap: 4px; min-width: 0; }
.pub-info .meta .ico { width: 14px; height: 14px; vertical-align: -2px; }
.pub-info b { font-size: 17px; line-height: 24px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redes { display: flex; gap: 8px; }
.red { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--linea-f); color: var(--texto3); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.red .rico { width: 18px; height: 18px; }
.red.ok { border-color: #1f5c3d; background: #0f2a1d; color: var(--bien); }
.pub .chev { color: var(--texto3); }
.resumen-dia { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texto3); }
.resumen-dia.listo { color: var(--bien); }

.pub-det { width: min(1040px, 96vw); max-height: 94vh; }
.pub-det .det-cuerpo { display: grid; grid-template-columns: 340px 1fr; gap: 24px; padding: 24px; }
.pub-video { display: grid; gap: 12px; align-content: start; }
.pub-video video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r-tarjeta); display: block; }
.pub-secciones { display: grid; gap: 16px; align-content: start; min-width: 0; }
.caja { padding: 16px; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); display: grid; gap: 12px; }
.caja-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.caja-head h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.texto-copiable { white-space: pre-wrap; font-size: 14px; line-height: 21px; color: var(--texto); padding: 12px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-control); }
.dato { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 14px; }
.dato span:first-child { color: var(--texto3); }
.fila-red { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea); }
.fila-red:first-of-type { border-top: 0; padding-top: 0; }
.fila-red .nombre { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.fila-red .estado { font-size: 12px; font-weight: 500; color: var(--texto3); display: block; }
.fila-red .estado.ok { color: var(--bien); }
.fila-red .link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.respuestas { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.respuestas li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 12px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-control); font-size: 14px; }
.respuestas li small { display: block; color: var(--texto3); font-size: 12px; margin-bottom: 2px; }
.aviso.notas-redes { white-space: pre-line; line-height: 1.55; font-size: 14px; }
.aviso { padding: 12px 16px; border-radius: var(--r-control); background: #2a2110; border: 1px solid #4a3a1a; color: var(--atencion); font-size: 13px; }

/* Métricas y comentarios */
.metricas { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--texto2); }
.fila-red .metricas { grid-column: 1 / -1; padding-left: 26px; }
.metricas b { color: var(--texto); font-weight: 600; }
.coment { display: grid; gap: 12px; padding: 16px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); }
.coment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--texto3); }
.coment-head b { color: var(--texto); font-size: 14px; }
.coment-texto { font-size: 15px; line-height: 22px; white-space: pre-wrap; }
.coment-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.sugeridas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sugeridas .etiqueta { margin-right: 4px; }

/* ---------- Reports ---------- */
.reportes { grid-column: 1 / -1; display: grid; gap: 16px; position: relative; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; padding: 16px; background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); }
.kpi .etiqueta { display: flex; align-items: center; gap: 6px; }
.kpi .etiqueta .ico { width: 14px; height: 14px; }
.kpi b { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; }
.kpi.destacado { border-color: #1f5c3d; background: linear-gradient(180deg, #0f2a1d, var(--s1)); }
.kpi.destacado .etiqueta { color: var(--marca); }
.rep-fila { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.rep-fila:nth-of-type(3) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.reportes .caja { background: var(--s1); grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; }
.cal { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); max-width: 460px; width: 100%; justify-self: center; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 15px; }
.cal-head .btn { width: 32px; padding: 0; font-size: 18px; }
.cal-sem, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-sem span { text-align: center; font-size: 12px; color: var(--texto3); font-weight: 600; }
.cal-dia { position: relative; height: 52px; min-width: 0; padding: 0; border-radius: var(--r-control); background: var(--s2); border: 1px solid var(--linea); display: grid; place-items: center; font-size: 13px; }
.cal-dia.hueco { background: none; border: 0; }
.cal-dia .n { position: absolute; top: 4px; left: 6px; font-size: 11px; color: var(--texto3); }
.cal-dia .ico { width: 18px; height: 18px; color: #00251A; stroke-width: 2.5; }
.cal-dia .frac { font-size: 11px; font-weight: 600; margin-top: 8px; }
.cal-dia.est-ok { background: var(--marca); border-color: var(--marca); }
.cal-dia.est-ok .n { color: #00251A; }
.cal-dia.est-parcial { background: #3a2a10; border-color: #6b4e1d; color: var(--atencion); }
.cal-dia.est-nada { background: #3a1717; border-color: #6b2a2a; color: var(--error); }
.cal-dia.est-sin { background: repeating-linear-gradient(135deg, var(--s2) 0 4px, #2a1d1d 4px 6px); border-color: #4a2a2a; }
.cal-dia.est-hoy { border: 2px dashed var(--marca); }
.cal-dia.es-hoy { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--marca); }
.cal-dia.est-futuro, .cal-dia.est-antes { opacity: .45; }
.cal-leyenda { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--texto2); margin-top: 4px; }
.cal-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cal-leyenda i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--linea-f); }
.cal-leyenda i.est-ok { background: var(--marca); } .cal-leyenda i.est-parcial { background: #3a2a10; border-color: #6b4e1d; }
.cal-leyenda i.est-nada { background: #3a1717; border-color: #6b2a2a; } .cal-leyenda i.est-sin { background: repeating-linear-gradient(135deg, var(--s2) 0 3px, #2a1d1d 3px 5px); }
.cal-leyenda i.est-hoy { border: 2px dashed var(--marca); }
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz .g { stroke: var(--linea); stroke-width: 1; }
.viz .b { stroke: var(--linea-f); stroke-width: 1; }
.viz .ex, .viz .ey { fill: var(--texto3); font: 500 11px Inter, sans-serif; }
.viz .et { fill: var(--texto2); font: 600 12px Inter, sans-serif; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz .hit:hover { fill: #ffffff08; }
.viz .cruz { stroke: var(--texto3); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-vacio { padding: 32px 16px; text-align: center; color: var(--texto3); font-size: 14px; border: 1px dashed var(--linea-f); border-radius: var(--r-control); }
.por-red { display: grid; gap: 8px; }
.pr { display: grid; grid-template-columns: 130px minmax(0, 1fr) 56px; align-items: center; gap: 12px; font-size: 13px; }
.pr-n { display: inline-flex; align-items: center; gap: 6px; color: var(--texto2); }
.pr-n i { width: 10px; height: 10px; border-radius: 3px; }
.pr-barra { height: 8px; background: var(--s2); border-radius: 99px; overflow: hidden; }
.pr-barra span { display: block; height: 100%; border-radius: 99px; }
.pr b { text-align: right; font-variant-numeric: tabular-nums; }
.leyenda { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--texto2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 180px; padding: 10px 12px; background: var(--s3); border: 1px solid var(--linea-f); border-radius: var(--r-control); font-size: 12px; box-shadow: 0 8px 24px #0008; }
.viz-tip b { display: block; margin-bottom: 6px; font-size: 13px; text-transform: capitalize; }
.viz-tip div { display: flex; align-items: center; gap: 6px; color: var(--texto2); line-height: 20px; }
.viz-tip div span { margin-left: auto; color: var(--texto); font-weight: 600; }
.viz-tip i { width: 8px; height: 8px; border-radius: 2px; }
.viz-tip .t { border-top: 1px solid var(--linea-f); margin-top: 4px; padding-top: 4px; }
.robot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: var(--r-control); border: 1px solid var(--linea-f); background: var(--fondo); }
.robot > div { display: grid; gap: 2px; min-width: 0; }
.robot b { font-size: 14px; }
.robot.ok { border-color: #1f5c3d; } .robot.aviso { border-color: #6b4e1d; } .robot.falta { border-color: #6b2a2a; }
.robot pre { margin-top: 8px; max-height: 160px; }
.conectar { width: min(560px, 94vw); }
.conectar-cuerpo { padding: 20px 24px 24px; display: grid; gap: 12px; }
.conectar-cuerpo ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.fila-botones { display: flex; justify-content: flex-end; gap: 8px; }
.cuentas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cuenta { display: grid; gap: 8px; align-content: start; padding: 16px; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); }
.cuenta-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cuenta-head .punto { width: 8px; height: 8px; border-radius: 99px; }
.cuenta > .pill { justify-self: start; }
.pill.on::before { background: var(--bien); }
.cuenta-nums { display: grid; gap: 8px; }
.cuenta-nums div { display: grid; }
.cuenta-nums b { font-size: 20px; line-height: 26px; font-weight: 700; }
.cuenta-nums span { font-size: 12px; color: var(--texto3); }
.editar summary { cursor: pointer; font-size: 13px; color: var(--enlace); }
.editar-form { display: grid; gap: 8px; margin-top: 8px; }
.tabla-scroll { overflow-x: auto; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla td .ico { width: 16px; height: 16px; vertical-align: -3px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cuentas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 22px; line-height: 28px; }
  .rep-fila, .rep-fila:nth-of-type(3) { grid-template-columns: 1fr; }
  .cuentas { grid-template-columns: 1fr; }
  .reportes .tabla thead { display: table-header-group; }
  .reportes .tabla td, .reportes .tabla tr { display: table-cell; } .reportes .tabla tr { display: table-row; }
  .reportes .tabla td { padding: 12px 8px; border-bottom: 1px solid var(--linea); }
}

/* ---------- Renders ---------- */
.renders { grid-column: 1 / -1; display: grid; gap: 16px; }
.maq { background: var(--s1); border: 1px solid var(--linea); border-radius: var(--r-tarjeta); padding: 16px; display: grid; gap: 4px; }
.maq b { font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--s3); color: var(--texto2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--texto3); }
.maq.on .pill::before, .r-listo .pill::before { background: var(--bien); }
.r-renderizando .pill::before, .r-pendiente .pill::before, .r-subiendo .pill::before { background: var(--atencion); }
.r-error .pill::before { background: var(--error); }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; padding: 0 16px 12px; font: 600 12px/16px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); border-bottom: 1px solid var(--linea); }
.tabla td { text-align: left; vertical-align: top; padding: 16px; border-bottom: 1px solid var(--linea); }
.tabla td > * + * { margin-top: 4px; }
.tabla td .btn { margin-right: 8px; }
.tabla pre { font-size: 11px; max-height: 260px; }

/* ---------- Barra inferior (teléfono) ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side #copiar-claude { width: 40px; padding: 0; font-size: 0; gap: 0; }
  .side #copiar-claude .ico { width: 18px; height: 18px; }
  .pub-video video { max-height: 52vh; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 16px; border-right: 0; border-bottom: 1px solid var(--linea); }
  .side-nav, .side-ia { display: none; }
  .side-pie { margin: 0; }
  .usuario .correo { display: none; }
  .sesion { display: flex; align-items: center; }
  .main { padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head h1 { font-size: 26px; line-height: 32px; }
  .grupos, .segmentado { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); background: #0A0D12f2; backdrop-filter: blur(10px); border-top: 1px solid var(--linea); z-index: 20; }
  .tabbar button, .tabbar a { display: grid; justify-items: center; gap: 4px; padding: 4px 0; color: var(--texto3); font-size: 11px; font-weight: 500; text-decoration: none; position: relative; }
  .tabbar .on { color: var(--marca); }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .punto { position: absolute; top: 0; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--boton); color: var(--boton-tinta); font-size: 10px; line-height: 16px; }
  .grid.mini { grid-template-columns: 1fr; }
  .det-grid, .pub-det .det-cuerpo { grid-template-columns: 1fr; }
  .pub-video video { width: auto; margin: 0 auto; }
  .pub { grid-template-columns: 56px minmax(0, 1fr) 16px; }
  .pub .redes { grid-column: 2 / 4; grid-row: 2; flex-wrap: wrap; }
  .pub-thumb { width: 56px; grid-row: 1 / 3; }
  .red span.txt { display: none; }
  .red { padding: 0 8px; }
  .fila-red { grid-template-columns: 1fr auto; }
  .fila-red .campo { grid-column: 1 / -1; grid-row: 2; }
  .dato { grid-template-columns: 1fr; gap: 2px; }
  .tabla thead { display: none; }
  .tabla td { display: block; padding: 8px 0; border: 0; }
  .tabla tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--linea); }
}

/* ---------- Receta (receta.html) ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px clamp(16px, 4vw, 48px) 12px; border-bottom: 1px solid var(--linea); }
.top .session { display: flex; gap: 8px; flex-wrap: wrap; }
.top .chip, .top .primary { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r-control); font-size: 13px; font-weight: 600; text-decoration: none; }
.top .chip { border: 1px solid var(--linea-f); color: var(--texto); background: var(--s1); }
.top .primary { background: var(--boton); color: var(--boton-tinta); }
.receta { max-width: 820px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 48px) 64px; line-height: 1.65; font-size: 15.5px; }
.receta h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; line-height: 1.15; margin: 8px 0 16px; letter-spacing: -.02em; }
.receta h2 { font-size: 20px; font-weight: 700; color: var(--texto); margin: 32px 0 8px; }
.receta-kicker { color: var(--enlace); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 16px 0 0; }
.receta-lead { background: var(--s1); border: 1px solid var(--linea); border-left: 3px solid var(--marca); padding: 12px 16px; border-radius: var(--r-control); color: var(--texto2); font-size: 14px; }
.receta ol, .receta ul { padding-left: 22px; }
.receta li { margin: 8px 0; }
.receta code { background: var(--s2); border: 1px solid var(--linea); border-radius: 6px; padding: 1px 6px; font-size: 13px; word-break: break-all; }
.receta-foot { margin-top: 40px; color: var(--texto3); font-size: 13px; }

/* ---------- Login igual al de Payments (acceso.js) ---------- */
.pay-login { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #00261B; color: #171717; }
.pay-login[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pay-login::backdrop { background: #00261B; }
.pay-logo { height: 40px; width: auto; margin-bottom: 32px; mix-blend-mode: lighten; }
.pay-x { position: absolute; top: 16px; right: 20px; background: transparent; color: #8fb3a3; font-size: 28px; border: 0; cursor: pointer; }
.pay-card { width: min(384px, 92vw); background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; box-shadow: 0 10px 25px #0004; padding: 24px; box-sizing: border-box; }
.pay-card form { display: grid; gap: 16px; }
.pay-card label { display: grid; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: #737373; }
.pay-card input { height: 44px; border: 1px solid #d4d4d4; border-radius: 6px; padding: 0 12px; font: 400 15px Inter, system-ui, sans-serif; color: #171717; text-transform: none; letter-spacing: 0; background: #fff; }
.pay-card input:focus-visible { outline: 2px solid #C8A54B; outline-offset: 1px; }
.pay-btn { height: 44px; border: 0; border-radius: 6px; background: #C8A54B; color: #0a0a0a; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
.pay-btn:hover { background: #B08A34; }
.pay-link { background: transparent; border: 0; color: #926D2B; font: 500 14px Inter, system-ui, sans-serif; cursor: pointer; }
.pay-err { margin: 0; color: #b42318; font-size: 14px; min-height: 0; }
.pay-err:empty { display: none; }
.bloque-manual { width: min(640px, 94vw); padding: 24px; }
.bloque-manual h2 { margin: 0 0 8px; font-size: 20px; }
.bloque-manual p { margin: 0 0 12px; color: var(--texto2); font-size: 14px; }
.bloque-manual textarea { font: 12px ui-monospace, monospace; background: var(--fondo); }
.bloque-manual .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.bloque-manual .ghost, .bloque-manual .primary { height: 40px; padding: 0 16px; border-radius: var(--r-control); font-weight: 600; }
.bloque-manual .ghost { border: 1px solid var(--linea-f); }
.bloque-manual .primary { background: var(--boton); color: var(--boton-tinta); }
