:root {
  --athena-ink: #14211c;
  --athena-forest: #0b4f3d;
  --athena-forest-deep: #06291f;
  --athena-mint: #f0f7f4;
  --athena-line: #e2e8e5;
  --athena-muted: #667872;
  --athena-paper: #f5f6f5;
  --athena-card: #ffffff;
  --athena-warn: #9a6700;
  --athena-danger: #8b2e2e;
  --athena-font-sans: "Manrope", "Segoe UI", sans-serif;
  --athena-font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --athena-font-data: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --athena-shell: 72rem;
  --athena-radius: 0.7rem;
  --athena-header-h: 3.25rem;
}

body.athena {
  font-family: var(--athena-font-sans);
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--athena-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--athena-paper);
}

.athena-shell {
  max-width: var(--athena-shell);
  margin-left: auto;
  margin-right: auto;
}

/* —— Topo compacto —— */
.athena-header {
  background: var(--athena-forest-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 40;
}

.athena-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--athena-header-h);
  padding: 0.55rem 1rem;
}

.athena-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.athena-header-brand img {
  height: 2rem;
  width: auto;
  flex-shrink: 0;
}

.athena-header-brand-text {
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding-left: 0.75rem;
}

.athena-kicker {
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(236, 253, 245, 0.55);
  line-height: 1.2;
}

.athena-header-area {
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ecfdf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athena-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(236, 253, 245, 0.78);
  font-size: 0.78rem;
  text-align: right;
  flex-shrink: 0;
}

.athena-header-user strong {
  display: block;
  color: #ecfdf5;
  font-weight: 600;
  font-size: 0.82rem;
}

.athena-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--athena-line);
  position: sticky;
  top: var(--athena-header-h);
  z-index: 30;
}

.athena-toolbar-inner {
  padding: 0.55rem 1rem 0;
}

/* Áreas — segmentado compacto */
.athena-areas {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 0.55rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.athena-areas::-webkit-scrollbar {
  display: none;
}

.athena-area-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--athena-line);
  background: #fafbfa;
  color: var(--athena-ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.athena-area-chip:hover {
  border-color: color-mix(in srgb, var(--area-cor, var(--athena-forest)) 40%, var(--athena-line));
  background: #fff;
}

.athena-area-chip.is-active {
  background: var(--area-cor, var(--athena-forest));
  border-color: var(--area-cor, var(--athena-forest));
  color: #fff;
}

.athena-area-chip .athena-area-count {
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.athena-area-chip.is-active .athena-area-count {
  opacity: 0.9;
}

/* Nav módulos — abas sob linha */
.athena-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow-x: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  border-top: 1px solid var(--athena-line);
  scrollbar-width: none;
}

.athena-nav::-webkit-scrollbar {
  display: none;
}

.athena-nav a {
  flex: 0 0 auto;
  position: relative;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--athena-muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
}

.athena-nav a:hover {
  color: var(--athena-forest);
}

.athena-nav a.is-active {
  color: var(--athena-forest-deep);
  background: transparent;
  border: 0;
}

.athena-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--athena-forest);
}

/* —— Conteúdo —— */
.painel-scroll {
  padding: 1rem 1rem 5.5rem;
}

@media (min-width: 768px) {
  .painel-scroll {
    padding: 1.15rem 1rem 2rem;
  }
}

.athena-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.athena-page-head p {
  margin-top: 0.2rem;
  color: var(--athena-muted);
  font-size: 0.84rem;
}

.athena-brand {
  font-family: var(--athena-font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.athena-prose {
  font-family: var(--athena-font-serif);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--athena-ink);
}

.athena-prose p + p {
  margin-top: 0.85em;
}

.athena-prose ul {
  margin-top: 0.5em;
  padding-left: 1.25rem;
  list-style: disc;
}

.athena-prose li + li {
  margin-top: 0.35em;
}

.athena-data {
  font-family: var(--athena-font-data);
  font-size: 0.8em;
  letter-spacing: 0.01em;
}

.athena-card {
  background: var(--athena-card);
  border: 1px solid var(--athena-line);
  border-radius: var(--athena-radius);
  box-shadow: none;
}

.athena-card-title {
  font-family: var(--athena-font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--athena-forest-deep);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.athena-stat {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--athena-forest-deep);
}

.athena-kpi {
  display: block;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}

a.athena-kpi:hover {
  border-color: #b7c9c0;
  background: #fcfdfc;
}

.athena-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--athena-muted);
}

