* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #F1F2F5;
  color: #1B1F27;
}

/* ---------- TOPBAR ---------- */
.topbar {
  background: #0B3D8E;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Logo SVG na topbar. Equivale às classes Tailwind "h-7 brightness-0 invert"
   do produto: 28px de altura e o desenho todo em branco sobre o azul. */
.logo {
  height: 28px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.badge {
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
}

.badge-icon {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.badge .beta {
  background: #ffffff;
  color: #0B3D8E;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* ---------- LAYOUT ---------- */
.layout {
  display: flex;
  min-height: calc(100vh - 64px);
  position: relative;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #E7E9EE;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.collapse-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #E1E4EA;
  border-radius: 8px;
  background: #ffffff;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 20px;
}

.collapse-btn svg {
  width: 16px;
  height: 16px;
}

.menu-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #9AA1AC;
  padding-bottom: 16px;
  border-bottom: 1px solid #EDEEF2;
  margin-bottom: 16px;
}

.menu-body {
  flex: 1;
}

.menu-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4B5563;
  font-size: 15px;
  padding-top: 16px;
  border-top: 1px solid #EDEEF2;
}

.menu-footer svg {
  width: 18px;
  height: 18px;
}

/* ---------- MOBILE MENU BUTTON ---------- */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 76px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #E1E4EA;
  background: #ffffff;
  color: #0B3D8E;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- MAIN CONTENT ---------- */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 24px;
  min-height: calc(100vh - 64px);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 900px;
  width: 100%;
}

.ai-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  margin-bottom: 24px;
  color: #0B3D8E;
  font-size: 17px;
  font-weight: 600;
}

.ai-avatar svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: #E4EAF6;
  color: #0B3D8E;
}

.greeting {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.35;
  color: #1B1F27;
  margin-bottom: 40px;
}

.disclaimer {
  font-size: 14px;
  color: #8A8F98;
  line-height: 1.6;
}

/* ---------- CHAT INPUT ---------- */
.chat-input-wrap {
  width: 100%;
  max-width: 900px;
  margin-top: 32px;
}

.chat-input-box {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
  display: flex;
  align-items: flex-end;
  padding: 20px 20px 16px;
  gap: 12px;
}

.chat-input-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #1B1F27;
  background: transparent;
}

.chat-input-box input::placeholder {
  color: #9AA1AC;
}

.send-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  background: #E9EDF5;
  color: #B8C0CC;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 15;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .content {
    padding-top: 90px;
  }
}

@media (max-width: 600px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .block {
    padding: 18px 16px;
  }

  .subheader {
    font-size: 17px;
  }

  .metric-value {
    font-size: 21px;
  }

  .dataframe .col-text {
    max-width: 220px;
  }

  .topbar {
    padding: 0 16px;
  }

  .logo {
    height: 22px;
  }

  .badge {
    font-size: 12px;
    padding: 6px 10px;
    gap: 6px;
  }

  .badge span:not(.beta) {
    display: none;
  }

  .badge-icon {
    width: 16px;
    height: 16px;
  }

  .content {
    padding: 84px 16px 16px;
  }

  .ai-avatar {
    font-size: 15px;
  }

  .ai-avatar svg {
    width: 34px;
    height: 34px;
  }

  .greeting {
    font-size: 24px;
    margin-bottom: 24px;
  }

  .disclaimer {
    font-size: 13px;
  }

  .chat-input-box {
    padding: 14px 14px 12px;
    border-radius: 14px;
  }

  .chat-input-box input,
  .chat-input-box textarea {
    font-size: 15px;
  }
}

@media (max-width: 400px) {
  .greeting {
    font-size: 20px;
  }
}

/* ---------- SIDEBAR: PARÂMETROS (st.sidebar / st.header) ---------- */
.param-header {
  font-size: 16px;
  font-weight: 700;
  color: #1B1F27;
  margin-bottom: 20px;
}

.param-field {
  margin-bottom: 26px;
}

.param-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  margin-bottom: 6px;
}

.param-help {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #E4EAF6;
  color: #0B3D8E;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
}

.param-help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 140%;
  transform: translateX(-50%);
  width: 210px;
  background: #1B1F27;
  color: #ffffff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 30;
}

.param-help:hover::after,
.param-help:focus::after {
  opacity: 1;
  visibility: visible;
}

.param-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #0B3D8E;
  margin-bottom: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #0B3D8E 0%,
    #0B3D8E var(--fill, 50%),
    #E1E4EA var(--fill, 50%),
    #E1E4EA 100%
  );
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0B3D8E;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(11, 61, 142, 0.4);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0B3D8E;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(11, 61, 142, 0.4);
  cursor: pointer;
}

.param-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9AA1AC;
  margin-top: 6px;
}

