/* Painel lateral de perguntas rápidas (/btw) — drawer fixo à direita. */

.btw-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 92vw);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border-left: 1px solid var(--panel-hover);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35);
}

.btw-panel[hidden] {
  display: none;
}

.btw-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-hover);
}

.btw-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.btw-hint {
  flex: 1;
  font-size: 11px;
  color: var(--text-soft);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btw-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btw-msg {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.btw-msg :first-child {
  margin-top: 0;
}

.btw-msg :last-child {
  margin-bottom: 0;
}

.btw-q {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
  white-space: pre-wrap;
}

.btw-a {
  align-self: flex-start;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--panel-hover);
}

.btw-a .btw-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  animation: btw-blink 0.9s steps(2, start) infinite;
}

@keyframes btw-blink {
  to {
    visibility: hidden;
  }
}

.btw-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--panel-hover);
  background: var(--bg-elev);
}

.btw-composer textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--panel-hover);
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.btw-composer textarea:focus {
  outline: none;
  border-color: var(--accent-line);
}

@media (max-width: 720px) {
  .btw-panel {
    width: 100vw;
    border-left: none;
  }
}
