/* RT•Base — Helena Drawer (Institutional) */

:root{
  --helena-bg: #0b1220;
  --helena-panel: #0f172a;
  --helena-border: rgba(255,255,255,.12);
  --helena-text: rgba(255,255,255,.92);
  --helena-muted: rgba(255,255,255,.70);
  --helena-shadow: 0 18px 55px rgba(0,0,0,.45);
}

/* FAB */
.helena-fab{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 11px 14px;
  border-radius: 999px;

  background: rgba(11,18,32,.92);
  color: var(--helena-text);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 12px 34px rgba(0,0,0,.35);

  font-size: 13px;
  letter-spacing: .2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.helena-fab:hover{ border-color: rgba(255,255,255,.22); }
.helena-fab .helena-ico{ opacity: .85; }
.helena-fab:hover .helena-ico{ opacity: 1; }

/* Overlay */
.helena-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.helena-overlay.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* Drawer */
.helena-drawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 74vh;
  width: 420px;
  max-width: 92vw;

  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(11,18,32,.98));
  border-left: 1px solid var(--helena-border);
  box-shadow: -18px 0 55px rgba(0,0,0,.55);

  z-index: 10000;

  transform: translateX(105%);
  transition: transform .22s ease;

  display: flex;
  flex-direction: column;

  isolation: isolate;
}
.helena-drawer.is-open{ transform: translateX(0); }

/* Head */
.helena-head{
  padding: 14px 14px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.helena-title{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.helena-title strong{
  font-size: 12px;
  letter-spacing: .7px;
  color: var(--helena-text);
  text-transform: uppercase;
}
.helena-title span{
  font-size: 12px;
  color: var(--helena-muted);
}
.helena-close{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--helena-text);
  cursor: pointer;
}

/* Body: layout (Encaminhamento em cima, Widget embaixo) */
.helena-body{
  padding: 12px;
  flex: 1;
  min-height: 0;

  display: flex;
  flex-direction: column;
  gap: 10px;

  overflow: hidden;
  position: relative;
}

/* Route area (fica EM CIMA do widget, não cobre o banner) */
.helena-route{
  order: 0;
  z-index: 5;

  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(10px);
}

/* Botão */
.helena-routeBtn{
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.90);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
}
.helena-routeBtn:hover{ border-color: rgba(255,255,255,.22); }

/* Painel (toggle) */
.helena-routePanel{
  display: none;
  margin-top: 10px;
}
.helena-routePanel.is-open{
  display: block;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(11,18,32,.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}

.helena-routeText{
  font-size: 12px;
  color: rgba(255,255,255,.72);
  margin-bottom: 10px;
}
.helena-routeRow{
  display: flex;
  gap: 8px;
}
.helena-routeRow input{
  flex: 1;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.90);
  outline: none;
}
.helena-routeRow button{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
  cursor: pointer;
}
.helena-routeHint{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.65);
}

/* Widget slot (fica EMBAIXO e ocupa o resto) */
.helena-slot{
  order: 1;
  flex: 1;
  min-height: 0;
  width: 100%;

  position: relative;
  z-index: 1;

  overflow: auto;
  border-radius: 14px;
}

/* Respeitar o container */
.helena-slot iframe{
  position: relative;
  z-index: 1;
  max-width: 100%;
}

/* Mobile refinement */
@media (max-width: 768px){
  .helena-fab{
    right: 16px;
    bottom: 16px;
    padding: 11px 12px;
  }
  .helena-fab span{ display: none; }

  .helena-drawer{
    width: 100%;
    max-width: 100%;
    height: 100vh;
  }
  :root{ --helena-safe-bottom: 0px; }

.helena-fab,
.helena-launcher,
#helenaLauncher,
[data-helena-launcher]{
  bottom: calc(18px + var(--helena-safe-bottom)) !important;
  right: 18px !important;
}
}