
/* ===== VISOR RX · DISEÑO V2 (fondo recordado, comparación 2×2, panel Evolución) ===== */
#rxLightboxModal { --rx-canvas: #000; }
.rx-lightbox-window { position: relative; }
.rx-lightbox-viewport { background: var(--rx-canvas, #000) !important; transition: background .25s; }
.rx-body { display: contents; }
.rx-evo { display: none; }
.rx-hud { position: absolute; left: 14px; bottom: 14px; z-index: 60; display: flex; gap: 8px; align-items: center; }
.rx-hud-btn { height: 40px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; background: rgba(34,34,38,.82); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.14); color: #f5f5f7; cursor: pointer; white-space: nowrap; }
.rx-hud-btn:hover { background: rgba(70,70,76,.9); }
.rx-hud-btn.on { background: #0a84ff; border-color: #0a84ff; }
.rx-hud-btn.hidden { display: none; }
.rx-lightbox-hint { white-space: nowrap; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
.rx-bg-pop { position: absolute; left: 14px; bottom: 62px; width: 240px; z-index: 61; display: none; padding: 8px; border-radius: 16px; background: rgba(34,34,38,.94); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.rx-bg-pop.open { display: block; }
.rx-bg-pop h6 { margin: 0; padding: 6px 10px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #a1a1a6; font-weight: 700; }
.rx-bg-pop p { margin: 0; padding: 6px 10px 4px; font-size: .72rem; line-height: 1.35; color: #a1a1a6; }
.rx-bg-opt { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 12px 0 8px; border-radius: 10px; background: transparent; border: 0; color: #f5f5f7; font-size: .82rem; font-weight: 600; cursor: pointer; text-align: left; }
.rx-bg-opt:hover { background: rgba(255,255,255,.08); }
.rx-bg-opt.on { background: rgba(10,132,255,.22); }
.rx-bg-opt i { width: 26px; height: 26px; border-radius: 13px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, 0 0 0 1px rgba(0,0,0,.4); }
/* Cuadrícula de comparación (1, 2 o 2×2) */
.rx-split-viewport.rx-cmp { display: grid; gap: 2px; background: rgba(128,128,128,.35); }
.rx-split-viewport.rx-cmp.hidden { display: none !important; }
.rxc-pane { position: relative; overflow: hidden; background: var(--rx-canvas, #000); transition: background .25s; cursor: grab; }
.rxc-pane.drag { cursor: grabbing; }
.rxc-tf { position: absolute; inset: 0; display: grid; place-items: center; transform-origin: center center; }
.rxc-tf img { max-width: calc(100% - 28px); max-height: calc(100% - 28px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; border-radius: 2px; }
.rx-cmp.inv .rxc-tf img { filter: invert(100%) contrast(115%); }
.rxc-pane.act::after { content: ""; position: absolute; inset: 0; box-shadow: 0 0 0 2px #0a84ff inset; pointer-events: none; z-index: 2; }
.rxc-lab { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 36px; max-width: calc(100% - 24px); padding: 4px 6px 4px 12px; border-radius: 18px; font-size: .8rem; font-weight: 600; color: #f5f5f7; background: rgba(34,34,38,.82); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.14); line-height: 1.2; }
.rxc-lab .d { width: 8px; height: 8px; border-radius: 4px; background: #0a84ff; flex: none; }
.rxc-lab.or .d { background: #ff9f0a; }
.rxc-lab button { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 0; color: inherit; cursor: pointer; padding: 0; flex: none; }
.rxc-tools { position: absolute; left: 12px; top: 56px; z-index: 3; display: flex; gap: 2px; padding: 3px; border-radius: 20px; background: rgba(34,34,38,.82); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.14); }
.rxc-tools button { width: 38px; height: 38px; border-radius: 19px; display: grid; place-items: center; background: transparent; border: 0; color: #f5f5f7; cursor: pointer; padding: 0; }
.rxc-tools button:hover { background: rgba(255,255,255,.12); }
.rxc-vacio { display: grid; place-items: center; background: var(--rx-canvas, #000); color: #a1a1a6; font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.5; }
.rxc-vacio span { border: 1.5px dashed rgba(128,128,128,.55); border-radius: 16px; padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Panel Evolución */
.rx-evo.show { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px; background: #111114; color: #f5f5f7; }
.rxe-h b { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.rxe-h span { display: block; margin-top: 2px; font-size: .78rem; color: #a1a1a6; line-height: 1.35; }
.rxe-q { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: rgba(255,255,255,.08); }
.rxe-q button { height: 40px; border-radius: 10px; border: 0; background: transparent; color: #d1d1d6; font-size: .78rem; font-weight: 600; line-height: 1.1; cursor: pointer; padding: 0 4px; }
.rxe-q button:hover { background: rgba(255,255,255,.1); }
.rxe-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.rxe-row { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 6px 12px 6px 6px; border-radius: 14px; background: rgba(255,255,255,.07); border: 0; box-shadow: 0 0 0 1.5px transparent inset; color: inherit; text-align: left; width: 100%; cursor: pointer; flex: none; }
.rxe-row:hover { background: rgba(255,255,255,.12); }
.rxe-row:disabled { cursor: default; }
.rxe-row.base { background: rgba(10,132,255,.14); box-shadow: 0 0 0 1.5px #0a84ff inset; }
.rxe-row.cmp { background: rgba(255,159,10,.1); box-shadow: 0 0 0 1.5px #ff9f0a inset; }
.rxe-th { width: 54px; height: 58px; border-radius: 9px; overflow: hidden; background: #000; flex: none; }
.rxe-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rxe-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: .78rem; color: #a1a1a6; line-height: 1.25; }
.rxe-t b { font-size: .85rem; color: #f5f5f7; overflow-wrap: anywhere; }
.rxe-badge { height: 28px; padding: 0 10px; border-radius: 14px; background: #0a84ff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; flex: none; }
.rxe-tg { width: 46px; height: 28px; border-radius: 14px; background: #48484a; position: relative; flex: none; transition: .2s; }
.rxe-tg::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.rxe-row.cmp .rxe-tg { background: #ff9f0a; }
.rxe-row.cmp .rxe-tg::after { left: 21px; }
.rxe-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; flex: none; }
.rxe-foot button { height: 42px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #f5f5f7; font-size: .82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.rxe-foot button:hover { background: rgba(255,255,255,.14); }
.rxe-foot .sy.on .rxe-tg { background: #30d158; }
.rxe-foot .sy.on .rxe-tg::after { left: 21px; }
/* Celular: el panel aparece sobre la imagen solo mientras se compara */
@media (max-width: 900px) {
  .rx-evo.show { position: absolute; right: 8px; bottom: 8px; width: min(320px, calc(100% - 16px)); max-height: 58%; border-radius: 18px; z-index: 70; box-shadow: 0 16px 50px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.14); }
  .rxe-h span { display: none; }
  .rx-hud { bottom: 58px; }
}
/* Escritorio: riel de herramientas a la izquierda, panel a la derecha, botones gruesos */
@media (min-width: 901px) {
  .rx-body { display: flex; flex: 1; min-height: 0; }
  .rx-body > .rx-lightbox-viewport { flex: 1; min-width: 0; }
  .rx-evo.show { width: 340px; flex: none; border-left: 1px solid rgba(255,255,255,.1); }
  /* Pantalla completa: la ventana ocupa todo el espacio */
  #rxLightboxModal { padding: 0 !important; background: #111114 !important; }
  .rx-lightbox-window { background: #111114; border-radius: 0; border: 0; width: calc(100vw / var(--zv, 0.75)) !important; height: calc(100vh / var(--zv, 0.75)) !important; max-width: none; box-shadow: none; }
  #rxLightboxModal { width: calc(100vw / var(--zv, 0.75)); height: calc(100vh / var(--zv, 0.75)); }
  .rx-lightbox-topbar { height: 76px; background: #111114; padding: 0 14px 0 20px; align-items: center; }
  .rx-lightbox-topbar .rx-lightbox-controls { align-items: center; height: 100%; overflow-y: hidden; }
  .rx-lightbox-topbar .rx-grp { align-items: center; }
  .rx-lightbox-topbar .rx-ctrl-btn { height: 52px; min-width: 52px; border-radius: 14px; font-size: .9rem; padding: 0 16px; }
  .rx-lightbox-topbar .rx-lightbox-title { font-size: 1rem; }
  #rxAnnotBar { width: 124px; height: auto !important; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px !important; padding: 10px 0 !important; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.1); overflow: visible !important; background: #111114; }
  #rxAnnotBar .rx-annot-label { display: none !important; }
  #rxAnnotBar .rx-grp { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 !important; padding: 0 !important; border: 0 !important; }
  html body #rxLightboxModal #rxAnnotBar .rx-annot-tool { flex-direction: column !important; justify-content: center !important; gap: 3px !important; width: 100px !important; height: 62px !important; padding: 0 !important; font-size: .76rem !important; line-height: 1.1 !important; border-radius: 12px !important; border-color: transparent !important; background: transparent !important; }
  html body #rxLightboxModal #rxAnnotBar .rx-annot-tool:hover { background: rgba(255,255,255,.1) !important; }
  html body #rxLightboxModal #rxAnnotBar .rx-annot-tool.active { background: #0a84ff !important; color: #fff !important; }
  html body #rxLightboxModal #rxAnnotBar .rx-annot-tool.rx-annot-save { background: rgba(48,209,88,.16) !important; color: #6ee7b7 !important; margin-top: 2px; }
  #rxAnnotBar .rx-annot-colors { display: grid !important; grid-template-columns: repeat(3, 26px); gap: 10px; height: auto; padding: 6px 0; justify-content: center; }
  #rxAnnotBar .rx-annot-colors { align-items: center; justify-items: center; }
  #rxAnnotBar .rx-annot-colors .rx-annot-color { width: 26px !important; height: 26px !important; min-width: 26px !important; min-height: 26px !important; max-width: 26px !important; max-height: 26px !important; flex: none !important; aspect-ratio: 1 / 1; border-radius: 50% !important; align-self: center; }
  #rxAnnotBar .rx-annot-select { width: 100px !important; max-width: 100px !important; flex: none !important; height: 44px !important; border-radius: 10px; }
  #rxAnnotBar .rx-annot-status { margin: auto 0 4px !important; padding: 0 !important; height: auto !important; line-height: 1.2 !important; font-size: .68rem; text-align: center; white-space: normal; }
}

.rxe-vacio { padding: 18px 14px; border-radius: 14px; border: 1.5px dashed rgba(255,255,255,.18); font-size: .82rem; line-height: 1.45; color: #a1a1a6; text-align: center; }
.rxe-h b { display: flex; align-items: center; gap: 8px; }

/* ===== Visor ordenado (maqueta aprobada 2026-11-10; solo clínica demo, clase rx-v3 en <body>) =====
   La ventana va escalada por --zv (0.75): cada medida se escribe en píxeles reales de pantalla y se divide por --zv. */
@media (min-width: 901px) {
  body.rx-v3 .rx-lightbox-window { --u: calc(1px / var(--zv, 1)); }
  /* Barra superior: una sola fila que cabe, «Cerrar» siempre visible */
  body.rx-v3 .rx-lightbox-topbar { height: calc(56 * var(--u)); padding: 0 calc(12 * var(--u)); }
  body.rx-v3 .rx-lightbox-topbar .rx-ctrl-btn { height: calc(40 * var(--u)); min-width: calc(40 * var(--u)); padding: 0 calc(12 * var(--u)); font-size: calc(13.5 * var(--u)); border-radius: calc(12 * var(--u)); gap: calc(7 * var(--u)); }
  body.rx-v3 .rx-lightbox-topbar .rx-lightbox-controls { gap: calc(8 * var(--u)); flex-wrap: nowrap; }
  body.rx-v3 .rx-lightbox-topbar .rx-lightbox-title { font-size: calc(12 * var(--u)); white-space: nowrap; }
  body.rx-v3 .rx-lightbox-topbar .close-btn { margin-left: auto; }
  /* Botones fijos: la barra se ancla a la izquierda y «Original»/«Guardar» aparecen al final sin empujar Rotar, Negativo, etc.; solo «Cerrar» queda a la derecha */
  body.rx-v3 .rx-lightbox-topbar .rx-lightbox-controls { flex: 1 1 auto; justify-content: flex-start; min-width: 0; }
  body.rx-v3 .rx-lightbox-topbar .rx-lightbox-controls > .rx-grp:has(.close-btn) { margin-left: auto; }
  /* Riel de herramientas */
  body.rx-v3 #rxAnnotBar { width: calc(132 * var(--u)); padding: calc(10 * var(--u)) calc(8 * var(--u)) !important; gap: calc(8 * var(--u)) !important; align-items: stretch; }
  body.rx-v3 #rxAnnotBar > .rx-grp:first-of-type { display: grid; grid-template-columns: 1fr 1fr; gap: calc(6 * var(--u)); width: 100%; }
  html body.rx-v3 #rxLightboxModal #rxAnnotBar > .rx-grp:first-of-type .rx-annot-tool { width: auto !important; height: calc(52 * var(--u)) !important; font-size: calc(11 * var(--u)) !important; padding: 0 calc(4 * var(--u)) !important; border-radius: calc(12 * var(--u)) !important; }
  body.rx-v3 #rxAnnotBar .rx-annot-colors { display: flex !important; justify-content: space-between; gap: 0 !important; width: 100%; padding: calc(6 * var(--u)) calc(6 * var(--u)); }
  /* Arriba a la izquierda solo el contador «Rx 1 de 3», en una línea */
  body.rx-v3 .rx-lightbox-info { flex: none; }
  body.rx-v3 .rx-lightbox-info > :first-child, body.rx-v3 .rx-lightbox-info .rx-lightbox-title { display: none; }
  /* Botones de cambios que están ocultos con visibility:hidden no deben ocupar lugar en la barra */
  body.rx-v3 .rx-lightbox-controls .rx-ctrl-btn[style*="visibility: hidden"], body.rx-v3 .rx-lightbox-controls .rx-ctrl-btn[style*="visibility:hidden"] { display: none !important; }
  body.rx-v3 .rx-lightbox-controls .rx-grp:not(:has(.rx-ctrl-btn:not([style*="display: none"]):not([style*="display:none"]):not([style*="visibility: hidden"]))) { display: none; }
  body.rx-v3 .rx-lightbox-info > * { white-space: nowrap; }
  body.rx-v3 #rxAnnotBar .rx-annot-colors .rx-annot-color { width: calc(18 * var(--u)) !important; height: calc(18 * var(--u)) !important; min-width: calc(18 * var(--u)) !important; min-height: calc(18 * var(--u)) !important; max-width: calc(18 * var(--u)) !important; max-height: calc(18 * var(--u)) !important; }
  body.rx-v3 #rxAnnotBar .rx-annot-select { width: 100% !important; max-width: none !important; height: calc(40 * var(--u)) !important; font-size: calc(13 * var(--u)); }
  html body.rx-v3 #rxLightboxModal #rxAnnotBar #rxIaBtn { flex-direction: row !important; width: 100% !important; height: calc(44 * var(--u)) !important; font-size: calc(13 * var(--u)) !important; font-weight: 700; gap: calc(7 * var(--u)) !important; background: rgba(167,139,250,.18) !important; color: #a78bfa !important; border: 1px solid rgba(167,139,250,.45) !important; border-radius: calc(12 * var(--u)) !important; }
  html body.rx-v3 #rxLightboxModal #rxAnnotBar #rxAnnotMoreBtn { flex-direction: row !important; width: 100% !important; height: calc(40 * var(--u)) !important; font-size: calc(13 * var(--u)) !important; border-radius: calc(12 * var(--u)) !important; }
  body.rx-v3 #rxAnnotBar > .rx-grp { width: 100%; }
  body.rx-v3 #rxAnnotBar .rx-grp:empty { display: none; }
  body.rx-v3 #rxAnnotBar .rx-annot-status { font-size: calc(11.5 * var(--u)); margin-top: auto !important; }
  html body.rx-v3 #rxLightboxModal #rxAnnotBar .rx-annot-save { width: 100% !important; height: calc(46 * var(--u)) !important; flex-direction: row !important; font-size: calc(14 * var(--u)) !important; font-weight: 700; border-radius: calc(12 * var(--u)) !important; }
  /* Comparar: cajón sobre la imagen, no un panel que la empuja */
  body.rx-v3 .rx-evo.show { position: absolute; top: calc(56 * var(--u)); right: 0; bottom: 0; width: calc(300 * var(--u)); z-index: 70; box-shadow: 0 16px 50px rgba(0,0,0,.6); }
}

/* ===== Visor ordenado: respiro arriba, escritorio y celular (solo rx-v3) ===== */
@media (min-width: 901px) {
  /* Botones centrados en la barra (antes quedaban pegados al borde superior) y con margen de seguridad arriba */
  body.rx-v3 .rx-lightbox-topbar { padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
  body.rx-v3 .rx-lightbox-topbar .rx-lightbox-controls { height: 100%; align-items: center; overflow: visible; }
  html body.rx-v3 .rx-lightbox-topbar .rx-grp { height: calc(40 * var(--u)); align-self: center; align-items: center; margin: 0; padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 900px) {
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-window { --u: 1px; }
  /* Fila 1: título + Anotar + Cerrar. Fila 2: herramientas del visor. Todo a 44 px táctiles y con la muesca respetada */
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-topbar { position: relative; height: auto !important; min-height: 0; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px !important; gap: 8px; flex-direction: column; align-items: stretch; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-info { display: flex !important; align-items: center; gap: 8px; height: 44px; min-width: 0; max-width: none; padding-right: 132px; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-info .rx-lightbox-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-info > :not(svg):not(.rx-lightbox-title) { flex: none; white-space: nowrap; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-controls { width: 100%; justify-content: space-between; gap: 6px !important; flex-wrap: nowrap; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-topbar .rx-ctrl-btn:not(.rx-menu *) { min-width: 44px !important; width: auto; height: 44px !important; padding: 0 10px !important; border-radius: 12px; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-topbar .rx-ctrl-btn svg { width: 20px !important; height: 20px !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxZoomResetBtn { font-size: 13px !important; min-width: 56px !important; }
  /* El pellizco ya hace zoom: se ocultan − y + para que quepa todo a 44 px sin desplazar */
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxZoomOutBtn, html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxZoomInBtn { display: none !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal .rx-lightbox-topbar .rx-grp:has(.close-btn) { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 10px; margin: 0; padding: 0; border: 0; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxLightboxCloseBtn { position: static !important; width: 44px !important; height: 44px !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxMobileAnnotToggle { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 62px; font-size: 14px !important; font-weight: 700; gap: 6px !important; padding: 0 14px !important; background: rgba(10,132,255,.22) !important; color: #7cc0ff !important; border: 1px solid rgba(10,132,255,.5) !important; }
  /* Barra de marcas abierta: fila de herramientas a 44 px y fila de color / IA / guardar */
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar.mob-annot-open { display: flex !important; flex-wrap: wrap !important; height: auto !important; min-height: 0 !important; overflow: visible !important; gap: 8px !important; padding: 8px 10px !important; align-items: center !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar > .rx-grp:first-of-type { display: flex; width: 100%; justify-content: space-between; gap: 2px; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-annot-tool:not(.rx-annot-save):not(.rx-menu *) { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; border-radius: 12px !important; padding: 0 !important; font-size: 0 !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-annot-tool svg { width: 20px !important; height: 20px !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-annot-colors { display: flex !important; gap: 8px !important; flex: 1 1 auto; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-annot-colors .rx-annot-color { width: 28px !important; height: 28px !important; min-width: 28px !important; max-width: 28px !important; min-height: 28px !important; max-height: 28px !important; aspect-ratio: 1 / 1 !important; border-radius: 50% !important; flex: 0 0 28px !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-annot-save { width: auto !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; font-size: 14px !important; font-weight: 700; padding: 0 14px !important; border-radius: 12px !important; margin-left: 0 !important; }
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar .rx-grp:empty { display: none; }
}

/* ===== Revisión asistida IA · Opción A (solo demo-ecuador; 1 Rx y Comparador 2 Rx) ===== */
.rx-ia-svg,
.rx-ia-cmp-svg {
  position: absolute;
  pointer-events: none;
  z-index: 24;
  overflow: visible;
}
.rx-ia-hit {
  pointer-events: auto;
  cursor: pointer;
}
.rx-ia-pin-txt {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
}

.rx-ia-prog-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(167, 139, 250, .32);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.rx-ia-prog-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.rx-ia-prog-top b { font-size: 13.5px; font-weight: 700; color: #ffffff; }
.rx-ia-prog-pct { font-size: 16px; font-weight: 800; color: #c4b5fd; flex: none; }
.rx-ia-prog-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  overflow: hidden;
}
.rx-ia-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #38bdf8);
  transition: width .22s ease;
}
.rx-ia-prog-step {
  font-size: 12px;
  color: #a1a1a6;
  line-height: 1.35;
}
.rx-ia-cancel-btn {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #f5f5f7;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.rx-hud-btn.rx-hud-ia {
  height: 44px;
  background: rgba(124, 58, 237, .88);
  border-color: rgba(196, 181, 253, .55);
  color: #ffffff;
  font-weight: 700;
}
.rx-hud-btn.rx-hud-ia:hover { background: rgba(139, 92, 246, .95); }

.rx-ia-drawer {
  display: none;
  background: #111114;
  color: #f5f5f7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
  z-index: 68;
}
.rx-ia-drawer.show {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
}
.rx-ia-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rx-ia-head-t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  min-width: 0;
}
.rx-ia-badge {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, .18);
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
}
.rx-ia-close {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #d1d1d6;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.rx-ia-sub {
  margin: 0;
  font-size: 12px;
  color: #a1a1a6;
  line-height: 1.35;
}
.rx-ia-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  flex: none;
}
.rx-ia-tabs button {
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d1d1d6;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.rx-ia-tabs button.on {
  background: rgba(255, 255, 255, .16);
  color: #ffffff;
}
.rx-ia-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
}
.rx-ia-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid transparent;
  cursor: pointer;
}
.rx-ia-row:hover { background: rgba(255, 255, 255, .11); }
.rx-ia-row.sel {
  background: rgba(167, 139, 250, .13);
  border-color: rgba(167, 139, 250, .45);
}
.rx-ia-row.off { opacity: .55; }
.rx-ia-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #111114;
  background: #fbbf24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rx-ia-num.rojo { background: #ff5a5f; color: #ffffff; }
.rx-ia-num.ambar { background: #fbbf24; color: #111114; }
.rx-ia-num.celeste { background: #38bdf8; color: #082f49; }
.rx-ia-num.verde { background: #34d399; color: #052e16; }
.rx-ia-num.sec {
  background: rgba(255, 255, 255, .20);
  color: #f8fafc;
}
.rx-ia-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rx-ia-txt b {
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f7;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.rx-ia-txt span {
  font-size: 12px;
  color: #a1a1a6;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.rx-ia-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.rx-ia-act-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #f5f5f7;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.rx-ia-act-btn.ok {
  background: rgba(48, 209, 88, .18);
  border-color: rgba(48, 209, 88, .45);
  color: #6ee7b7;
}
.rx-ia-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.rx-ia-cta {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 0;
  background: #0a84ff;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rx-ia-cta:disabled { opacity: .45; cursor: default; }

@media (min-width: 901px) {
  body.rx-v3 .rx-ia-drawer.show {
    width: calc(328 * var(--u));
    padding: calc(14 * var(--u)) calc(12 * var(--u));
    gap: calc(10 * var(--u));
    flex: none;
    border-left: 1px solid rgba(255, 255, 255, .12);
  }
  body.rx-v3 .rx-ia-head-t { font-size: calc(15 * var(--u)); gap: calc(8 * var(--u)); }
  body.rx-v3 .rx-ia-badge { height: calc(24 * var(--u)); padding: 0 calc(8 * var(--u)); font-size: calc(12 * var(--u)); }
  body.rx-v3 .rx-ia-close { width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: calc(11 * var(--u)); font-size: calc(16 * var(--u)); }
  body.rx-v3 .rx-ia-sub { font-size: calc(12 * var(--u)); }
  body.rx-v3 .rx-ia-tabs { padding: calc(4 * var(--u)); gap: calc(4 * var(--u)); border-radius: calc(12 * var(--u)); }
  body.rx-v3 .rx-ia-tabs button { height: calc(44 * var(--u)); font-size: calc(12.5 * var(--u)); border-radius: calc(9 * var(--u)); }
  body.rx-v3 .rx-ia-list { gap: calc(6 * var(--u)); }
  body.rx-v3 .rx-ia-row { min-height: calc(58 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); gap: calc(10 * var(--u)); border-radius: calc(13 * var(--u)); }
  body.rx-v3 .rx-ia-num { width: calc(26 * var(--u)); height: calc(26 * var(--u)); border-radius: calc(8 * var(--u)); font-size: calc(12 * var(--u)); }
  body.rx-v3 .rx-ia-txt b { font-size: calc(13 * var(--u)); }
  body.rx-v3 .rx-ia-txt span { font-size: calc(12 * var(--u)); }
  body.rx-v3 .rx-ia-act-btn { width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: calc(10 * var(--u)); font-size: calc(15 * var(--u)); }
  body.rx-v3 .rx-ia-cta, body.rx-v3 .rx-ia-cancel-btn { height: calc(44 * var(--u)); border-radius: calc(12 * var(--u)); font-size: calc(13.5 * var(--u)); }
  body.rx-v3 .rx-ia-prog-card { padding: calc(13 * var(--u)); gap: calc(9 * var(--u)); border-radius: calc(14 * var(--u)); }
  body.rx-v3 .rx-ia-prog-top b { font-size: calc(13.5 * var(--u)); }
  body.rx-v3 .rx-ia-prog-pct { font-size: calc(16 * var(--u)); }
  body.rx-v3 .rx-ia-prog-track { height: calc(8 * var(--u)); }
  body.rx-v3 .rx-ia-prog-step { font-size: calc(12 * var(--u)); }
  body.rx-v3 .rx-hud-btn.rx-hud-ia { height: calc(44 * var(--u)); padding: 0 calc(14 * var(--u)); font-size: calc(13 * var(--u)); border-radius: calc(12 * var(--u)); }
  body.rx-ia-open #rxEvoPanel.show { display: none !important; }
}

@media (max-width: 900px) {
  html body.rx-v3 #rxLightboxModal#rxLightboxModal#rxLightboxModal #rxAnnotBar #rxIaBtn {
    width: auto !important;
    min-width: 88px !important;
    height: 44px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 0 12px !important;
    gap: 6px !important;
    background: rgba(167, 139, 250, .20) !important;
    color: #ddd6fe !important;
    border: 1px solid rgba(167, 139, 250, .50) !important;
  }
  .rx-ia-drawer.show {
    width: 100%;
    max-height: none;
    border-top: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px 16px 0 0;
    padding: 8px 10px 10px;
    gap: 6px;
    flex: none;
  }
  .rx-ia-drawer .rx-ia-sub { display: none; }
  .rx-ia-list { overflow: visible; gap: 5px; }
  .rx-ia-row { min-height: 48px; padding: 5px 8px; gap: 8px; border-radius: 11px; }
  .rx-ia-txt b { font-size: 12.5px; line-height: 1.2; }
  .rx-ia-txt span { font-size: 12px; line-height: 1.2; }
  body.rx-ia-open #rxHud { display: none !important; }
  body.rx-ia-open #rxEvoPanel.show { display: none !important; }
}