/* ---------- SELECTS (st.selectbox) ---------- */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #6B7280;
  border-bottom: 2px solid #6B7280;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #E1E4EA;
  border-radius: 10px;
  background: #ffffff;
  color: #1B1F27;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 32px 10px 12px;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
}

.select-wrap select:focus {
  border-color: #0B3D8E;
  box-shadow: 0 0 0 3px rgba(11, 61, 142, 0.12);
}

/* ---------- SUGESTÕES DE PERGUNTA ---------- */
.suggestion-field {
  margin-bottom: 12px;
}

.suggestion-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  margin-bottom: 6px;
}

/* ---------- CAIXA DE PERGUNTA (st.text_area) ---------- */
.chat-input-box textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: #1B1F27;
  background: transparent;
  min-height: 72px;
  max-height: 220px;
  overflow-y: auto;
}

.chat-input-box textarea::placeholder {
  color: #9AA1AC;
}

.send-btn:not(:disabled) {
  background: #0B3D8E;
  color: #ffffff;
}

.send-btn:disabled {
  cursor: not-allowed;
}

/* ---------- BOTÃO CONSULTAR (st.button type="primary") ---------- */
.chat-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-primary {
  background: #0B3D8E;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 26px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: #0A3378;
}

.btn-primary:disabled {
  background: #C9D2E1;
  color: #F1F2F5;
  cursor: not-allowed;
}

/* ---------- ÁREA DE RESULTADOS ---------- */
.results {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.block {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
  padding: 22px 24px;
}

.subheader {
  font-size: 19px;
  font-weight: 700;
  color: #0B3D8E;
  margin-bottom: 10px;
}

/* ---------- SPINNER (st.spinner) ---------- */
.spinner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #E7E9EE;
  padding: 14px 18px;
  font-size: 14px;
  color: #4B5563;
}