.athena-kpi-value {
  margin-top: 0.25rem;
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--athena-forest-deep);
  line-height: 1.1;
}

.athena-kpi-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--athena-muted);
}

.athena-table-head {
  background: var(--athena-mint);
  color: var(--athena-forest-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.athena-table-head th {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.athena-field {
  border: 1px solid var(--athena-line);
  border-radius: 0.6rem;
  background: #fbfcfb;
  padding: 0.65rem 0.8rem;
}

.athena-field dt {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--athena-muted);
}

.athena-field dd {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--athena-ink);
}

.athena-flash {
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.athena-flash-ok {
  background: #ecfdf5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}

.athena-flash-erro {
  background: #fef2f2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
}

.athena-meta {
  color: rgba(236, 253, 245, 0.78);
  font-size: 0.78rem;
  line-height: 1.35;
}

.athena-btn {
  font-family: var(--athena-font-sans);
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.84rem;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.athena-btn-primary {
  background: var(--athena-forest);
  color: #fff;
}

.athena-btn-primary:hover {
  background: #0a5c47;
}

.athena-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ecfdf5;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.athena-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.athena-btn-light {
  background: #fff;
  color: var(--athena-forest-deep);
  border: 1px solid var(--athena-line);
}

.athena-btn-light:hover {
  border-color: #b7c9c0;
}

/* Âncoras de Ajustes / seções — não ficam sob o header nem a bottom nav */
[id^="athena-"] {
  scroll-margin-top: calc(var(--athena-header-h) + 0.75rem);
}

@media (max-width: 767px) {
  [id^="athena-"] {
    scroll-margin-bottom: 5.5rem;
  }
}

.athena-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--athena-line);
}

.athena-bottom-nav a {
  text-decoration: none;
}

.athena-sync-line {
  font-size: 0.72rem;
  color: rgba(236, 253, 245, 0.55);
  max-width: 16rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  .athena-header-brand-text {
    display: none;
  }

  .athena-sync-line {
    display: none;
  }

  .painel-scroll {
    padding-bottom: 5.25rem;
  }
}

@media (max-width: 639px) {
  .ficha-scroll {
    padding-bottom: 5.5rem;
  }
}

/* —— Portal público —— */
body.portal-cliente {
  background: #f4f6f5;
}

.portal-hero {
  background: #022c22;
}

.portal-hero-visual {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 70% 20%, rgba(5, 150, 105, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(2, 44, 34, 0.9), transparent 50%),
    linear-gradient(165deg, #064e3b 0%, #022c22 48%, #011914 100%);
  animation: portal-hero-drift 28s ease-in-out infinite alternate;
}

.portal-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(236, 253, 245, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 253, 245, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.portal-hero-glow {
  position: absolute;
  width: 70%;
  height: 50%;
  left: 15%;
  top: 10%;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.28), transparent 70%);
  animation: portal-glow 8s ease-in-out infinite alternate;
}

@keyframes portal-hero-drift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.08) translateY(-2%); }
}

@keyframes portal-glow {
  from { opacity: 0.55; transform: translateY(0); }
  to { opacity: 1; transform: translateY(12px); }
}

.portal-reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: portal-fade-up 0.7s ease forwards;
}

.portal-reveal-delay-1 { animation-delay: 0.12s; }
.portal-reveal-delay-2 { animation-delay: 0.24s; }
.portal-reveal-delay-3 { animation-delay: 0.36s; }

@keyframes portal-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

