/* DATADRILL — Comunicador de campo (R.A.D.I.) */
#dd-radio-fab[hidden], #dd-radio-fab.away { display: none !important; }
#dd-radio-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 9100;
  min-height: 52px; padding: 0 18px 0 14px; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid #4b91d2; border-radius: 999px; color: #f6fbff;
  background: linear-gradient(180deg, #164f83, #0b2d4e);
  box-shadow: 0 10px 28px #0009, inset 0 1px #ffffff30;
  font: 600 14px/1 "IBM Plex Sans", system-ui, sans-serif; cursor: pointer;
}
#dd-radio-fab:hover { filter: brightness(1.12); }
#dd-radio-fab::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px #3ddc8433; }
#dd-radio-fab:focus-visible, #dd-radio-close:focus-visible { outline: 3px solid #8cc9ff; outline-offset: 3px; }
#dd-radio-fab svg { width: 24px; height: 24px; flex: none; }
/* el panel tiene la forma exacta del aparato (898 x 1751) y se apoya en la esquina inferior derecha */
#dd-radio-panel {
  position: fixed; z-index: 9101; right: 14px; bottom: 14px;
  height: min(820px, calc(100dvh - 28px)); aspect-ratio: 898 / 1751; max-width: calc(100vw - 28px);
  overflow: visible; background: transparent;
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98);
  transition: opacity .18s ease-out, transform .18s ease-out, visibility .18s;
}
#dd-radio-panel.open { opacity: 1; visibility: visible; transform: none; }
#dd-radio-box { position: absolute; inset: 0; }
#dd-radio-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; border-radius: 22px; background: #05060a; box-shadow: 0 24px 70px #000c; }
/* la X ocupa el tornillo de la esquina superior derecha del aparato: no ocupa sitio propio */
#dd-radio-close {
  position: absolute; z-index: 2; left: 89.4%; top: 6.4%; width: 40px; height: 40px; transform: translate(-50%, -50%); display: grid; place-items: center;
  border: 1px solid #4b91d2; border-radius: 50%; color: #fff; background: #0b2d4e; cursor: pointer; box-shadow: 0 2px 10px #000a;
}
#dd-radio-close:hover { background: #164f83; }
#dd-radio-close svg { width: 18px; height: 18px; }
@media (max-width: 520px) {
  #dd-radio-fab { right: 14px; }
  #dd-radio-panel { inset: 0; height: 100dvh; width: 100vw; max-width: none; aspect-ratio: auto; background: #05060a; overflow: hidden; }
  /* el aparato llena el alto completo (sin franjas muertas); si el telefono es mas angosto, se recortan unos pixeles de los lados */
  #dd-radio-box { inset: auto; top: 0; left: 50%; height: 100dvh; width: calc(100dvh * 898 / 1751); transform: translateX(-50%); }
  #dd-radio-frame { border-radius: 0; box-shadow: none; }
}@media (prefers-reduced-motion: reduce) { #dd-radio-panel { transition: none; } }

/* botón estilo R.A.D.I. DataDrill: octágono azul neón como el botón de hablar del aparato, con el piloto verde arriba */
#dd-radio-fab { width: 64px; height: 64px; min-height: 0; padding: 0; gap: 0; justify-content: center; border: 0; border-radius: 0; background: linear-gradient(180deg, #5fd4ff, #0b79c2); box-shadow: none; clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%); position: fixed; }
#dd-radio-fab::before { content: ""; position: absolute; inset: 3px; clip-path: inherit; background: radial-gradient(circle at 50% 30%, #243248, #0a111c 70%); }
#dd-radio-fab::after { content: ""; position: absolute; top: 6px; left: 50%; width: 18px; height: 4px; margin-left: -9px; border-radius: 3px; background: #3dff7a; box-shadow: 0 0 8px #3dff7a; }
#dd-radio-fab svg { position: relative; z-index: 1; width: 30px; height: 30px; margin-top: 4px; color: #fff; filter: drop-shadow(0 0 4px #22a8e8); }
#dd-radio-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#dd-radio-fab:hover { filter: brightness(1.18); }
.app~#dd-radio-fab { width: 46px; height: 46px; padding: 0; min-height: 0; }
.app~#dd-radio-fab svg { width: 24px; height: 24px; }
.app~#dd-radio-fab::after { top: 4px; width: 14px; margin-left: -7px; }
