/* TodaRota · Sétima */

/* O PAINEL é COLUNA DE LAYOUT, não sobreposição */

#setima-slot {
  flex: none;
  width: 380px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-chrome);
  border-left: 1px solid var(--line-chrome);
}
#setima-slot[hidden] { display: none; }

.st-painel__head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--chrome-h);
  padding: 0 var(--s3) 0 var(--s4);
  border-bottom: 1px solid var(--line-chrome);
}

.st-painel__head .st-quem { margin-right: auto; }

/* A TELA CHEIA */

.st-cheia {
  display: flex;
  height: 100%;
  min-height: 0;

  margin: calc(-1 * var(--s7));
}

.st-lado {
  flex: none;
  width: 268px;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  border-right: 1px solid var(--line-chrome);
  min-height: 0;
}
.st-nova { justify-content: center; }
.st-cvs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.st-lado__nota { font-size: var(--t-xs); color: var(--text-6); line-height: 1.5; }

.st-cv {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: var(--r-item);
  font: inherit;
  font-size: 13px;
  color: var(--text-4);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.st-cv span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-cv small { color: var(--text-6); font-variant-numeric: tabular-nums; }
.st-cv:hover { background: var(--item-hover); color: var(--text-2); }
.st-cv.is-on { background: var(--ativo-bg); color: var(--accent); transition: none; }

.st-dialogo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--s7);
}

.st-dialogo .pagehead { margin: 0 calc(-1 * var(--s7)) var(--s4); }

/* O fluxo da conversa (compartilhado) */

.st-fluxo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.st-cheia .st-fluxo { padding: var(--s4) 0; }

.st-msg { max-width: 720px; }
.st-msg--voce { align-self: flex-end; max-width: 560px; }

.st-bolha {
  padding: 10px var(--s4);
  background: var(--bg-card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
  font-size: var(--t-md);
  line-height: 1.55;
}

.st-quem {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: var(--t-xs);
  font-weight: 600;
  font-family: var(--font-mono); letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-5);
}
.st-quem .nav__icon { color: var(--accent); }

.st-corpo { font-size: var(--t-md); line-height: 1.6; color: var(--text-2); }
.st-corpo p + p { margin-top: var(--s3); }
.st-pensando { color: var(--text-6); font-style: italic; }

/* O cartão de evidência */

.st-card {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--bg-card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
}
.st-card__t { font-weight: 600; margin-bottom: 4px; }
.st-card__l { font-size: var(--t-sm); color: var(--text-4); }
.st-card__a { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); }

.st-dica { margin-top: var(--s3); font-size: var(--t-sm); color: var(--text-6); }

.st-aviso {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--alert-bg);
  border: 1px solid var(--alert-line);
  border-radius: var(--r-control);
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--text-3);
}
.st-aviso strong { color: var(--accent); }

.st-acoes { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); }

/* As boas-vindas */

.st-boas { margin: auto; max-width: 560px; text-align: center; padding: var(--s5) 0; }
.st-boas__i { color: var(--accent); margin-bottom: var(--s3); }
.st-boas__i .nav__icon { width: 32px; height: 32px; }
.st-boas h2 { font-size: var(--t-title); font-weight: 600; letter-spacing: -.02em; margin-bottom: var(--s3); }
.st-boas p { font-size: var(--t-sm); color: var(--text-5); line-height: 1.6; }
.st-boas .st-sug { margin: var(--s5) 0; text-align: left; }

.st-sug { margin-top: var(--s4); display: flex; flex-direction: column; gap: 6px; }
.st-sug__op {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: 9px var(--s3);
  background: var(--bg-card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-control);
  font: inherit;
  font-size: var(--t-sm);
  color: var(--text-3);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.st-sug__op:hover { background: var(--bg-card-hover); border-color: var(--hairline-hover); }

/* O campo */

.st-campo { flex: none; padding: var(--s4); }
.st-cheia .st-campo { padding: var(--s4) 0 var(--s5); }
.st-campo__l { display: flex; align-items: center; gap: var(--s2); }
.st-campo__l .field { flex: 1; min-width: 0; }

.st-campo label { position: relative; cursor: pointer; }

.st-anexo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: var(--item-hover);
  border-radius: var(--r-control);
  font-size: var(--t-sm);
  color: var(--text-4);
}
.st-anexo--preso { margin-bottom: var(--s2); }

.st-anexo__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--r-pill);
  font: inherit;
  font-size: var(--t-xs);
  line-height: 1;
  color: var(--text-6);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.st-anexo__x:hover { background: var(--ghost-hover); color: var(--text-2); }
.st-msg--voce .st-anexo { margin-bottom: 6px; }

.st-cheia .st-fluxo,
.st-cheia .st-campo { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }

/* O PAINEL SOBREPÕE quando não sobra conteúdo para dividir: abaixo de 1100px de janela
   (380px de painel + 64px de menu deixariam menos de 600px), ele flutua sobre a tela, com
   véu, e fecha no véu, no ✕ e no Escape. Acima disso continua coluna de layout. */
@media (max-width: 1100px) {
  #setima-slot {
    position: fixed;
    top: var(--s3);
    right: var(--s3);
    bottom: var(--s3);
    z-index: 965;
    width: min(380px, calc(100vw - var(--sidebar-collapsed) - var(--s5)));
    border: 1px solid var(--line-chrome);
    border-radius: var(--r-panel);
    box-shadow: var(--sombra-drawer);
    overflow: hidden;
  }
  .shell.is-setima::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 960;
    background: rgba(0, 0, 0, .42);
    animation: fade .16s ease;
  }
}

/* A LISTA DE CONVERSAS VIRA GAVETA na tela cheia estreita (is-estreito na .main): some da
   coluna, abre pelo botão "Conversas" do cabeçalho por cima do diálogo, fecha no véu, no
   Escape e ao escolher uma conversa; o foco volta ao botão. */
.st-conversas-btn { display: none; }
.main.is-estreito .st-cheia { position: relative; }
.main.is-estreito .st-conversas-btn { display: inline-flex; }
.main.is-estreito .st-lado { display: none; }
.main.is-estreito .st-cheia.is-gaveta .st-lado {
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  width: min(300px, calc(100% - var(--s6)));
  background: var(--bg-chrome);
  box-shadow: var(--sombra-drawer);
  overflow-y: auto;
}
.main.is-estreito .st-cheia.is-gaveta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, .42);
}
.main.is-estreito .st-dialogo { padding: 0 var(--s5); }
.main.is-estreito .st-dialogo .pagehead { margin: 0 calc(-1 * var(--s5)) var(--s4); }
.st-lado__topo { display: flex; gap: var(--s2); align-items: center; }
.st-lado__topo .st-nova { flex: 1; }
.st-lado__fechar { display: none; flex: none; }
.main.is-estreito .st-cheia.is-gaveta .st-lado__fechar { display: inline-flex; }
