/* 1.0.294 — salvamento confiavel, seletores tematicos e anexos no Assistente. */

/* A separacao deve vir do proprio painel; a borda superior do composer criava
   a risca isolada observada junto ao campo Mensagem. */
#page-assistant .chat-composer,
body.ol-assistant-active #page-assistant .chat-composer,
body.ol-assistant-active.assistant-keyboard-open #page-assistant .chat-composer,
html.cap-native body.ol-assistant-active #page-assistant .chat-composer,
html.cap-native body.ol-assistant-active.assistant-keyboard-open #page-assistant .chat-composer {
  border-top: 0 !important;
  box-shadow: none !important;
}

/* Seletor compartilhado: evita caixas nativas claras e mantem o mesmo padrao
   em Familia, Carteira, importacao e demais selects reais do aplicativo. */
.oliver-themed-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 32000;
  display: grid;
  align-items: end;
  padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overscroll-behavior: contain;
  touch-action: none;
}
.oliver-themed-select-overlay.hidden { display: none !important; }
.oliver-themed-select-sheet {
  box-sizing: border-box;
  width: min(100%, 520px);
  max-height: min(74dvh, 660px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(var(--brand-rgb),.34);
  border-radius: 24px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 100% 0, rgba(59, 130, 246, .16), transparent 42%),
    linear-gradient(155deg, rgba(15, 23, 48, .995), rgba(5, 13, 29, .995));
  box-shadow: 0 28px 76px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .045);
  animation: oliverSelectEnter .2s cubic-bezier(.2, .8, .2, 1) both;
}
.oliver-themed-select-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid rgba(148, 163, 184, .11);
}
.oliver-themed-select-sheet > header small {
  display: block;
  margin-bottom: 3px;
  color: #67e8f9;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.oliver-themed-select-sheet > header h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 18px;
  line-height: 1.2;
}
.oliver-themed-select-sheet > header button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  color: #dbeafe;
  background: rgba(7, 15, 31, .76);
  font-size: 25px;
  line-height: 1;
}
.oliver-themed-select-options {
  display: grid;
  gap: 8px;
  max-height: calc(min(74dvh, 660px) - 86px);
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.oliver-themed-select-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 16px;
  color: #dbeafe;
  background: rgba(7, 15, 31, .74);
  font: inherit;
  text-align: left;
}
.oliver-themed-select-option > span:nth-child(2) {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oliver-themed-select-option-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: var(--brand-secondary);
  background: linear-gradient(145deg, rgba(76, 29, 149, .5), rgba(8, 47, 73, .42));
}
.oliver-themed-select-option-icon .ui-icon { width: 19px; height: 19px; }
.oliver-themed-select-option > i {
  color: #67e8f9;
  font-size: 17px;
  font-style: normal;
  text-align: center;
}
.oliver-themed-select-option.active {
  border-color: rgba(var(--brand-rgb),.65);
  color: #fff;
  background: linear-gradient(135deg, rgba(91, 33, 182, .48), rgba(30, 64, 175, .22));
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb),.08), 0 10px 26px rgba(76, 29, 149, .16);
}
.oliver-themed-select-option:focus-visible,
.oliver-themed-select-sheet > header button:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}
.oliver-themed-select-option:disabled { opacity: .42; }
body.oliver-themed-select-open { overflow: hidden !important; }

/* Previa anexada ao balao: imagem e PDF usam assinatura e icone distintos. */
#page-assistant .chat-msg.user.has-media {
  width: min(88%, 390px) !important;
  max-width: min(88%, 390px) !important;
  padding: 10px !important;
}
.chat-attachment-preview {
  display: grid;
  gap: 8px;
  margin: 9px 0 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 16px;
  background: rgba(3, 8, 22, .5);
  box-shadow: 0 14px 30px rgba(2, 6, 23, .2);
}
.chat-attachment-thumb {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #07101f;
}
.chat-attachment-preview.is-pdf .chat-attachment-thumb { aspect-ratio: 16 / 7; }
.chat-attachment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.chat-attachment-preview.is-pdf .chat-attachment-thumb img { object-fit: contain; background: #e5e7eb; }
.chat-attachment-preview figcaption {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
}
.chat-attachment-kind-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #67e8f9;
  background: rgba(8, 145, 178, .2);
}
.chat-attachment-preview.is-pdf .chat-attachment-kind-icon {
  color: #fda4af;
  background: rgba(190, 24, 93, .22);
}
.chat-attachment-kind-icon .ui-icon { width: 18px; height: 18px; }
.chat-attachment-preview figcaption > span:nth-child(2) { min-width: 0; }
.chat-attachment-preview figcaption b,
.chat-attachment-preview figcaption small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-attachment-preview figcaption b { color: #f8fafc; font-size: 12px; }
.chat-attachment-preview figcaption small { margin-top: 3px; color: #cbd5e1; font-size: 10px; }
.chat-attachment-type {
  padding: 5px 7px;
  border: 1px solid rgba(103, 232, 249, .28);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 145, 178, .14);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}
.chat-attachment-preview.is-pdf .chat-attachment-type {
  border-color: rgba(251, 113, 133, .34);
  color: #fecdd3;
  background: rgba(190, 24, 93, .16);
}

@keyframes oliverSelectEnter {
  from { opacity: .5; transform: translate3d(0, 18px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@media (min-width: 700px) {
  .oliver-themed-select-overlay { align-items: center; }
}

@media (max-width: 380px) {
  .oliver-themed-select-overlay { padding-inline: 8px; }
  .oliver-themed-select-sheet { border-radius: 20px; }
  .oliver-themed-select-option { min-height: 54px; }
  #page-assistant .chat-msg.user.has-media { width: min(94%, 360px) !important; max-width: min(94%, 360px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .oliver-themed-select-sheet { animation: none !important; }
}