.portal-feature-mark {
  display: block;
  width: 2.25rem;
  height: 0.2rem;
  background: #064e3b;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .portal-hero-visual,
  .portal-hero-glow,
  .portal-reveal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* —— Gestão kanban —— */
.gestao-kanban {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gestao-coluna {
  flex: 0 0 min(16.5rem, 80vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  max-height: min(68vh, 34rem);
  border-radius: var(--athena-radius);
}

.gestao-coluna-body {
  overflow-y: auto;
  flex: 1;
}

.gestao-card {
  transition: border-color 0.12s ease;
  border-radius: 0.55rem;
}

.gestao-card:hover {
  border-color: #b7c9c0;
}

@media (min-width: 1280px) {
  .gestao-coluna {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* —— Proposta de defesa —— */
.proposta-preview {
  box-shadow: inset 0 1px 0 rgba(15, 31, 26, 0.03);
}

.proposta-preview,
.proposta-preview #preview-corpo {
  font-family: var(--athena-font-serif);
}

.proposta-preview #preview-titulo {
  font-family: var(--athena-font-serif);
  font-weight: 600;
}

.proposta-editor textarea#proposta-corpo {
  font-family: var(--athena-font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
}

.proposta-editor textarea:focus,
.proposta-editor input:focus {
  outline: 2px solid rgba(11, 79, 61, 0.22);
  outline-offset: 1px;
}

@media (min-width: 1024px) {
  .proposta-preview {
    position: sticky;
    top: 7.5rem;
    max-height: calc(100vh - 8.5rem);
    overflow-y: auto;
  }
}

/* Login */
.athena-login-wrap {
  min-height: calc(100vh - var(--athena-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.athena-login-card {
  width: 100%;
  max-width: 24rem;
  padding: 1.75rem 1.5rem;
}

/* —— Chat inbox —— */
.athena-nav a {
  position: relative;
}

.athena-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #9a3412;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.athena-nav-badge[hidden] {
  display: none !important;
}

.athena-nav-badge-mobile {
  position: absolute;
  top: 0.2rem;
  right: 0.55rem;
  margin: 0;
}

body.athena-modo-chat {
  --athena-shell: 86rem;
}

body.athena-modo-chat .painel-scroll {
  padding-top: 0.65rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  body.athena-modo-chat .painel-scroll {
    padding-bottom: 1.25rem;
  }
}

.athena-chat-wrap {
  --chat-linha: rgba(15, 31, 26, 0.1);
  --chat-lista-w: clamp(17rem, 30vw, 22.5rem);
}

.athena-chat-pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.athena-chat-pagehead p {
  margin-top: 0.15rem;
  color: var(--athena-muted);
  font-size: 0.84rem;
}

.athena-chat-pagehead-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--athena-forest);
  background: rgba(11, 79, 61, 0.08);
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
}

.athena-chat {
  display: grid;
  grid-template-columns: var(--chat-lista-w) minmax(0, 1fr);
  height: min(calc(100vh - 11.5rem), 44rem);
  min-height: 22rem;
  border-radius: var(--athena-radius);
  border: 1px solid var(--chat-linha);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 31, 26, 0.04);
}

.athena-chat-lista {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--chat-linha);
  background: linear-gradient(180deg, #f7faf8 0%, #f3f6f4 100%);
}

.athena-chat-lista-head {
  flex-shrink: 0;
  padding: 0.85rem 0.9rem 0.75rem;
  border-bottom: 1px solid var(--chat-linha);
  background: rgba(255, 255, 255, 0.72);
}

.athena-chat-filtros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.65rem;
  padding: 0.2rem;
  border-radius: 0.55rem;
  background: rgba(15, 31, 26, 0.05);
}

.athena-chat-filtros button {
  border: 0;
  background: transparent;
  border-radius: 0.4rem;
  padding: 0.4rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--athena-muted);
  cursor: pointer;
}

.athena-chat-filtros button.is-active {
  background: #fff;
  color: var(--athena-forest-deep);
  box-shadow: 0 1px 2px rgba(15, 31, 26, 0.08);
}

.athena-chat-busca {
  width: 100%;
  border: 1px solid #d6ddd8;
  border-radius: 0.55rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  background: #fff;
}

.athena-chat-busca:focus {
  outline: 2px solid rgba(11, 79, 61, 0.22);
  outline-offset: 1px;
}

