/* V15.77.0 — CODEX (Parte 15): o botão pequeno e o painel do segundo assistente (só leitura). Só existe na página para o
   Master com o "Assistente Codex" ligado (html.codex-on). Com a Luna ligada, o botão fica logo ACIMA da bolinha dela e
   numa camada abaixo da dela (249 × 250): nada do Codex cobre a Luna; com o painel dela aberto, o botão some até ela
   fechar. O fim de cada tela ganha o espaço do botão (o último conteúdo nunca fica embaixo dele). O painel é sólido
   (nunca transparente), por cima do fundo de estrelas, e no celular ocupa a largura da tela. */
.codex-root { position: fixed; right: 18px; bottom: 18px; z-index: 249; font-family: inherit; }
html.luna-on .codex-root { right: 24px; bottom: 76px; }
.codex-luna-aberta .codex-launcher { visibility: hidden; }
body.auth-pending .codex-root, body.auth-locked .codex-root { display: none; }
html.codex-on:not(.luna-on) .module-view:not(#module-conference)::after { content: ""; display: block; height: 60px; }
html.codex-on.luna-on .module-view:not(#module-conference)::after { height: calc(var(--luna-reserve) + 44px); }
.codex-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.codex-launcher { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; margin: 0; border: 1px solid #c9d3dd; border-radius: 10px;
  background: #fff; color: #1f2a33; box-shadow: 0 4px 14px rgba(15, 23, 42, .18); cursor: pointer; font: inherit; }
.codex-launcher:hover { background: #f3f6f9; }
.codex-launcher:focus-visible { outline: 3px solid #1f6feb; outline-offset: 3px; }
.codex-launcher[aria-expanded="true"] { border-color: #1f6feb; }
.codex-glyph { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }

.codex-panel { position: fixed; right: 18px; bottom: 66px; width: min(390px, calc(100vw - 36px)); max-height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: #fff; color: #1f2a33; border: 1px solid #dfe3e8; border-radius: 12px; box-shadow: 0 18px 50px rgba(15, 23, 42, .22); overflow: hidden; font-size: 13px; }
html.luna-on .codex-panel { bottom: 124px; max-height: min(560px, calc(100vh - 150px)); }
.codex-panel[hidden] { display: none; }
.codex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #eef1f4; }
.codex-title { margin: 0; font-size: 15px; font-weight: 700; color: #1f2a33; }
.codex-mode { margin: 2px 0 0; font-size: 12px; font-weight: 700; color: #5b6773; }
.codex-head-actions { display: flex; gap: 4px; align-items: center; }
.codex-link { border: 0; background: transparent; color: #1f5fa8; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.codex-link:hover:not(:disabled) { background: #eef4fb; }
.codex-link:disabled { color: #9aa4ae; cursor: not-allowed; }
.codex-close { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #4b5b6b; font-size: 18px; line-height: 1; cursor: pointer; }
.codex-close:hover { background: #eef1f4; }
.codex-link:focus-visible, .codex-close:focus-visible, .codex-ack:focus-visible, .codex-send:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }

.codex-notice { margin: 10px 12px 0; padding: 9px 10px; border-radius: 8px; background: #f4f7fb; border: 1px solid #dbe5f0; }
.codex-notice[hidden] { display: none; }
.codex-notice p { margin: 0 0 8px; line-height: 1.45; }
.codex-ack { border: 0; border-radius: 7px; background: #1f6feb; color: #fff; font: inherit; font-weight: 700; padding: 6px 12px; cursor: pointer; }
.codex-reason { margin: 10px 12px 0; padding: 8px 10px; border-radius: 8px; background: #fff7e6; color: #6b4a00; line-height: 1.45; }
.codex-reason[hidden] { display: none; }

.codex-messages { flex: 1 1 auto; min-height: 90px; margin: 0; padding: 10px 12px; list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.codex-msg { max-width: 92%; padding: 8px 10px; border-radius: 10px; line-height: 1.45; }
.codex-msg-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.codex-msg-fonte { margin: 5px 0 0; font-size: 12px; color: #5b6773; }
.codex-msg-user { align-self: flex-end; background: #e8f1fd; color: #16365c; }
.codex-msg-codex { align-self: flex-start; background: #f3f5f7; color: #1f2a33; }
.codex-empty { color: #5b6773; font-size: 13px; line-height: 1.45; }
.codex-status { margin: 0; padding: 0 12px; min-height: 16px; font-size: 12px; color: #5b6773; }
.codex-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px; border-top: 1px solid #eef1f4; }
.codex-input { flex: 1 1 auto; min-height: 38px; max-height: 120px; resize: vertical; padding: 7px 9px; border: 1px solid #cfd8e1; border-radius: 8px; font: inherit; font-size: 14px;
  background: #fff; color: #1f2a33; }
.codex-input:focus-visible { outline: 2px solid #1f6feb; outline-offset: 1px; }
.codex-input:disabled { background: #f3f5f7; cursor: not-allowed; }
.codex-send { border: 0; border-radius: 8px; background: #1f2a33; color: #fff; font: inherit; font-weight: 700; padding: 9px 14px; cursor: pointer; }
.codex-send:disabled { background: #9aa4ae; cursor: not-allowed; }
.codex-foot { margin: 0; padding: 0 12px 8px; font-size: 12px; color: #5b6773; }
.codex-foot:empty { display: none; }

html[data-theme="dark"] .codex-launcher { background: #171b20; color: #e2e8ee; border-color: #3a424b; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .codex-launcher:hover { background: #222830; }
html[data-theme="dark"] .codex-panel { background: #171b20; color: #e2e8ee; border-color: #30363d; }
html[data-theme="dark"] .codex-head, html[data-theme="dark"] .codex-form { border-color: #262c33; }
html[data-theme="dark"] .codex-title { color: #eef3f7; }
html[data-theme="dark"] .codex-mode, html[data-theme="dark"] .codex-status, html[data-theme="dark"] .codex-foot, html[data-theme="dark"] .codex-empty,
html[data-theme="dark"] .codex-msg-fonte { color: #9aa7b3; }
html[data-theme="dark"] .codex-msg-user { background: #1d3552; color: #dbe9fb; }
html[data-theme="dark"] .codex-msg-codex { background: #222830; color: #dfe6ec; }
html[data-theme="dark"] .codex-notice { background: #1b2430; border-color: #2c3a4b; }
html[data-theme="dark"] .codex-reason { background: #33280f; color: #f3d9a0; }
html[data-theme="dark"] .codex-input { background: #0f1216; color: #e2e8ee; border-color: #3a424b; }
html[data-theme="dark"] .codex-input:disabled { background: #1b2026; }
html[data-theme="dark"] .codex-send { background: #e2e8ee; color: #171b20; }
html[data-theme="dark"] .codex-send:disabled { background: #4b545e; color: #c7d0d9; }
html[data-theme="dark"] .codex-close { color: #b8c4d0; }
html[data-theme="dark"] .codex-close:hover, html[data-theme="dark"] .codex-link:hover:not(:disabled) { background: #222830; }
html[data-theme="dark"] .codex-link { color: #8cc2ff; }

@media (max-width: 700px) {
  .codex-root { right: 12px; bottom: 12px; }
  html.luna-on .codex-root { right: 18px; bottom: 64px; }
  .codex-launcher { width: 32px; height: 32px; }
  .codex-panel, html.luna-on .codex-panel { left: 12px; right: 12px; width: auto; bottom: 56px; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
  html.luna-on .codex-panel { bottom: 104px; max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); }
  html.codex-on:not(.luna-on) #module-conference::after { content: ""; display: block; flex: 0 0 56px; height: 56px; }
  html.codex-on.luna-on .module-view::after, html.codex-on.luna-on #module-conference::after { flex-basis: calc(var(--luna-reserve) + 40px); height: calc(var(--luna-reserve) + 40px); }
}
@media print { .codex-root { display: none !important; } }
