/* System-wide visual polish: scrollbar, hierarchy and chat layout */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.75) rgba(2,6,23,.18);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(2,6,23,.18);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56,189,248,.95), rgba(37,99,235,.82));
  border-radius: 999px;
  border: 2px solid rgba(2,6,23,.72);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(125,211,252,1), rgba(59,130,246,.95));
}

#greeting-eyebrow {
  display: none !important;
}

h1,
#hero-title {
  font-size: clamp(1.65rem, 2.25vw, 2.8rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.045em !important;
  margin-top: 0 !important;
}

.hero-mission h2,
#mission-title {
  font-size: clamp(1.05rem, 1.45vw, 1.55rem) !important;
  line-height: 1.18 !important;
}

.hero-mission p,
#mission-description {
  font-size: .92rem !important;
  line-height: 1.48 !important;
}

.small-card h3,
#next-action-title {
  font-size: clamp(.98rem, 1.1vw, 1.18rem) !important;
  line-height: 1.25 !important;
}

.presence-and-chat {
  grid-template-rows: minmax(132px, .25fr) minmax(520px, .75fr) !important;
}

.conversation-panel {
  grid-template-rows: auto minmax(300px, 1fr) auto auto auto !important;
  padding: clamp(16px, 1.7vw, 24px) !important;
  overflow: hidden !important;
}

.messages {
  min-height: 300px !important;
  padding-right: 8px !important;
}

.chat-form input,
.chat-form textarea,
#message-input {
  min-height: 64px !important;
  font-size: 1rem !important;
  padding: 18px !important;
  border-radius: 18px !important;
}

.chat-form .voice-panel {
  align-self: center;
  width: 44px;
  min-width: 44px;
  margin: 0 !important;
  justify-content: center;
}

.chat-form .voice-panel button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.chat-form button {
  width: 66px !important;
  min-width: 66px !important;
  min-height: 64px !important;
  border-radius: 18px !important;
}

.quick-actions {
  margin-top: 10px !important;
}

.message .normal-response > *:first-child,
.message > p > *:first-child { margin-top: 0; }

.message .normal-response > *:last-child,
.message > p > *:last-child { margin-bottom: 0; }

.message pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 10px;
  background: rgba(2, 6, 23, .55);
}

.message code {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.message a { color: #38bdf8; }

@media (max-width: 1080px) {
  .presence-and-chat {
    grid-template-rows: minmax(140px, auto) minmax(560px, 1fr) !important;
  }
}

@media (max-width: 780px) {
  h1,
  #hero-title {
    font-size: clamp(1.8rem, 8vw, 2.55rem) !important;
  }

  .conversation-panel {
    min-height: 580px !important;
  }

  .messages {
    min-height: 310px !important;
  }
}

/* Hotfix: manter caixa de texto visível depois de respostas longas */
.priority-chat {
  min-height: 0;
}

#conversation-log,
.conversation-log {
  min-height: 0;
  overflow-y: auto;
}

#chat-form {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding-top: 0.75rem;
  background: rgba(3, 10, 24, 0.96);
  border-top: 1px solid rgba(125, 211, 252, 0.16);
  backdrop-filter: blur(10px);
}

#chat-form textarea,
#chat-form input[type="text"] {
  max-height: 160px;
}
