/*
 * Canonical conversation surface used by Portfolio Studio and Portfolio Monitor.
 * Keep product-specific controls in their owning page; typography, messages and
 * the composer belong here so the two assistants cannot visually drift.
 */
:root {
  --conversation-navy: #061852;
  --conversation-blue: #0868f5;
  --conversation-border: #e7dfd6;
  --conversation-copy: #6e83aa;
}

:is(.conversation-panel, #portfolio-chat) {
  border: 1px solid var(--conversation-border);
  border-radius: 17px;
  background: #fff;
  color: var(--conversation-navy);
  box-shadow: 0 12px 32px rgba(6, 24, 82, .055);
  overflow: hidden;
}

:is(.conversation-panel, #portfolio-chat) > .conversation-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 16px;
  margin: 0;
  padding: 30px 24px 20px;
  text-transform: none;
}

:is(.conversation-panel, #portfolio-chat) .conversation-title {
  color: var(--conversation-navy);
  font: 400 28px/1.1 "DM Serif Display", Georgia, serif;
  letter-spacing: 0;
}

:is(.conversation-panel, #portfolio-chat) .conversation-subtitle,
:is(.conversation-panel, #portfolio-chat) .conversation-title small {
  display: block;
  grid-column: 1 / -1;
  margin-top: 8px;
  color: #52668f;
  font: 400 14px/1.45 Inter, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

:is(.conversation-panel, #portfolio-chat) .chat {
  display: flex;
  flex: 1 1 100px;
  min-height: 120px;
  flex-direction: column;
  gap: 34px;
  padding: 4px 22px 14px;
  overflow: auto;
  scrollbar-gutter: stable;
}

:is(.conversation-panel, #portfolio-chat) .msg {
  position: relative;
  max-width: 78%;
  padding: 17px 20px;
  border: 1px solid #e8e0d8;
  border-radius: 0 17px 17px 17px;
  background: #fff;
  color: var(--conversation-navy);
  font: 400 14px/1.58 Inter, sans-serif;
  box-shadow: 0 12px 28px rgba(35, 29, 53, .07);
}

:is(.conversation-panel, #portfolio-chat) .msg.ai { margin-left: 64px; }
:is(.conversation-panel, #portfolio-chat) .msg.ai::before {
  content: "";
  position: absolute;
  left: -64px;
  top: 1px;
  width: 44px;
  height: 44px;
  border: 1px solid #edbd58;
  border-radius: 50%;
  background: #fff url("/VestMindIconTransparentBack.webp") center / 34px auto no-repeat;
  box-shadow: 0 10px 24px rgba(6, 24, 82, .11);
}

:is(.conversation-panel, #portfolio-chat) .msg p { margin: 7px 0 0; }
:is(.conversation-panel, #portfolio-chat) .msg p:first-child { margin-top: 0; }
:is(.conversation-panel, #portfolio-chat) .msg small,
:is(.conversation-panel, #portfolio-chat) .msg small.at {
  position: absolute;
  left: 2px;
  top: 100%;
  margin-top: 9px;
  color: #6c80aa;
  font-size: 11px;
  white-space: nowrap;
}

:is(.conversation-panel, #portfolio-chat) .msg.me {
  align-self: flex-end;
  margin: 0 0 6px;
  border: 0;
  border-radius: 17px 17px 0 17px;
  background: #08265f;
  color: #fff;
  box-shadow: 0 12px 28px rgba(6, 24, 82, .12);
}
:is(.conversation-panel, #portfolio-chat) .msg.me small,
:is(.conversation-panel, #portfolio-chat) .msg.me small.at { left: auto; right: 2px; color: #6c80aa; }
:is(.conversation-panel, #portfolio-chat) .msg.me small::after,
:is(.conversation-panel, #portfolio-chat) .msg.me small.at::after { content: " ✓✓"; color: #ed9800; font-weight: 800; }

:is(.conversation-panel, #portfolio-chat) .suggestions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 20px;
}
:is(.conversation-panel, #portfolio-chat) .suggestion {
  border: 1px solid #cbd6e6;
  border-radius: 999px;
  background: #fff;
  color: #172033;
  padding: 9px 16px;
  font: 600 12px Inter, sans-serif;
  box-shadow: 0 1px 4px rgba(6, 24, 82, .08);
}

:is(.conversation-panel, #portfolio-chat) .input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 58px;
  gap: 11px;
  padding: 26px 28px 12px;
  border-top: 1px solid var(--conversation-border);
}
:is(.conversation-panel, #portfolio-chat) .input.stopping {
  grid-template-columns: minmax(0, 1fr) 58px 58px 58px;
}
:is(.conversation-panel, #portfolio-chat) .input textarea {
  width: 100%;
  height: 64px;
  padding: 20px;
  border: 1px solid var(--conversation-border);
  border-radius: 11px;
  background: #fff;
  color: var(--conversation-navy);
  font: 400 14px Inter, sans-serif;
  resize: none;
}
:is(.conversation-panel, #portfolio-chat) .input textarea:focus { outline: 2px solid rgba(8, 104, 245, .18); border-color: var(--conversation-blue); }
:is(.conversation-panel, #portfolio-chat) .mic-btn,
:is(.conversation-panel, #portfolio-chat) button.send {
  height: 62px;
  border: 0;
  border-radius: 11px;
  background: #f5f0e8;
  color: var(--conversation-blue);
  font-size: 20px;
}
:is(.conversation-panel, #portfolio-chat) .mic-btn:disabled { opacity: .45; }
:is(.conversation-panel, #portfolio-chat) button.send { background: #08265f; color: #fff; font-size: 24px; }
:is(.conversation-panel, #portfolio-chat) .hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 28px 25px;
  color: #6f83a8;
  font-size: 11px;
}
:is(.conversation-panel, #portfolio-chat) .transcript-link { color: #b66b00; }

@media (max-width: 640px) {
  :is(.conversation-panel, #portfolio-chat) .msg { max-width: 83%; }
  :is(.conversation-panel, #portfolio-chat) .msg.ai { margin-left: 48px; }
  :is(.conversation-panel, #portfolio-chat) .msg.ai::before { left: -48px; width: 36px; height: 36px; background-size: 28px auto; }
  :is(.conversation-panel, #portfolio-chat) .input { padding-inline: 14px; }
}