.athena-chat-threads {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.athena-chat-thread {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--chat-linha);
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}

.athena-chat-thread:hover {
  background: rgba(27, 94, 69, 0.06);
}

.athena-chat-thread.is-active {
  background: rgba(27, 94, 69, 0.12);
  box-shadow: inset 3px 0 0 #1b5e45;
}

.athena-chat-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ecfdf5;
  background: linear-gradient(145deg, #1b5e45, #0b4f3d);
  flex-shrink: 0;
}

.athena-chat-avatar-lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.8rem;
}

.athena-chat-thread-body {
  min-width: 0;
}

.athena-chat-thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.athena-chat-thread-nome {
  font-weight: 650;
  color: #1c2b24;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athena-chat-thread-hora {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: #7a8a82;
}

.athena-chat-badge {
  flex-shrink: 0;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #1b5e45;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.athena-chat-thread-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #6b7a72;
}

.athena-chat-thread-prev {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #4a5a52;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athena-chat-painel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background:
    linear-gradient(180deg, #eef3f0 0%, #f6f8f7 40%, #f3f6f4 100%);
}

.athena-chat-painel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--chat-linha);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
}

.athena-chat-voltar {
  display: none;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--chat-linha);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--athena-forest-deep);
  font-size: 1.1rem;
  cursor: pointer;
}

.athena-chat-painel-head-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.athena-chat-contato {
  font-family: var(--athena-font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: #14241c;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athena-chat-telefone {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--athena-muted);
}

.athena-chat-painel-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.athena-chat-acao,
.athena-chat-tool {
  border: 1px solid #d6ddd8;
  background: #fff;
  color: var(--athena-forest-deep);
  border-radius: 0.45rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.athena-chat-acao:hover,
.athena-chat-tool:hover:not(:disabled) {
  border-color: #b7c9c0;
  background: #f4faf7;
}

.athena-chat-tool:disabled,
.athena-chat-acao[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.athena-chat-casos {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--chat-linha);
  background: rgba(255, 255, 255, 0.55);
}

.athena-chat-casos[hidden] {
  display: none !important;
}

.athena-chat-caso-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(27, 94, 69, 0.22);
  background: rgba(27, 94, 69, 0.07);
  color: var(--athena-forest-deep);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athena-chat-caso-chip:hover {
  background: rgba(27, 94, 69, 0.12);
}

.athena-chat-caso-chip span {
  font-weight: 500;
  color: var(--athena-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.athena-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  overscroll-behavior: contain;
}

.athena-chat-empty-painel {
  margin: auto;
  max-width: 18rem;
  text-align: center;
  color: var(--athena-muted);
  font-size: 0.88rem;
  padding: 2rem 1rem;
}

.athena-chat-empty-titulo {
  font-family: var(--athena-font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #1c2b24;
  margin-bottom: 0.35rem;
}

.athena-chat-dia {
  align-self: center;
  margin: 0.55rem 0 0.25rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--chat-linha);
  font-size: 0.68rem;
  font-weight: 650;
  color: #5a6b63;
  letter-spacing: 0.02em;
}

.athena-chat-bubble {
  max-width: min(78%, 34rem);
  padding: 0.65rem 0.85rem 0.45rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(15, 31, 26, 0.04);
  animation: athena-chat-in 0.18s ease;
}

@keyframes athena-chat-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.athena-chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.athena-chat-bubble time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  opacity: 0.65;
}

.athena-chat-bubble-in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--chat-linha);
  border-bottom-left-radius: 0.25rem;
}

.athena-chat-bubble-out {
  align-self: flex-end;
  background: #1b5e45;
  color: #f4faf7;
  border-bottom-right-radius: 0.25rem;
}

.athena-chat-composer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tools tools"
    "text send";
  gap: 0.55rem 0.65rem;
  padding: 0.75rem 1rem 0.9rem;
  border-top: 1px solid var(--chat-linha);
  background: rgba(255, 255, 255, 0.92);
}

