/* Ciudad de trabajo y Observatorio para abogados · v020. Todo acotado a body.modo-mesa (solo
   ?perfil=emetria) o a clases que solo existen en su DOM (ac-, ab-, ob-, tv-).
   Ciudad: cielo diurno, mensaje breve centrado arriba, actividad compacta abajo, botón del Observatorio
   anclado sobre su edificio. Sala de visionado: capa oscura con alfa .80 en su FONDO (no opacity) y
   nueve televisiones neutras de alto contraste. Verde Freedom para la actividad y la reserva.
   Fuentes locales Fraunces e Inter. */

.modo-mesa {
  --ac-tinta: #2b2622;
  --ac-tinta-2: #4f4842;
  --ac-suave: #6c625a;
  --ac-burdeos: #6b2737;
  --ac-terracota: #a36b50;
  --ac-ocre: #c99a2e;
  --ac-verde: #1E6B55;
  --ac-menta: #52E2AC;
  --ac-ambar: #f2c14e;
  --ac-linea: rgba(43, 38, 34, .1);
  --foco: 0 0 0 3px #fff, 0 0 0 5px var(--ac-verde);
  background: #b9d3e8;
  color: var(--ac-tinta);
}
.modo-mesa .escena-fondo {
  background:
    radial-gradient(22% 5% at 12% 18%, #ffffffd0 0 55%, transparent 56%),
    radial-gradient(18% 4% at 86% 12%, #ffffffc0 0 55%, transparent 56%),
    radial-gradient(26% 6% at 70% 92%, #ffffffd8 0 55%, transparent 56%),
    radial-gradient(20% 5% at 18% 88%, #ffffffc8 0 55%, transparent 56%),
    linear-gradient(180deg, #8db6dc 0%, #a9c9e6 34%, #c6dcee 70%, #dce9f3 100%);
}
.modo-mesa .cab { position: absolute; }
.modo-mesa .sector { color: var(--ac-burdeos); }
.modo-mesa .relato { pointer-events: none; padding: 0 calc(var(--rail) + var(--margen)) 0 var(--margen); }
.modo-mesa .relato .portal { pointer-events: auto; }

/* ── Ciudad: mensaje breve centrado, actividad compacta ─────────────── */
.ac-ciudad { position: relative; height: 100vh; height: 100dvh; min-height: 480px; }
.ac-titular {
  position: absolute; top: 12px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; pointer-events: none;
}
.ac-titular > * { pointer-events: auto; }
.ac-titular h1 {
  font: 600 clamp(1.2rem, 1.8vw, 1.7rem)/1.08 var(--f-identidad); letter-spacing: -.015em; color: var(--ac-tinta);
  font-variation-settings: 'opsz' 96; outline: none;
  text-shadow: 0 0 16px rgba(255, 255, 255, .95), 0 0 3px rgba(255, 255, 255, .9);
}
.ac-titular h1 em { font-style: italic; color: var(--ac-burdeos); }
.ac-etiqueta {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .84); border: 1px solid rgba(30, 107, 85, .18);
  font: 600 .625rem/1.3 var(--f-interfaz); letter-spacing: .08em; text-transform: uppercase; color: var(--ac-verde);
}
.ac-punto { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-menta); box-shadow: 0 0 0 3px rgba(82, 226, 172, .28); }

/* Acceso al Observatorio: sin escena, debajo del mensaje; con escena, anclado sobre el edificio. */
.ac-obs {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 4px; padding: 6px 15px 6px 6px;
  border: 0; border-radius: 999px; background: var(--ac-verde); color: #fff; cursor: pointer; text-align: left;
  box-shadow: 0 12px 26px -12px rgba(14, 58, 45, .75), inset 0 0 0 2px rgba(82, 226, 172, .55);
  font: 600 .875rem/1.15 var(--f-interfaz);
}
.ac-obs:hover { background: #185A47; }
.ac-obs:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ac-verde); }
.ac-obs-ico {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ac-menta); color: #0c3a2c;
}
.ac-obs-ico::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(82, 226, 172, .6); animation: ac-onda 2.4s ease-out infinite; }
.ac-obs-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ac-obs-txt { display: flex; flex-direction: column; }
.ac-obs-s { font-weight: 500; font-size: .71875rem; color: #c3f6e1; }
@keyframes ac-onda { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.ac-obs[data-anclado] {
  position: fixed; left: 0; top: 0; z-index: 3; margin: 0;
  transform: translate(var(--x), var(--y)) translate(-50%, calc(-100% - 14px));
}
.ac-obs[data-anclado]::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 14px; transform: translateX(-50%);
  background: linear-gradient(var(--ac-verde), rgba(30, 107, 85, 0));
}

/* v022 · Agente planificador: botón nativo anclado sobre el agente iluminado de la rotonda (sin escena,
   debajo del mensaje). Claro y con anillo menta para distinguirse del botón de reserva. */
.ac-plan {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 4px; padding: 6px 16px 6px 6px;
  border: 0; border-radius: 999px; background: var(--ac-verde); color: #fff; cursor: pointer; text-align: left;
  box-shadow: 0 12px 26px -12px rgba(14, 58, 45, .6), inset 0 0 0 2px var(--ac-menta);
  font: 700 .875rem/1.15 var(--f-interfaz);
}
.ac-plan:hover { background: #185A47; }
.ac-plan:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ac-verde); }
.ac-plan:disabled { cursor: default; opacity: .7; }
.ac-plan-ico {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ac-menta); color: #0c3a2c;
}
.ac-plan-ico::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(82, 226, 172, .6); animation: ac-onda 2.4s ease-out infinite; }
.ac-plan-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ac-plan-txt { display: flex; flex-direction: column; }
.ac-plan-s { font-weight: 500; font-size: .71875rem; color: #c3f6e1; }
.ac-plan[data-anclado] {
  position: fixed; left: 0; top: 0; z-index: 3; margin: 0;
  transform: translate(var(--x), var(--y)) translate(-50%, calc(-100% - 14px));
}
.ac-plan[data-anclado]::after {
  content: ""; position: absolute; left: calc(50% + var(--dx, 0px)); top: 100%; width: 2px; height: 14px; transform: translateX(-50%);
  background: linear-gradient(var(--ac-menta), rgba(82, 226, 172, 0));
}
/* Estado del viaje (también sin WebGL): texto y barra de avance con el mismo reloj. */
.ac-viaje {
  display: inline-flex; flex-direction: column; gap: 5px; margin-top: 4px; padding: 7px 14px 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .9); color: var(--ac-tinta); font: 600 .8125rem/1.2 var(--f-interfaz);
  box-shadow: 0 10px 22px -14px rgba(14, 58, 45, .6);
}
.ac-viaje-barra { display: block; width: 220px; max-width: 60vw; height: 4px; border-radius: 4px; background: #e3eaf0; overflow: hidden; }
.ac-viaje-barra span { display: block; width: 0; height: 100%; background: var(--ac-verde); }

/* ── Actividad compacta: tres agentes en una franja ──────────────── */
/* v022: deja a su derecha el sitio del botón «Reservar una demo» (--cta-ancho), sin solaparse. */
.ac-actividad {
  position: absolute; left: 0; bottom: 12px; width: min(1040px, 100%); padding: 7px 12px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 16px 36px -24px rgba(30, 50, 70, .55); pointer-events: auto;
}
.ac-act-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.ac-act-t { font: 600 .875rem/1.2 var(--f-identidad); color: var(--ac-tinta); }
.ac-actividad[data-fase="revisar"] .ac-act-t { color: #7a5a12; }
.ac-act-s { font-size: .6875rem; color: var(--ac-suave); }
.ac-filas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.ac-fila {
  position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "punto nombre estado" "tarea tarea tarea";
  gap: 1px 7px; align-items: center; padding: 4px 0 6px; border-top: 1px solid var(--ac-linea); min-width: 0;
}
.ac-robot { grid-area: punto; width: 9px; height: 9px; border-radius: 50%; background: #cfd6d2; box-shadow: 0 0 0 3px rgba(207, 214, 210, .35); }
.ac-fila[data-estado="trabajando"] .ac-robot { background: var(--ac-menta); box-shadow: 0 0 0 3px rgba(82, 226, 172, .3); animation: ac-latido 1.2s ease-in-out infinite; }
.ac-fila[data-estado="revisar"] .ac-robot { background: var(--ac-ambar); box-shadow: 0 0 0 3px rgba(242, 193, 78, .3); }
@keyframes ac-latido { 50% { box-shadow: 0 0 0 6px rgba(82, 226, 172, .08); } }
.ac-nombre { grid-area: nombre; font-weight: 600; font-size: .8125rem; color: var(--ac-tinta); }
.ac-estado {
  grid-area: estado; padding: 1px 7px; border-radius: 999px; white-space: nowrap; font: 600 .625rem/1.35 var(--f-interfaz);
  background: #ebeee9; color: var(--ac-tinta-2);
}
.ac-fila[data-estado="trabajando"] .ac-estado { background: #e3eaf0; color: #2b3a44; } /* v021: trabajando neutro */
.ac-fila[data-estado="revisar"] .ac-estado { background: #fbe8b6; color: #6b4d0c; }
.ac-tarea { grid-area: tarea; font-size: .75rem; line-height: 1.3; color: var(--ac-tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-barra { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.ac-barra span { display: block; height: 100%; width: 0; background: var(--ac-verde); transition: width .25s linear; }
.ac-fila[data-estado="revisar"] .ac-barra span { background: var(--ac-ocre); }

/* ── Rótulos sobre la ciudad (decorativos, no interactivos) ───────── */
.ab-pines { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ab-pin {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 7px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, .92); border: 1px solid rgba(43, 45, 47, .12); color: var(--ac-tinta);
  font: 600 .75rem/1.1 var(--f-interfaz); box-shadow: 0 8px 18px -12px rgba(30, 50, 70, .6);
}
.ab-pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 12px; background: rgba(43, 45, 47, .35); }
.ab-pin-p { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-terracota); }
.ab-chip-robot {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px 2px 5px; border-radius: 999px; white-space: nowrap;
  background: #fff; color: var(--ac-tinta); border: 1px solid rgba(43, 45, 47, .14);
  font: 600 .65625rem/1.25 var(--f-interfaz); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .45);
}
.ab-chip-p { width: 8px; height: 8px; border-radius: 50%; background: var(--identidad, var(--ac-verde)); }
.ab-chip-robot[data-estado="trabajando"] { border-color: var(--ac-menta); box-shadow: 0 0 0 2px rgba(82, 226, 172, .35), 0 6px 14px -8px rgba(0, 0, 0, .45); }
.ab-chip-robot[data-estado="revisar"] { background: #fff6dc; border-color: var(--ac-ambar); }
.ab-chip-robot[data-estado="cancelado"] { color: #6b7073; }

/* v002 · Con la sala abierta, el HUD de la ciudad (mensaje, botón anclado, actividad, rótulos y etiquetas)
   desaparece de la vista sin colapsar: visibility conserva sus cajas para las mediciones de cámara.
   La marca de cabecera y la reserva siguen. Al cerrar la sala vuelve todo. */
.modo-mesa.observatorio-abierto .ac-titular, .modo-mesa.observatorio-abierto .ac-titular *,
.modo-mesa.observatorio-abierto .ac-actividad, .modo-mesa.observatorio-abierto .ab-pines,
.modo-mesa.observatorio-abierto .ab-pines * { visibility: hidden; }

/* ── Observatorio · sala de visionado ─────────────────────────────── */
.ob-sala {
  position: fixed; inset: 0; z-index: 5; pointer-events: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 62px calc(var(--rail) + 20px) 14px 20px;
  background: rgba(8, 13, 16, .8); /* alfa .80 en el fondo: la ciudad sigue reconocible detrás */
  color: #fff; font-family: var(--f-interfaz);
}
.ob-cab { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }

/* ── v022 · Sala: lista de tareas fija a la izquierda y, a la derecha, detalle + pantallas ── */
.modo-mesa { --ob-lista: 206px; }
.ob-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--ob-lista) minmax(0, 1fr); gap: 14px; }
/* En escritorio, con la sala abierta, el botón de reserva se coloca bajo la lista: no tapa pantallas. */

.ob-tareas {
  min-height: 0; display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 0; padding: 10px;
  border-radius: 14px; background: rgba(18, 23, 25, .94); border: 1px solid rgba(255, 255, 255, .1);
}
.ob-tareas-cab { display: flex; flex-direction: column; gap: 7px; }
.ob-tareas-t { font: 600 1rem/1.1 var(--f-identidad); color: #fff; }
.ob-orden { display: flex; gap: 4px; }
.ob-orden button {
  flex: 1; min-width: 0; padding: 4px 0; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: transparent; color: #c9d3cf; font: 600 .6875rem/1.2 var(--f-interfaz); cursor: pointer;
}
.ob-orden button[aria-pressed="true"] { background: #fff; color: #121719; border-color: #fff; }
.ob-lote { display: flex; gap: 6px; }
.ob-lote button {
  flex: 1; min-height: 30px; padding: 0 8px; border-radius: 8px; cursor: pointer; font: 700 .75rem/1.1 var(--f-interfaz);
  border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff;
}
.ob-lote .ob-lote-lanzar { background: #fff; color: #121719; border-color: #fff; }
.ob-lote button:disabled { opacity: .45; cursor: default; }
.ob-dice {
  position: relative; padding: 7px 10px; border-radius: 10px; background: #fff; color: #121719;
  font: 600 .78125rem/1.3 var(--f-interfaz);
}
.ob-dice::before { content: ""; position: absolute; left: 18px; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
.ob-tareas-lista { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; }
.ob-grupo-t { margin: 0 0 4px; font: 700 .625rem/1.2 var(--f-interfaz); letter-spacing: .08em; text-transform: uppercase; color: #8fa19b; }
.ob-grupo-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ob-ficha {
  width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-areas: "sel t" "sel f" "sel est";
  column-gap: 7px; row-gap: 1px; padding: 6px 8px; border-radius: 9px; text-align: left; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .1); border-left: 3px solid var(--ob-tono, rgba(255, 255, 255, .18));
  background: rgba(255, 255, 255, .04); color: #fff; font-family: var(--f-interfaz);
}
.ob-ficha:hover { background: rgba(255, 255, 255, .08); }
.ob-item[data-abierta="si"] .ob-ficha { border-color: #fff; border-left-color: var(--ob-tono, #fff); background: rgba(255, 255, 255, .11); }
.ob-ficha-sel { grid-area: sel; position: relative; width: 12px; height: 12px; margin-top: 2px; border-radius: 3px; border: 1.5px solid rgba(255, 255, 255, .45); }
.ob-item[data-seleccionada="si"] .ob-ficha-sel { background: #fff; border-color: #fff; }
.ob-item[data-seleccionada="si"] .ob-ficha-sel::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #121719; font: 800 9px/1 var(--f-interfaz); }
.ob-ficha-t { grid-area: t; font: 600 .78125rem/1.22 var(--f-interfaz); }
.ob-ficha-f { grid-area: f; font: 500 .6875rem/1.25 var(--f-interfaz); color: #a9b6b2; }
.ob-ficha-est { grid-area: est; display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font: 600 .65625rem/1.2 var(--f-interfaz); color: var(--ob-tono, #c9d3cf); }
.ob-item[data-estado="trabajando"] .ob-ficha-est, .ob-item[data-estado="pendiente"] .ob-ficha-est,
.ob-item[data-estado="seleccionada"] .ob-ficha-est, .ob-item[data-estado="en-cola"] .ob-ficha-est { color: #c9d3cf; }
.ob-ficha-est svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ob-tareas-nota { margin: 2px 0 0; font: 500 .625rem/1.3 var(--f-interfaz); color: #8fa19b; }

.ob-contenido { min-width: 0; min-height: 0; display: flex; gap: 14px; }
.ob-detalle {
  flex: 0 0 300px; align-self: flex-start; max-height: 100%; overflow-y: auto; padding: 14px 16px 16px;
  border-radius: 14px; background: #fbfaf7; color: #22272a; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
}
.ob-det-cat { font: 700 .6875rem/1.2 var(--f-interfaz); letter-spacing: .06em; text-transform: uppercase; color: #5b6166; }
.ob-det-t { margin: 3px 0 2px; font: 600 1.125rem/1.2 var(--f-identidad); }
.ob-det-meta { font-size: .75rem; color: #5b6166; }
.ob-det-lineas { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ob-det-lineas li { padding: 6px 8px; border-left: 3px solid transparent; border-radius: 7px; font: 500 .875rem/1.4 var(--f-interfaz); color: #3b4044; transition: background .25s, border-color .25s; }
.ob-det-lineas li[data-leyendo="si"] { background: #eef4f8; border-left-color: #22272a; color: #121719; }
.ob-det-lineas li[data-leyendo="leida"] { border-left-color: #c9cec7; }
.ob-det-acc { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-det-lanzar, .ob-det-cerrar { min-height: 38px; padding: 0 14px; border-radius: 9px; cursor: pointer; font: 700 .875rem/1.1 var(--f-interfaz); }
.ob-det-lanzar { border: 0; background: #121719; color: #fff; }
.ob-det-lanzar:disabled { background: #e3e6e1; color: #3b4044; cursor: default; }
.ob-det-cerrar { border: 1px solid #c9cec7; background: #fff; color: #22272a; }
.ob-detalle :focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #121719; }

.ob-escena { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; }
.ob-escena .ob-rejilla { flex: 1; min-width: 0; }
.ob-bienvenida {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; text-align: center; pointer-events: none;
}
.ob-bien-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(82, 226, 172, .16); color: var(--ac-menta); box-shadow: 0 0 0 6px rgba(82, 226, 172, .08); }
.ob-bien-ico svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ob-bien-t { font: 600 clamp(1.6rem, 2.6vw, 2.4rem)/1.1 var(--f-identidad); color: #fff; }
.ob-bien-s { max-width: 38ch; font-size: .9375rem; line-height: 1.45; color: #c9d3cf; }

/* Cursor de demostración: gráfico, sin eventos, coordinado con objetivos reales del DOM. */
.ob-cursor {
  position: fixed; left: 0; top: 0; z-index: 7; width: 26px; height: 26px; pointer-events: none;
  transform: translate(-200px, -200px); transition: transform .5s cubic-bezier(.45, .05, .25, 1);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45));
}
.ob-cursor[data-instante="si"], .ob-sala[data-pausa="si"] .ob-cursor { transition: none; }
.ob-cursor svg { width: 26px; height: 26px; fill: #fff; stroke: #121719; stroke-width: 1.4; stroke-linejoin: round; }
.ob-cursor-pulso { position: absolute; left: -8px; top: -8px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; opacity: 0; }
.ob-cursor[data-pulsa="si"] .ob-cursor-pulso { animation: ob-pulso .3s ease-out; }
@keyframes ob-pulso { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.7); } }
.ob-cab h2 { font: 600 1.25rem/1.1 var(--f-identidad); color: #fff; outline: none; }
.ob-cab h2 span { font: 500 .875rem/1.1 var(--f-interfaz); color: #a9b6b2; }
.ob-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 5px; font-size: .75rem; color: #c2ccc8; }
.ob-etq {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .24);
  font-weight: 600; font-size: .625rem; letter-spacing: .07em; text-transform: uppercase; color: #fff;
}
.ob-punto { width: 6px; height: 6px; border-radius: 50%; background: var(--ac-menta); }
.ob-fase {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; font-size: .8125rem;
}
.ob-fase-p { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ob-fase[data-fase="revisar"] { background: rgba(242, 193, 78, .16); color: var(--ac-ambar); }
.ob-cerrar, .ob-zoom-cerrar {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .07); color: #fff; font: 600 .8125rem/1.1 var(--f-interfaz);
}
.ob-cerrar:hover, .ob-zoom-cerrar:hover { background: rgba(255, 255, 255, .14); }
.ob-cerrar svg, .ob-zoom-cerrar svg { width: 14px; height: 14px; }
.ob-sala :focus-visible { outline: none; box-shadow: 0 0 0 2px #0b1013, 0 0 0 4px var(--ac-menta); }

/* v021 · Leyenda compacta de estados (icono + palabra; el color nunca va solo). */
.ob-leyenda { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0 0 0 auto; padding: 0; font: 500 .71875rem/1.2 var(--f-interfaz); color: #c9d3cf; }
.ob-leyenda li { display: inline-flex; align-items: center; gap: 5px; }
.ob-leyenda svg { width: 14px; height: 14px; fill: none; stroke: var(--ob-tono); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ob-leyenda + .ob-fase { margin-left: 0; }

/* Tonos de estado: trabajando neutro; verde solo al terminar; amarillo, revisión humana;
   rojo, problema detectado; azul, contramedida propuesta. */
.ob-sala [data-estado="trabajando"] { --ob-tono: rgba(255, 255, 255, .5); --ob-tinta: #fff; --ob-fondo: rgba(255, 255, 255, .12); }
.ob-sala [data-estado="terminado"], .ob-sala [data-estado="aprobado"] { --ob-tono: #3fd08f; --ob-tinta: #052b1b; --ob-fondo: #3fd08f; }
.ob-sala [data-estado="revision"] { --ob-tono: #f2c14e; --ob-tinta: #3a2a00; --ob-fondo: #f2c14e; }
.ob-sala [data-estado="problema"] { --ob-tono: #ff6b6b; --ob-tinta: #3d0909; --ob-fondo: #ff6b6b; }
.ob-sala [data-estado="contramedida"] { --ob-tono: #63afff; --ob-tinta: #04213f; --ob-fondo: #63afff; }

/* Composición progresiva: la primera pantalla llega sola y protagonista; al llegar otras se forma la
   sala hasta el 3×3 final (7–9). Solo se reservan las filas y columnas que ya tienen pantalla. */
.ob-rejilla {
  list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px 14px;
  justify-content: center; align-content: center;
}
.ob-rejilla[data-n="0"], .ob-rejilla[data-n="1"] { grid-template-columns: minmax(0, min(760px, 72%)); grid-template-rows: minmax(0, min(520px, 88%)); }
.ob-rejilla[data-n="2"] { grid-template-columns: repeat(2, minmax(0, min(600px, 49%))); grid-template-rows: minmax(0, min(440px, 72%)); }
.ob-rejilla[data-n="3"], .ob-rejilla[data-n="4"] { grid-template-columns: repeat(2, minmax(0, min(560px, 49%))); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.ob-rejilla[data-n="5"], .ob-rejilla[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.ob-celda { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ob-celda[data-llegada="nueva"] { animation: ob-llega .6s ease-out both; }
@keyframes ob-llega { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.ob-tv {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 5px 6px 6px;
  border-radius: 11px; background: #121719; border: 2px solid var(--ob-tono, rgba(255, 255, 255, .1));
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .9);
  transition: border-color .3s, background-color .3s;
}
/* Superficie del marco teñida con el tono (sutil); la pantalla blanca no cambia. */
.ob-celda:not([data-estado="trabajando"]) .ob-tv { background: linear-gradient(color-mix(in srgb, var(--ob-tono) 14%, #121719), #121719 60%); }
/* Pista de que se puede pulsar: solo un realce discreto, sin ampliar ni mostrar nada flotante. */
.ob-celda:hover .ob-tv { box-shadow: 0 0 0 2px rgba(255, 255, 255, .28), 0 14px 30px -18px rgba(0, 0, 0, .9); }
.ob-tv-cab { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 2px; font: 500 .6875rem/1.2 var(--f-interfaz); color: #a9b6b2; }
.ob-tv-t { font: 600 .875rem/1.1 var(--f-identidad); color: #fff; white-space: nowrap; }
.ob-tv-ag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-tv-est {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 999px;
  background: var(--ob-fondo, rgba(255, 255, 255, .12)); color: var(--ob-tinta, #fff); white-space: nowrap; font-weight: 700;
}
.ob-tv-est:empty { display: none; }
.ob-tv-est svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ob-pantalla {
  position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 6px;
  background: #fbfaf7; color: #22272a; container-type: size;
}
.ob-tv-boton { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: transparent; border-radius: 11px; cursor: pointer; }

/* Pasos bajo cada pantalla: icono + una o dos palabras. Activo en blanco y subrayado (neutro: el verde
   se reserva para lo terminado); hecho con marca ✓ y borde continuo; pendiente con borde discontinuo. */
.ob-pasos { list-style: none; margin: 0; padding: 0 2px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.ob-pasos li { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 0; color: rgba(255, 255, 255, .55); font: 500 .6875rem/1.15 var(--f-interfaz); }
.ob-pasos li + li::before { content: ""; flex: none; width: 10px; height: 1px; margin-right: 2px; background: rgba(255, 255, 255, .28); }
.ob-ico { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed rgba(255, 255, 255, .4); }
.ob-ico svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ob-paso-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-pasos li[data-paso="hecho"] { color: rgba(255, 255, 255, .86); }
.ob-pasos li[data-paso="hecho"] .ob-ico { border-style: solid; border-color: rgba(255, 255, 255, .55); }
.ob-pasos li[data-paso="hecho"] .ob-ico::after {
  content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; color: #121719; font: 700 8px/12px var(--f-interfaz); text-align: center;
}
.ob-pasos li[data-paso="activo"] { color: #fff; font-weight: 700; }
.ob-pasos li[data-paso="activo"] .ob-ico { border: 0; background: #fff; color: #121719; box-shadow: 0 0 0 3px rgba(255, 255, 255, .22); }
.ob-pasos li[data-paso="activo"] .ob-paso-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Panel ampliado (uno solo, solo al pulsar), centrado sobre la sala; marco con el tono de su estado. */
.ob-zoom {
  position: fixed; z-index: 6; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border-radius: 16px; background: #121719; border: 2px solid var(--ob-tono, rgba(255, 255, 255, .16));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85);
}
.ob-zoom[data-ancho="completo"] { left: 8px; right: 8px; top: 54px; bottom: calc(84px + env(safe-area-inset-bottom)); }
.ob-zoom-cab { display: flex; align-items: center; gap: 10px; min-width: 0; color: #a9b6b2; font: 500 .8125rem/1.2 var(--f-interfaz); }
.ob-zoom .ob-zoom-cab .ob-tv-t { font-size: 1.25rem; }
.ob-zoom .ob-tv-est { margin-left: 0; }
.ob-zoom-cerrar { margin-left: auto; }
.ob-zoom-desc { color: #c9d3cf; font-size: .875rem; line-height: 1.45; max-width: 72ch; }
.ob-pasos--zoom li { font-size: .8125rem; }
.ob-pasos--zoom .ob-ico { width: 28px; height: 28px; }
.ob-pasos--zoom .ob-ico svg { width: 16px; height: 16px; }

/* ── Contenido de las televisiones: tamaños en em, escala con la pantalla ── */
.tv {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .5em; overflow: hidden;
  padding: .8em .95em; color: #22272a;
  font: 500 clamp(6.5px, min(4.4cqh, 2.3cqw), 18px)/1.3 var(--f-interfaz);
}
.tv svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tv p { margin: 0; }
/* Lo que aún no ha aparecido tampoco existe para el lector de pantalla (visibility tras el fundido). */
.tv .o { opacity: 0; visibility: hidden; transition: opacity .35s ease, transform .45s ease, top .6s cubic-bezier(.3, .7, .2, 1), background-color .4s, border-color .4s, visibility 0s linear .35s; }
.tv .o[data-on="1"] { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.tv-rot { display: flex; align-items: center; gap: .4em; font-weight: 600; font-size: .95em; color: #5b6166; }
.tv-rot svg { width: 1.25em; height: 1.25em; }
.tv-cursor { display: inline-block; width: .12em; height: 1.05em; margin-left: .06em; vertical-align: -.15em; background: var(--ac-verde); animation: ob-parpadeo 1s steps(1) infinite; }
.tv .tv-cursor.o:not([data-on="1"]) { display: none; }
@keyframes ob-parpadeo { 50% { opacity: 0; } }
.ob-sala[data-pausa="si"] .tv-cursor, .ob-sala[data-pausa="si"] .ac-obs-ico::after { animation-play-state: paused; }

/* Entrada */
.te-docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em; }
.te-doc { position: relative; padding: .5em .6em .55em; border: 1px solid #dcdfda; border-radius: .45em; background: #fff; transform: translateY(-.6em); }
.te-doc[data-lectura="leyendo"] { border-color: var(--ac-menta); box-shadow: 0 0 0 .15em rgba(82, 226, 172, .3); }
.te-hoja { position: relative; display: block; height: 2.6em; margin-bottom: .35em; padding: .3em .35em; overflow: hidden; border-radius: .2em; background: #f2f3f0; }
.te-hoja i { display: block; height: .28em; margin-bottom: .3em; border-radius: .2em; background: #d6dad4; }
.te-hoja i:nth-child(2) { width: 82%; } .te-hoja i:nth-child(3) { width: 90%; } .te-hoja i:nth-child(4) { width: 55%; }
.te-scan { position: absolute; left: 0; right: 0; top: var(--y, 0%); height: .22em; background: var(--ac-menta); box-shadow: 0 0 .5em var(--ac-menta); opacity: 0; }
.te-doc[data-lectura="leyendo"] .te-scan { opacity: 1; }
.te-tipo { display: block; font-weight: 700; font-size: 1.05em; }
.te-ref, .te-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-ref { color: #5b6166; }
.te-meta { margin-top: .15em; font-weight: 600; color: var(--ac-verde); }
.te-sello { position: absolute; top: .45em; right: .45em; padding: .05em .45em; border-radius: 1em; background: #d8f5e9; color: #135441; font-weight: 700; font-size: .82em; opacity: 0; visibility: hidden; transition: opacity .3s; }
.te-doc[data-lectura="leido"] .te-sello { opacity: 1; visibility: visible; }
.te-enlaces { display: block; width: 100%; height: 2.6em; flex: none; overflow: visible; }
.te-enlaces path { stroke: var(--ac-verde); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.te-pie { display: flex; align-items: center; gap: .4em; font-weight: 600; color: var(--ac-verde); }
.te-pie svg { width: 1.2em; height: 1.2em; }

/* Expediente */
.tx-lista { position: relative; flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0; }
.tx-lista::before { content: ""; position: absolute; left: .82em; top: 10%; bottom: 10%; width: .14em; background: #cfe9de; }
.tx-item {
  position: absolute; left: 0; right: 0; top: calc(var(--slot) * 33.33%); height: 31%;
  display: grid; grid-template-columns: 1.8em minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: .6em; align-content: center;
  transition: top .6s cubic-bezier(.3, .7, .2, 1), opacity .35s;
}
.tx-n { grid-row: span 2; width: 1.75em; height: 1.75em; border-radius: 50%; display: grid; place-items: center; background: var(--ac-verde); color: #fff; font-weight: 700; font-size: .9em; z-index: 1; }
.tx-doc { font-weight: 700; }
.tx-hecho { grid-column: 2; color: #3b4044; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-marca { grid-column: 3; grid-row: 1 / span 2; align-self: center; padding: .2em .55em; border-radius: 1em; font-weight: 600; font-size: .88em; white-space: nowrap; }
.tx-marca b { margin-right: .3em; }
.tx-marca[data-tipo="ok"] { background: #d8f5e9; color: #135441; }
.tx-marca[data-tipo="pend"] { background: #fdf0cc; color: #6b4d0c; }

/* Extracción */
.tv-ext { flex-direction: row; gap: .9em; }
.tt-doc { flex: 0 0 40%; min-width: 0; display: flex; flex-direction: column; gap: .2em; padding: .5em .6em; overflow: hidden; border: 1px solid #dcdfda; border-radius: .45em; background: #fff; }
.tt-doc-t { font-weight: 700; font-size: .92em; color: #5b6166; }
.tt-l { display: flex; justify-content: space-between; gap: .6em; padding: .15em .3em; border: 1px solid transparent; border-radius: .25em; transition: background .25s, border-color .25s; }
.tt-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-l[data-det="foco"] { border-color: var(--ac-verde); background: #e3f7ee; }
.tt-l[data-det="si"] { background: #f0f7f3; }
.tt-tabla { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .18em; }
.tt-cab, .tt-fila { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1fr) 1.1em; gap: .5em; align-items: center; }
.tt-cab { padding-bottom: .2em; border-bottom: 1px solid #dcdfda; font-weight: 700; font-size: .85em; color: #5b6166; }
.tt-fila { padding: .22em 0; border-bottom: 1px solid #eceee9; transform: translateX(-.6em); }
.tt-fila span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-origen { color: var(--ac-verde); font-weight: 600; }
.tt-ok { color: var(--ac-verde); }
.tt-suma { margin-top: auto; padding: .3em .5em; border-radius: .35em; background: #e3f7ee; color: #135441; font-weight: 600; }

/* Cálculos */
.tc-fx { display: flex; align-items: center; gap: .5em; min-height: 1.9em; padding: .3em .5em; border: 1px solid #dcdfda; border-radius: .35em; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tc-fx code { font: inherit; }
.tc-fx-i { font-style: italic; font-weight: 700; color: var(--ac-verde); }
.tc-hoja { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .12em; }
.tc-fila { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto 8em; gap: .6em; align-items: center; padding: .14em .3em; border-bottom: 1px solid #eceee9; }
.tc-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #5b6166; }
.tc-c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-i { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tc-f { padding: .05em .4em; border-radius: .3em; background: #eef1ee; color: #3b4044; font-size: .85em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .25s, color .25s; }
.tc-fila[data-leyendo="si"] .tc-f { background: var(--ac-menta); color: #0b2a20; }
.tc-fila--pago .tc-i { color: var(--ac-burdeos); }
.tc-total, .tc-saldo { display: flex; align-items: baseline; justify-content: space-between; gap: .6em; padding: .25em .3em; }
.tc-total { border-top: 1px solid #cfd3cd; font-weight: 600; color: #3b4044; }
.tc-aviso { padding: .2em .5em; border-radius: .3em; background: #fdf0cc; color: #6b4d0c; font-weight: 600; }
.tc-saldo { margin-top: auto; border: .14em solid var(--ac-verde); border-radius: .4em; background: #e3f7ee; }
.tc-saldo b { font: 700 1.55em/1 var(--f-identidad); color: #135441; }
.tc-saldo em { font-style: normal; font-weight: 600; font-size: .85em; color: #135441; }

/* Normativa */
.tn-busca { display: flex; align-items: center; gap: .45em; min-height: 2em; padding: .4em .7em; border: 1px solid #cfd3cd; border-radius: 2em; background: #fff; }
.tn-busca svg { flex: none; width: 1.1em; height: 1.1em; color: #5b6166; }
.tn-res { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; }
.tn-art { position: relative; display: flex; flex-direction: column; gap: .15em; padding: .5em .6em; border: 1px solid #dcdfda; border-left: .25em solid var(--ac-verde); border-radius: .4em; background: #fff; transform: translateY(.5em); }
.tn-norma { font-size: .85em; color: #5b6166; }
.tn-art b { font: 600 1.15em/1.1 var(--f-identidad); }
.tn-resumen { display: none; font-size: .9em; color: #3b4044; }
@container (min-height: 260px) { .tn-resumen { display: block; } }
.tn-pin { display: inline-flex; align-items: center; gap: .25em; font-weight: 600; font-size: .85em; color: var(--ac-verde); }
.tn-pin svg { width: 1em; height: 1em; }
.tn-ficha { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em; margin-top: auto; padding: .4em .6em; border-radius: .4em; background: #f0f2ef; color: #3b4044; font-size: .9em; }
.tn-pend { padding: .05em .5em; border-radius: 1em; background: #fdf0cc; color: #6b4d0c; }

/* Contraste */
.tk-cab, .tk-fila { display: grid; grid-template-columns: minmax(0, 1fr) 2.4em minmax(0, 1.2fr) 7.4em; gap: .5em; align-items: center; }
.tk-cab { padding-bottom: .2em; border-bottom: 1px solid #dcdfda; font-weight: 700; font-size: .85em; color: #5b6166; }
.tk-fila { padding: .26em .2em; border-bottom: 1px solid #eceee9; border-radius: .3em; transition: background .3s, opacity .35s; }
.tk-h, .tk-f { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-h { font-weight: 600; }
.tk-lin { height: .14em; background: var(--ac-verde); transform-origin: left; transform: scaleX(var(--k, 0)); }
.tk-s { justify-self: start; display: inline-flex; align-items: center; gap: .3em; padding: .08em .5em; border-radius: 1em; font-weight: 700; font-size: .88em; white-space: nowrap; }
.tk-fila[data-tipo="ok"] .tk-s { background: #d8f5e9; color: #135441; }
.tk-fila[data-tipo="dif"] .tk-s { background: #f6dde2; color: var(--ac-burdeos); }
.tk-fila[data-tipo="pend"] .tk-s { background: #fdf0cc; color: #6b4d0c; }
.tk-fila[data-revisar="si"] { background: #fff8e8; }
.tk-resumen { margin-top: auto; padding: .3em .5em; border-radius: .35em; background: #f0f2ef; color: #3b4044; font-weight: 600; }
/* v021 · Incidente de versión. Miniatura: una franja con icono + palabra. Ampliación: dos documentos,
   explicación y aprobación. Colores claros sobre la pantalla blanca, siempre con texto e icono. */
.tk-alerta { display: flex; align-items: center; gap: .45em; padding: .3em .55em; border-radius: .35em; font-weight: 600; }
.tk-alerta-ico svg, .tk-aprobar svg, .tk-aprobado svg { width: 1.15em; height: 1.15em; flex: none; }
.tk-alerta-t { margin-left: auto; font-weight: 700; }
.tk-alerta[data-estado="problema"], .tk-comparacion[data-estado="problema"] .tk-comp-est { background: #fde3e3; color: #8a1c1c; }
.tk-alerta[data-estado="contramedida"], .tk-comparacion[data-estado="contramedida"] .tk-comp-est { background: #e0eeff; color: #0b3d73; }
.tk-alerta[data-estado="revision"], .tk-comparacion[data-estado="revision"] .tk-comp-est { background: #fdf0cc; color: #6b4d0c; }
.tk-alerta[data-estado="aprobado"], .tk-comparacion[data-estado="aprobado"] .tk-comp-est { background: #d8f5e9; color: #135441; }
.tk-comparacion { display: none; }
.ob-pantalla--zoom .tv-con { overflow-y: auto; font-size: clamp(12px, min(3.1cqh, 1.7cqw), 15px); }
.ob-pantalla--zoom .tk-alerta { display: none; }
.ob-pantalla--zoom .tk-comparacion:not([data-estado="sin"]) { display: flex; flex-direction: column; gap: .6em; flex: none; padding-bottom: .6em; border-bottom: 1px solid #dcdfda; }
.tk-comp-cab { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .8em; }
.tk-comp-est { padding: .1em .6em; border-radius: 1em; font-weight: 700; }
.tk-docs { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.tk-doc { padding: .6em .75em; border: 1px solid #dcdfda; border-radius: .45em; background: #fff; }
.tk-doc-et { display: flex; flex-direction: column; gap: .1em; margin-bottom: .3em; }
.tk-doc-et span { font-size: .85em; color: #5b6166; }
.tk-cl { margin: .35em 0; color: #3b4044; }
.tk-cl--dif { padding: .3em .45em; border-left: .25em solid #c9cec7; border-radius: .25em; background: #f6f7f5; color: #22272a; }
.tk-doc--antes .tk-cl--dif { border-left-color: #e5484d; background: #fff1f1; }
.tk-doc--ref .tk-cl--dif { border-left-color: #2f7fd8; background: #eef5ff; }
.tk-comparacion[data-estado="aprobado"] .tk-doc--ref .tk-cl--dif { border-left-color: #1E6B55; background: #ecf9f3; }
.tk-cl del { text-decoration: line-through; text-decoration-thickness: .12em; background: #fbd5d5; color: #6d1414; }
.tk-cl ins { text-decoration: underline; text-decoration-thickness: .12em; text-underline-offset: .15em; background: #d6e8ff; color: #0b3d73; }
.tk-expl { display: grid; gap: .35em; margin: 0; }
.tk-expl div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: .6em; }
.tk-expl dt { font-weight: 700; color: #22272a; }
.tk-expl dd { margin: 0; color: #3b4044; }
.tk-expl-prop[data-on="0"] { display: none !important; }
.tk-accion { display: flex; flex-wrap: wrap; align-items: center; gap: .5em .9em; }
.tk-aprobar {
  display: inline-flex; align-items: center; gap: .45em; min-height: 2.6em; padding: 0 1em; border: 0; border-radius: .5em;
  background: #1E6B55; color: #fff; font: 700 1em/1 var(--f-interfaz); cursor: pointer;
}
.tk-aprobar:hover:not(:disabled) { background: #185A47; }
.tk-aprobar:disabled { background: #d9ddd7; color: #5b6166; cursor: not-allowed; }
.tk-aprobar svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
.tk-aprobar-ayuda { flex: 1 1 14em; font-size: .9em; color: #5b6166; }
.tk-aprobar-ayuda:empty { display: none; }
.tk-aprobado { display: flex; align-items: flex-start; gap: .45em; padding: .45em .6em; border-radius: .4em; background: #d8f5e9; color: #135441; font-weight: 600; outline: none; }
.tk-aprobado svg { fill: none; stroke: currentColor; stroke-width: 2.2; }
.tk-nota { font-size: .85em; font-style: italic; color: #5b6166; }

/* Borrador: una hoja que se escribe en directo */
.tv-bor { padding: .7em 1.6em 0; background: #e9ece7; }
.tb-hoja { position: relative; flex: none; min-height: calc(100% - .7em); padding: 1em 1.4em 1.2em; background: #fff; box-shadow: 0 .2em .8em rgba(0, 0, 0, .12); opacity: 0; transform: translateY(var(--y, 0px)); transition: transform .5s ease, opacity .35s; }
.tb-hoja[data-on="1"] { opacity: 1; }
.tb-tit { font: 600 1.25em/1.15 var(--f-identidad); }
.tb-ver { margin-bottom: .5em; font-size: .85em; color: #5b6166; }
.tb-sec { margin: 0 0 .45em -.4em; padding: .15em .4em; border-left: .18em solid transparent; border-radius: .2em; transition: background .4s, border-color .4s, opacity .35s; }
.tb-sec[data-activa="si"] { background: #ecfaf4; border-left-color: var(--ac-menta); }
.tb-h { font-weight: 700; font-size: .95em; color: var(--ac-verde); }
.tb-p { color: #2f3437; }
.tv .tb-cursor { display: none; }
.tv .tb-sec[data-activa="si"] .tb-cursor { display: inline-block; }
.tb-marcado { display: none; }
.tb-hoja[data-marcado="si"] .tb-plano { display: none; }
.tb-hoja[data-marcado="si"] .tb-marcado { display: inline; }
.tb-marcado mark { padding: 0 .1em; border-radius: .15em; background: transparent; color: inherit; transition: background .3s, box-shadow .3s; }
.tb-marcado mark[data-on="1"] { background: #fbe7a6; box-shadow: inset 0 -.12em 0 var(--ac-ambar); }
.tb-nota { margin-top: .4em; font-size: .82em; font-style: italic; color: #5b6166; }

/* Revisión: tres capas sobre el mismo borrador */
.tv-rev { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: .6em .8em; background: #e9ece7; }
.tr-hoja { flex: 1 1 58%; min-width: 0; max-height: calc(100% - 2.6em); overflow: hidden; padding: .7em .9em; background: #fff; box-shadow: 0 .2em .8em rgba(0, 0, 0, .12); font-size: .86em; }
.tr-tit { margin-bottom: .35em; font: 600 1.15em/1.15 var(--f-identidad); }
.tr-sec { position: relative; margin-bottom: .35em; padding: .15em .35em; overflow: hidden; border-left: .2em solid transparent; border-radius: .2em; color: #3b4044; transition: background .35s, border-color .35s; }
.tr-sec b { color: #22272a; }
.tr-sec[data-capa="documentos"], .tr-capas li[data-capa="documentos"] { --capa: #7EC8E3; --capa-f: #e8f5fb; }
.tr-sec[data-capa="cifras"], .tr-capas li[data-capa="cifras"] { --capa: #52E2AC; --capa-f: #e6f9f1; }
.tr-sec[data-capa="fuentes"], .tr-capas li[data-capa="fuentes"] { --capa: #f2c14e; --capa-f: #fdf3da; }
.tr-sec[data-estado="revisando"], .tr-sec[data-estado="revisada"] { border-left-color: var(--capa); background: var(--capa-f); }
.tr-barrido { position: absolute; left: 0; right: 0; top: calc(var(--barrido, 0) * 100%); height: .2em; background: var(--capa); opacity: 0; }
.tr-sec[data-estado="revisando"] .tr-barrido { opacity: .9; }
.tr-capas { flex: 1 1 32%; min-width: 9em; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4em; }
.tr-capas li { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); column-gap: .45em; padding: .35em .5em; border: 1px dashed #c9cec7; border-radius: .4em; background: #fff; color: #6f767a; transition: border-color .3s, box-shadow .3s; }
.tr-capas li svg { grid-row: span 2; width: 1.5em; height: 1.5em; }
.tr-capas li span { font-size: .85em; }
.tr-capas li[data-estado="no"] span { visibility: hidden; }
.tr-capas li[data-estado="revisando"] { border: 1px solid var(--capa); color: #22272a; box-shadow: 0 0 0 .18em var(--capa-f); }
.tr-capas li[data-estado="revisada"] { border: 1px solid var(--capa); color: #22272a; }
.tr-queda { flex: 1 1 100%; padding: .3em .6em; border-radius: .35em; background: #fdf0cc; color: #6b4d0c; font-weight: 600; }

/* Entrega */
.tv-ent { flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: .6em 1em; }
.tg-piezas { flex: 1 1 52%; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25em; }
.tg-piezas li { display: flex; align-items: center; gap: .4em; padding: .22em .5em; border: 1px solid #dcdfda; border-radius: .35em; background: #fff; opacity: 0; transform: translateX(-.6em); transition: opacity .35s, transform .5s, background .3s, border-color .3s; }
.tg-piezas li svg { flex: none; width: 1.1em; height: 1.1em; color: var(--ac-verde); }
.tg-piezas li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-piezas li[data-estado="no"] { visibility: hidden; }
.tg-piezas li[data-estado="fuera"] { opacity: .5; transform: none; }
.tg-piezas li[data-estado="dentro"] { opacity: 1; transform: translateX(.6em); border-color: var(--ac-menta); background: #e6f9f1; }
.tg-carpeta { position: relative; flex: 1 1 32%; min-width: 8em; min-height: 6em; display: flex; flex-direction: column; justify-content: flex-end; gap: .2em; padding: 1.6em .8em .7em; border: 1px solid #ddcb9e; border-radius: .2em .6em .6em .6em; background: #f2e6c9; }
.tg-tapa { position: absolute; left: -1px; right: -1px; top: -1px; height: 1.2em; border-radius: .2em .6em 0 0; background: #e6d3a6; transform-origin: bottom; transform: perspective(20em) rotateX(55deg); transition: transform .5s; }
.tg-carpeta[data-cerrada="si"] .tg-tapa { transform: none; }
.tg-et { font-weight: 700; color: #22272a; }
.tg-n { font-size: .88em; color: #5b6166; }
.tg-sello { flex: 1 1 100%; display: flex; align-items: center; gap: .45em; padding: .35em .7em; border: .16em solid var(--ac-verde); border-radius: .45em; color: #135441; font: 700 1.1em/1.1 var(--f-identidad); transform: scale(1.12); }
.tg-sello svg { width: 1.3em; height: 1.3em; }
.tg-nota { flex: 1 1 100%; font-size: .88em; color: #5b6166; }

/* ── Escritorio bajo: menos cabecera para que la rejilla respire ──── */
@media (max-height: 760px) and (min-width: 721px) {
  .ob-sala { padding-top: 58px; gap: 8px; }
  .ob-cab h2 { font-size: 1.125rem; }
  .ob-sub { margin-top: 3px; }
  .ob-rejilla { gap: 8px 12px; }
  .ob-pasos li { font-size: .65625rem; }
  .ob-ico { width: 20px; height: 20px; }
}

/* ── Móvil: ciudad central, actividad compacta; sala con rejilla de dos columnas y desplazamiento interno ── */
@media (max-width: 720px) {
  .modo-mesa .relato { padding: 0 10px; }
  .ac-ciudad { min-height: 560px; }
  .ac-titular { top: 56px; align-items: flex-start; text-align: left; }
  .ac-titular h1 { font-size: clamp(1.35rem, 6.4vw, 1.7rem); }
  .ac-etiqueta { font-size: .5625rem; }
  .ac-obs { font-size: .8125rem; padding: 5px 13px 5px 5px; }
  .ac-obs-ico { width: 28px; height: 28px; }
  .ac-actividad { bottom: calc(84px + env(safe-area-inset-bottom)); width: 100%; padding: 6px 10px 6px; }
  .ac-act-s { display: none; }
  .ac-filas { grid-template-columns: 1fr; }
  .ac-fila { grid-template-columns: 9px auto minmax(0, 1fr) auto; grid-template-areas: "punto nombre tarea estado"; gap: 0 7px; padding: 3px 0 4px; }
  .ac-tarea { font-size: .71875rem; }
  .ab-pin { font-size: .6875rem; padding: 3px 8px 3px 6px; }
  /* v003 · El acceso al Observatorio cuelga bajo su isla, en la franja de cielo que reserva el encuadre
     móvil (abogados3d.js): no tapa calles ni agentes y el trazo sube hasta el edificio. */
  .ac-obs[data-anclado] { transform: translate(var(--x), var(--y)) translate(-50%, 14px); }
  .ac-obs[data-anclado]::after { top: auto; bottom: 100%; background: linear-gradient(rgba(30, 107, 85, 0), var(--ac-verde)); }
  .ab-chip-robot { padding: 2px 7px 2px 4px; }

  .ob-sala { padding: 54px 10px max(10px, env(safe-area-inset-bottom)); gap: 8px; }
  .ob-cab { gap: 6px 10px; }
  .ob-cab h2 span, .ob-caso { display: none; }
  .ob-leyenda { order: 5; flex-basis: 100%; margin: 0; gap: 3px 10px; font-size: .65625rem; }
  .ob-fase { margin-left: 0; font-size: .75rem; padding: 4px 10px; }
  .ob-cerrar { margin-left: auto; padding: 6px 12px; }
  /* La sala crece hacia abajo con desplazamiento interno; llegar una pantalla no mueve el scroll. */
  .ob-rejilla, .ob-rejilla[data-n] {
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; gap: 10px;
    justify-content: stretch; align-content: start;
    overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; padding-bottom: 6px;
  }
  .ob-rejilla[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
  /* v022 · Móvil: la lista de tareas queda fija arriba como carril horizontal compacto; debajo, el
     detalle y las pantallas con desplazamiento propio (las fichas nuevas no mueven el scroll). */
  .ob-cuerpo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  
  .ob-tareas { margin-bottom: 0; padding: 8px; gap: 6px; }
  .ob-tareas-cab { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .ob-tareas-t { font-size: .875rem; }
  .ob-orden { flex: 1 1 160px; }
  .ob-lote { flex: 1 1 100%; }
  .ob-dice { flex: 1 1 100%; }
  .ob-tareas-lista { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 10px; padding-bottom: 2px; overflow-anchor: none; }
  .ob-grupo { flex: none; }
  .ob-grupo-l { flex-direction: row; gap: 6px; }
  .ob-ficha { width: 150px; }
  .ob-tareas-nota { flex: none; align-self: center; max-width: 120px; }
  .ob-contenido { flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; }
  .ob-detalle { flex: none; width: 100%; max-height: none; overflow: visible; }
  .ob-escena { flex: none; min-height: 200px; }
  .ob-escena .ob-rejilla, .ob-escena .ob-rejilla[data-n] { overflow: visible; }
  .ob-bienvenida { position: relative; inset: auto; width: 100%; padding: 24px 8px; }
  .ob-bienvenida[hidden] { display: none; }
  .ob-celda:last-child { grid-column: 1 / -1; }
  .ob-tv { flex: none; }
  .ob-pantalla { flex: none; aspect-ratio: 4 / 3; }
  .ob-celda:last-child .ob-pantalla { aspect-ratio: 2.2 / 1; }
  .ob-tv-ag { display: none; }
  .ob-pasos { align-items: flex-start; }
  .ob-pasos li { flex-direction: column; gap: 2px; text-align: center; font-size: .5625rem; }
  .ob-pasos li + li::before { display: none; }
  .ob-paso-t { white-space: normal; }
  .ob-ico { width: 20px; height: 20px; }
  .ob-zoom { padding: 10px; }
  .ob-zoom-cab { flex-wrap: wrap; }
  /* v021 r2: en móvil la comparación del incidente se apila siempre (también antes de que el visor
     reciba data-ancho), con la explicación en una columna. */
  .ob-pantalla--zoom .tk-docs { grid-template-columns: minmax(0, 1fr); }
  .ob-pantalla--zoom .tk-expl div { grid-template-columns: minmax(0, 1fr); gap: .1em; }
  .ob-zoom .ob-zoom-cab .ob-tv-t { font-size: 1.0625rem; }
  .ob-zoom-cerrar span { font-size: .75rem; }
  .ob-zoom-desc { font-size: .8125rem; }
  .ob-pasos--zoom li { flex-direction: row; text-align: left; font-size: .75rem; }
}

/* v002 · Ampliación a pantalla completa (móvil): el artefacto ocupa la altura libre y se LEE.
   Texto de trabajo ~12–13 px, campos que envuelven y layouts en columna; el contenido se desplaza
   dentro de la pantalla si no cabe (salvo el borrador, que sigue al apartado que se escribe). */
.ob-zoom[data-ancho="completo"] { gap: 6px; }
.ob-zoom[data-ancho="completo"] .ob-pantalla--zoom { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.ob-zoom[data-ancho="completo"] .ob-zoom-desc { font-size: .75rem; line-height: 1.35; }
.ob-zoom[data-ancho="completo"] .tv {
  font-size: clamp(12px, 3.5cqw, 14px); line-height: 1.38; padding: .8em .85em; gap: .65em;
  overflow-y: auto; overscroll-behavior: contain;
}
.ob-zoom[data-ancho="completo"] .tv-rot { font-size: .9em; }
/* Entrada: documentos apilados con su miniatura; los enlaces se leen en el pie. */
.ob-zoom[data-ancho="completo"] .te-docs { grid-template-columns: 1fr; gap: .55em; }
.ob-zoom[data-ancho="completo"] .te-doc { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: .7em; transform: none; }
.ob-zoom[data-ancho="completo"] .te-hoja { grid-row: 1 / span 3; height: auto; margin: 0; }
.ob-zoom[data-ancho="completo"] .te-ref, .ob-zoom[data-ancho="completo"] .te-meta { white-space: normal; }
.ob-zoom[data-ancho="completo"] .te-enlaces { display: none; }
.ob-zoom[data-ancho="completo"] .te-pie { align-items: flex-start; }
/* Expediente: hecho y marca en líneas propias. */
.ob-zoom[data-ancho="completo"] .tx-lista { min-height: 18em; }
.ob-zoom[data-ancho="completo"] .tx-item { grid-template-columns: 1.8em minmax(0, 1fr); grid-template-rows: auto auto auto; row-gap: .2em; }
.ob-zoom[data-ancho="completo"] .tx-n { grid-row: 1 / span 3; align-self: start; }
.ob-zoom[data-ancho="completo"] .tx-hecho { white-space: normal; }
.ob-zoom[data-ancho="completo"] .tx-marca { grid-column: 2; grid-row: 3; justify-self: start; white-space: normal; }
/* Extracción: documento arriba, tabla debajo; las celdas envuelven. */
.ob-zoom[data-ancho="completo"] .tv-ext { flex-direction: column; }
.ob-zoom[data-ancho="completo"] .tt-doc { flex: none; }
.ob-zoom[data-ancho="completo"] .tt-fila span, .ob-zoom[data-ancho="completo"] .tt-l span { white-space: normal; }
.ob-zoom[data-ancho="completo"] .tt-cab, .ob-zoom[data-ancho="completo"] .tt-fila { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) 1em; }
.ob-zoom[data-ancho="completo"] .tt-suma { margin-top: .2em; }
/* Cálculos: la fuente pasa bajo el concepto. */
.ob-zoom[data-ancho="completo"] .tc-fila { grid-template-columns: 1.8em minmax(0, 1fr) auto; grid-template-areas: "ref c i" ". f f"; row-gap: .15em; }
.ob-zoom[data-ancho="completo"] .tc-ref { grid-area: ref; }
.ob-zoom[data-ancho="completo"] .tc-c { grid-area: c; white-space: normal; }
.ob-zoom[data-ancho="completo"] .tc-i { grid-area: i; }
.ob-zoom[data-ancho="completo"] .tc-f { grid-area: f; justify-self: start; }
.ob-zoom[data-ancho="completo"] .tc-saldo { flex-wrap: wrap; margin-top: .3em; }
/* Normativa: un artículo debajo de otro, con su resumen. */
.ob-zoom[data-ancho="completo"] .tn-res { grid-template-columns: 1fr; }
.ob-zoom[data-ancho="completo"] .tn-resumen { display: block; }
.ob-zoom[data-ancho="completo"] .tn-ficha { margin-top: 0; }
/* v021 · Incidente en móvil: los dos documentos apilados y la explicación en una columna. */
.ob-zoom[data-ancho="completo"] .tv-con { font-size: clamp(12px, 3.5cqw, 14px); }
.ob-zoom[data-ancho="completo"] .tk-docs { grid-template-columns: 1fr; }
.ob-zoom[data-ancho="completo"] .tk-expl div { grid-template-columns: 1fr; gap: .1em; }
/* Contraste: hecho y señal arriba, documento o fuente debajo. */
.ob-zoom[data-ancho="completo"] .tk-cab { display: none; }
.ob-zoom[data-ancho="completo"] .tk-fila { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h s" "f f"; row-gap: .1em; padding: .4em .3em; }
.ob-zoom[data-ancho="completo"] .tk-h { grid-area: h; white-space: normal; }
.ob-zoom[data-ancho="completo"] .tk-s { grid-area: s; }
.ob-zoom[data-ancho="completo"] .tk-f { grid-area: f; white-space: normal; color: #5b6166; }
.ob-zoom[data-ancho="completo"] .tk-lin { display: none; }
/* Borrador: hoja casi a sangre para ganar ancho de lectura. */
.ob-zoom[data-ancho="completo"] .tv-bor { overflow: hidden; padding: .5em .5em 0; }
.ob-zoom[data-ancho="completo"] .tb-hoja { padding: .8em .9em 1em; }
/* Revisión: hoja, capas y lo que queda, en columna. */
.ob-zoom[data-ancho="completo"] .tv-rev { flex-direction: column; flex-wrap: nowrap; }
.ob-zoom[data-ancho="completo"] .tr-hoja { flex: none; max-height: none; font-size: .92em; }
.ob-zoom[data-ancho="completo"] .tr-capas { flex: none; min-width: 0; }
.ob-zoom[data-ancho="completo"] .tr-queda { flex: none; }
/* Entrega: piezas, carpeta y sello en columna. */
.ob-zoom[data-ancho="completo"] .tv-ent { flex-direction: column; flex-wrap: nowrap; }
.ob-zoom[data-ancho="completo"] .tg-piezas, .ob-zoom[data-ancho="completo"] .tg-carpeta, .ob-zoom[data-ancho="completo"] .tg-sello, .ob-zoom[data-ancho="completo"] .tg-nota { flex: none; }
.ob-zoom[data-ancho="completo"] .tg-piezas li span { white-space: normal; }
.ob-zoom[data-ancho="completo"] .tg-carpeta { min-height: 4.5em; }

@media (prefers-reduced-motion: reduce) {
  .ac-fila[data-estado="trabajando"] .ac-robot, .ac-obs-ico::after, .ac-plan-ico::after, .tv-cursor, .ob-celda[data-llegada="nueva"], .ob-cursor-pulso { animation: none !important; }
  .ac-barra span, .ob-tv, .tv .o, .tv *, .tb-hoja, .ob-cursor, .ob-det-lineas li { transition: none !important; }
}

/* En la ciudad, la reserva va bajo el contexto. En el Observatorio ocupa la cabecera superior. */
.ac-reserva {display:flex;align-items:center;margin-top:3px;}
.modo-mesa .ac-reserva .rail,.modo-mesa.observatorio-abierto .cab > .rail {
 position:relative;inset:auto;transform:none;z-index:1;width:auto;min-width:0;min-height:44px;height:auto;
 padding:11px 22px;border-radius:12px;font-size:.9375rem;line-height:1.2;
 box-shadow:0 8px 24px -12px rgba(14,58,45,.45);
}
.modo-mesa.observatorio-abierto .cab > .rail {
  min-height:52px;
  padding:12px 28px;
  background:var(--freedom-green);
  color:var(--graphite);
  font-size:1.0625rem;
  box-shadow:0 5px 18px rgba(0,0,0,.24);
}
.modo-mesa.observatorio-abierto .cab > .rail:hover {
  background:var(--mint-glow);
}
.modo-mesa.observatorio-abierto .cab {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  right:12px;
  max-width:none;
  pointer-events:none;
}
.modo-mesa.observatorio-abierto .cab > * {pointer-events:auto;}
.modo-mesa.observatorio-abierto .cab > .sector {justify-self:start;}
.ob-cab-t {min-width:0;}
@media(max-width:720px){
 .ac-reserva {margin-top:2px;}
 .modo-mesa .ac-reserva .rail {min-height:44px;padding:10px 18px;font-size:.875rem;}
 .modo-mesa.observatorio-abierto .cab {
   right:10px;
   grid-template-columns:minmax(0,1fr) auto;
   gap:5px 8px;
 }
 .modo-mesa.observatorio-abierto .cab > .marca {
   grid-area:1 / 1;
   justify-self:start;
   max-width:100%;
   flex-wrap:wrap;
   row-gap:3px;
 }
 .modo-mesa.observatorio-abierto .cab > .sector {grid-area:2 / 1 / 3 / 3;}
 .modo-mesa.observatorio-abierto .cab > .rail {
   grid-area:1 / 2;
   min-height:44px;
   padding:10px 12px;
   font-size:.875rem;
 }
}

.modo-mesa .ob-sala {padding-top:var(--ac-cab-bajo,62px);}