.spinner {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  border: 2px solid #E4EAF6;
  border-top-color: #0B3D8E;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- ALERTAS (st.warning / st.info / st.error) ---------- */
.alert {
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
}

.alert:last-child {
  margin-bottom: 0;
}

.alert-warning {
  background: #FFF7E6;
  border-left-color: #E0A315;
  color: #7A5606;
}

.alert-info {
  background: #E4EAF6;
  border-left-color: #0B3D8E;
  color: #0B3D8E;
}

.alert-error {
  background: #FDECEC;
  border-left-color: #C62828;
  color: #8E1D1D;
}

/* ---------- MARKDOWN (st.write / st.markdown) ---------- */
.markdown-body {
  font-size: 15px;
  line-height: 1.7;
  color: #1B1F27;
  word-break: break-word;
}

.markdown-body p {
  margin-bottom: 14px;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #0B3D8E;
  margin: 16px 0 8px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 14px 22px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body a {
  color: #0B3D8E;
  text-decoration: underline;
}

.markdown-body code {
  background: #EDEFF4;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- EXPANDER (st.expander) ---------- */
.expander {
  background: #ffffff;
  border: 1px solid #E7E9EE;
  border-radius: 16px;
  overflow: hidden;
}

.expander > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #0B3D8E;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.expander > summary::-webkit-details-marker {
  display: none;
}

.expander > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #0B3D8E;
  border-bottom: 2px solid #0B3D8E;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.expander[open] > summary::before {
  transform: rotate(45deg);
}

/* ---------- DATAFRAME (st.dataframe) ---------- */
.dataframe-wrap {
  overflow-x: auto;
  border-top: 1px solid #EDEEF2;
  max-height: 420px;
  overflow-y: auto;
}

.dataframe {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dataframe thead th {
  position: sticky;
  top: 0;
  background: #F7F8FA;
  color: #6B7280;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #E7E9EE;
  white-space: nowrap;
  z-index: 1;
}

.dataframe tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #F0F1F5;
  color: #1B1F27;
  vertical-align: top;
}

.dataframe tbody tr:hover td {
  background: #F7F8FA;
}

.dataframe .col-index {
  color: #9AA1AC;
  width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dataframe .col-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dataframe a {
  color: #0B3D8E;
  text-decoration: underline;
  white-space: nowrap;
}

.dataframe .col-text {
  max-width: 420px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dataframe .col-text.expanded {
  white-space: pre-wrap;
  overflow: visible;
}

/* ---------- MÉTRICAS (st.columns + st.metric) ---------- */
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.metric {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
  padding: 18px 22px;
}

.metric-label {
  font-size: 13px;
  color: #8A8F98;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  color: #0B3D8E;
  font-variant-numeric: tabular-nums;
}

/* ---------- MODAL DE CRÉDITOS (show_credits_modal) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 22, 44, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(10, 20, 50, 0.25);
  padding: 24px;
  width: 100%;
  max-width: 480px;
}

.modal .markdown-body {
  margin-top: 12px;
  font-size: 14px;
}

.modal-close {
  margin-top: 20px;
  width: 100%;
}

/* ---------- CONTEÚDO COM RESULTADOS ---------- */
.content:has(.results:not([hidden])) {
  justify-content: flex-start;
}

.sidebar.collapsed .menu-body,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-footer span {
  display: none;
}

/* ---------- PERGUNTAS SUGERIDAS PELA VALIDAÇÃO ---------- */
/* Ficam dentro da própria div do texto, como lista de links. */
.suggestion-list {
  margin: 14px 0 0 22px;
}

.suggestion-list li {
  margin-bottom: 10px;
}

.suggestion-list li:last-child {
  margin-bottom: 0;
}

.suggestion-link {
  color: #0B3D8E;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  line-height: 1.6;
}

.suggestion-link:hover {
  color: #0A3378;
  background: #E4EAF6;
  border-radius: 3px;
}

.suggestion-link:focus-visible {
  outline: 2px solid #0B3D8E;
  outline-offset: 2px;
}

/* ---------- CONVERSAS RECENTES ---------- */
.recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.recent-item:hover {
  background: #F1F4F9;
}

.recent-item:focus-visible {
  outline: 2px solid #0B3D8E;
  outline-offset: -2px;
}

.recent-item.active {
  background: #E4EAF6;
}

.recent-item.active .recent-question {
  color: #0B3D8E;
  font-weight: 600;
}

.recent-question {
  font-size: 14px;
  color: #1B1F27;
  line-height: 1.3;
}

.recent-date {
  font-size: 12px;
  color: #9AA1AC;
}

.recent-empty {
  font-size: 13px;
  color: #9AA1AC;
  padding: 4px 10px;
}

/* ---------- DROPDOWN DE PARÂMETROS (badge "IA Informed") ---------- */
.badge-wrap {
  position: relative;
}

.badge:hover {
  background: rgba(255, 255, 255, 0.2);
}

.badge:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.badge-caret {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}

.badge.open .badge-caret {
  transform: rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid #E7E9EE;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 20, 50, 0.18);
  padding: 20px;
  z-index: 40;
  text-align: left;
  color: #1B1F27;
}

.dropdown-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9AA1AC;
  padding-bottom: 12px;
  border-bottom: 1px solid #EDEEF2;
  margin-bottom: 18px;
}

.dropdown-panel .param-field-last {
  margin-bottom: 0;
}

/* Dentro do dropdown o tooltip abre para baixo: acima ficaria sobre a topbar. */
.dropdown-panel .param-help::after {
  top: 150%;
  bottom: auto;
}

@media (max-width: 600px) {
  .dropdown-panel {
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}

/* ---------- LOGO CLICÁVEL (volta à tela inicial) ---------- */
.logo {
  cursor: pointer;
}

/* ---------- REFERÊNCIAS AGRUPADAS NA RESPOSTA ---------- */
/* Chip clicável, no lugar da lista de ISBNs dentro dos parênteses. */
.ref-chip {
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  vertical-align: middle;
  border: 1px solid #C6D6EE;
  border-radius: 9999px;
  background: #E9EFFA;
  color: #0B3D8E;
  font-family: inherit;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.ref-chip svg {
  width: 12px;
  height: 12px;
}

.ref-chip:hover {
  background: #D8E3F5;
  border-color: #A9C2E4;
  color: #0A3378;
}

.ref-chip[aria-expanded="true"] {
  background: #0B3D8E;
  border-color: #0B3D8E;
  color: #ffffff;
}

.ref-chip:focus-visible {
  outline: 2px solid #0B3D8E;
  outline-offset: 2px;
}

.ref-popover {
  position: absolute;
  z-index: 60;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #E7E9EE;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(10, 20, 50, 0.18);
  overflow: hidden;
}

.ref-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #EDEEF2;
}

.ref-popover-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8A8F98;
}

.ref-popover-count {
  font-size: 12px;
  color: #9AA1AC;
}

.ref-popover-list {
  max-height: 260px;
  overflow-y: auto;
}

.ref-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F0F1F5;
}

.ref-item:last-child {
  border-bottom: none;
}

.ref-item-number {
  font-size: 13px;
  font-weight: 500;
  color: #9AA1AC;
  min-width: 18px;
  padding-top: 1px;
}

.ref-item-body {
  min-width: 0;
}

.ref-item-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0B3D8E;
  line-height: 1.35;
  text-decoration: none;
  word-break: break-word;
}

.ref-item-title:hover {
  text-decoration: underline;
}

.ref-item-meta {
  font-size: 12px;
  line-height: 1.5;
  color: #8A8F98;
  margin-top: 4px;
}