.athena-chat-composer-tools {
  grid-area: tools;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.athena-chat-hint {
  font-size: 0.68rem;
  color: #8a9a92;
}

.athena-chat-composer textarea {
  grid-area: text;
  width: 100%;
  resize: none;
  border: 1px solid #d6ddd8;
  border-radius: 0.7rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  min-height: 2.9rem;
  max-height: 8rem;
  background: #fff;
  font-family: inherit;
}

.athena-chat-composer textarea:focus {
  outline: 2px solid rgba(11, 79, 61, 0.22);
  outline-offset: 1px;
}

.athena-chat-composer button[type="submit"] {
  grid-area: send;
  align-self: end;
  padding: 0.7rem 1.15rem;
  min-height: 2.9rem;
}

.athena-chat-vazio {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7a72;
}

.athena-chat-somente-leitura {
  flex-shrink: 0;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--chat-linha);
  font-size: 0.85rem;
  color: #6b7a72;
  background: rgba(255, 255, 255, 0.85);
}

.athena-chat-webhook {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--athena-muted);
}

.athena-chat-webhook summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--athena-forest-deep);
}

.athena-chat-webhook code {
  display: block;
  margin: 0.45rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  background: #f0f3f1;
  word-break: break-all;
  font-size: 0.72rem;
}

/* Mobile: uma coluna por vez */
@media (max-width: 767px) {
  .athena-chat {
    grid-template-columns: 1fr;
    height: min(calc(100vh - 10.5rem), 38rem);
  }

  .athena-chat-lista {
    border-right: 0;
  }

  .athena-chat.has-conversa .athena-chat-lista {
    display: none;
  }

  .athena-chat:not(.has-conversa) .athena-chat-painel {
    display: none;
  }

  .athena-chat-voltar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .athena-chat-voltar[hidden] {
    display: none !important;
  }

  .athena-chat-hint {
    display: none;
  }

  .athena-chat-painel-acoes .athena-chat-acao {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
  }
}

@media (min-width: 768px) {
  .athena-chat-voltar {
    display: none !important;
  }
}

.athena-chat-dist {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  margin-bottom: 0.55rem;
}

.athena-chat-dist button {
  flex: 0 0 auto;
  border: 1px solid #d6ddd8;
  background: #fff;
  color: #3d4f47;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.athena-chat-dist button.is-active {
  background: #1b5e45;
  border-color: #1b5e45;
  color: #f4faf7;
}

.athena-chat-area {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(27, 94, 69, 0.1);
  color: #1b5e45;
  font-size: 0.68rem;
  font-weight: 700;
}

.athena-chat-area-escolha select,
.chatbot-no select,
.chatbot-no input,
.chatbot-no textarea {
  width: 100%;
  border: 1px solid #d6ddd8;
  border-radius: 0.45rem;
  background: #fff;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}

.athena-chat-painel-acoes {
  flex-wrap: wrap;
}

.chatbot-board {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1rem;
}

.chatbot-no {
  border: 1px solid #d6ddd8;
  border-radius: 0.8rem;
  background: #fff;
  padding: 0.85rem;
}

.chatbot-no.is-inicio {
  border-color: #1b5e45;
  box-shadow: 0 0 0 2px rgba(27, 94, 69, 0.12);
}

.chatbot-no-head,
.chatbot-opcao,
.chatbot-proximo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.chatbot-no-head {
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.chatbot-opcao,
.chatbot-proximo {
  margin-top: 0.45rem;
}

.chatbot-opcao input,
.chatbot-opcao select,
.chatbot-proximo select {
  flex: 1 1 8rem;
}

.chatbot-liga {
  width: 2px;
  height: 1rem;
  margin-left: 1.4rem;
  background: #1b5e45;
}

.chatbot-sim-log {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
  max-height: 16rem;
  overflow: auto;
}

.chatbot-sim-log p {
  margin: 0;
  max-width: 80%;
  padding: 0.45rem 0.65rem;
  border-radius: 0.7rem;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.chatbot-sim-cli {
  align-self: flex-end;
  background: #1b5e45;
  color: #f4faf7;
}

.chatbot-sim-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #d6ddd8;
}