/* ---------- PERGUNTAS SUGERIDAS PELA VALIDAÇÃO ---------- */
/* Ficam dentro da própria div do texto, como lista de links. */
.suggestion-list {
  margin: 14px 0 0 22px;
}

.suggestion-list li {
  margin-bottom: 10px;
}

.suggestion-list li:last-child {
  margin-bottom: 0;
}

.suggestion-link {
  color: #0B3D8E;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  line-height: 1.6;
}

.suggestion-link:hover {
  color: #0A3378;
  background: #E4EAF6;
  border-radius: 3px;
}

.suggestion-link:focus-visible {
  outline: 2px solid #0B3D8E;
  outline-offset: 2px;
}

/* ---------- CONVERSAS RECENTES ---------- */
.recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.recent-item:hover {
  background: #F1F4F9;
}

.recent-item:focus-visible {
  outline: 2px solid #0B3D8E;
  outline-offset: -2px;
}

.recent-item.active {
  background: #E4EAF6;
}

.recent-item.active .recent-question {
  color: #0B3D8E;
  font-weight: 600;
}

.recent-question {
  font-size: 14px;
  color: #1B1F27;
  line-height: 1.3;
}

.recent-date {
  font-size: 12px;
  color: #9AA1AC;
}

.recent-empty {
  font-size: 13px;
  color: #9AA1AC;
  padding: 4px 10px;
}

/* ---------- DROPDOWN DE PARÂMETROS (badge "IA Informed") ---------- */
.badge-wrap {
  position: relative;
}

.badge:hover {
  background: rgba(255, 255, 255, 0.2);
}

.badge:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.badge-caret {
  width: 14px;
  height: 14px;
  transition: transform 0.18s ease;
}

.badge.open .badge-caret {
  transform: rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid #E7E9EE;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 20, 50, 0.18);
  padding: 20px;
  z-index: 40;
  text-align: left;
  color: #1B1F27;
}

.dropdown-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9AA1AC;
  padding-bottom: 12px;
  border-bottom: 1px solid #EDEEF2;
  margin-bottom: 18px;
}

.dropdown-panel .param-field-last {
  margin-bottom: 0;
}

/* Dentro do dropdown o tooltip abre para baixo: acima ficaria sobre a topbar. */
.dropdown-panel .param-help::after {
  top: 150%;
  bottom: auto;
}

@media (max-width: 600px) {
  .dropdown-panel {
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}

/* ---------- LOGO CLICÁVEL (volta à tela inicial) ---------- */
.logo {
  cursor: pointer;
}

/* ---------- REFERÊNCIA DE ISBN NA RESPOSTA ---------- */
.isbn-ref {
  color: #0B3D8E;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: help;
  font-variant-numeric: tabular-nums;
}

.isbn-ref:hover,
.isbn-ref:focus {
  background: #E4EAF6;
  border-radius: 3px;
  text-decoration-style: solid;
  outline: none;
}

.isbn-card {
  position: absolute;
  z-index: 60;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #E7E9EE;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(10, 20, 50, 0.18);
  padding: 14px 16px;
  pointer-events: none;
}

.isbn-card-isbn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #8A8F98;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.isbn-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0B3D8E;
  line-height: 1.35;
  margin-bottom: 8px;
}

.isbn-card-text {
  font-size: 13px;
  line-height: 1.55;
  color: #4B5563;
}

/* Caixa de referência com mais de um conteúdo no mesmo rótulo */
.isbn-card-divider {
  border-top: 1px solid #EDEEF2;
  margin: 10px 0;
}

.isbn-card-more {
  margin-top: 10px;
  font-size: 12px;
  color: #9AA1AC;
}

/* ---------- BOTÃO "FAZER NOVA PERGUNTA" ---------- */
.new-question {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.new-question .btn-primary {
  padding: 13px 30px;
  font-size: 15px;
}

/* ---------- AVISO DE USO (tela inicial) ---------- */
.disclaimer-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: #FFF7E6;
  border: 1px solid #F0D9A6;
  border-left: 5px solid #E0A315;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 36px;
}

.disclaimer-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  color: #B57F0A;
  margin-top: 1px;
}

.disclaimer-content p {
  font-size: 14px;
  line-height: 1.6;
  color: #6B4E06;
}

.disclaimer-channel {
  margin-top: 10px;
  font-weight: 600;
}

.disclaimer-channel a {
  color: #8A6206;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.disclaimer-channel a:hover {
  color: #5E4204;
}

.disclaimer-channel a:focus-visible {
  outline: 2px solid #B57F0A;
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 600px) {
  .disclaimer-box {
    padding: 14px 16px;
    gap: 10px;
    margin-bottom: 24px;
  }

  .disclaimer-content p {
    font-size: 13px;
  }
}
