/* Evergreen Healthcare Partners assistant — scoped so host page tokens stay intact.
   Primitives match PureFrontend/assets/brands/evergreen-healthcare-partners. */
#eg-agent-launcher,
#eg-agent-panel {
  --eg-forest-900: #06231a;
  --eg-forest-700: #014725;
  --eg-forest-600: #0f5132;
  --eg-green-500: #15724a;
  --eg-green-400: #1f9460;
  --eg-mint-300: #7fc9a6;
  --eg-slate-600: #3f4a44;
  --eg-slate-500: #5f6f68;
  --eg-sage-300: #a9c8ba;
  --eg-mint-100: #cfe6da;
  --eg-mist-100: #e6ebe8;
  --eg-tint-50: #e7f3ec;
  --eg-paper-50: #f5f8f6;
  --eg-paper-0: #ffffff;
  --eg-gold-300: #d9c07c;
  --ink: var(--eg-forest-800, #11231b);
  --ink-soft: var(--eg-slate-600);
  --muted: var(--eg-slate-500);
  --panel: var(--eg-paper-0);
  --bg: var(--eg-paper-50);
  --line: var(--eg-mist-100);
  --accent: var(--eg-green-500);
  --accent-ink: var(--eg-forest-600);
  --on-accent: var(--eg-paper-0);
  --shadow: 0 10px 30px rgba(6, 35, 26, 0.16);
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
  font-family: var(--font);
}

#eg-agent-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 12px 18px 12px 12px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow);
}
#eg-agent-launcher:hover,
#eg-agent-launcher:focus-visible {
  background: var(--eg-forest-600);
  outline: 2px solid var(--eg-gold-300);
  outline-offset: 2px;
}
#eg-agent-launcher .eg-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--on-accent);
  -webkit-mask: url("/agent/evergreen-mark.png") left center / auto 70% no-repeat;
  mask: url("/agent/evergreen-mark.png") left center / auto 70% no-repeat;
}
#eg-agent-launcher[hidden] { display: none; }

#eg-agent-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1210;
  width: min(400px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 36px));
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#eg-agent-panel.open { display: flex; }

#eg-agent-panel header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--eg-forest-900);
  color: var(--eg-mint-100);
}
#eg-agent-panel header .eg-lockup {
  height: 28px;
  width: 190px;
  background: var(--eg-mint-100);
  -webkit-mask: url("/agent/evergreen-mark.png") left center / contain no-repeat;
  mask: url("/agent/evergreen-mark.png") left center / contain no-repeat;
}
#eg-agent-panel header p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eg-sage-300);
}
#eg-agent-close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--eg-mint-100);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
#eg-agent-close:focus-visible { outline: 2px solid var(--eg-gold-300); }

#eg-agent-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#eg-agent-body .msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
#eg-agent-body .msg.user,
#eg-agent-body .msg.sys {
  white-space: pre-wrap;
}
#eg-agent-body .msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
}
#eg-agent-body .msg.bot {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: normal;
}
#eg-agent-body .msg.bot p,
#eg-agent-body .msg.bot ul,
#eg-agent-body .msg.bot ol,
#eg-agent-body .msg.bot h1,
#eg-agent-body .msg.bot h2,
#eg-agent-body .msg.bot h3,
#eg-agent-body .msg.bot h4 {
  margin: 0 0 0.55em;
}
#eg-agent-body .msg.bot p:last-child,
#eg-agent-body .msg.bot ul:last-child,
#eg-agent-body .msg.bot ol:last-child,
#eg-agent-body .msg.bot h1:last-child,
#eg-agent-body .msg.bot h2:last-child,
#eg-agent-body .msg.bot h3:last-child,
#eg-agent-body .msg.bot h4:last-child {
  margin-bottom: 0;
}
#eg-agent-body .msg.bot h1,
#eg-agent-body .msg.bot h2,
#eg-agent-body .msg.bot h3,
#eg-agent-body .msg.bot h4 {
  font-size: 14px;
  font-weight: 650;
  color: var(--eg-forest-700);
}
#eg-agent-body .msg.bot ul,
#eg-agent-body .msg.bot ol {
  padding-left: 1.2em;
}
#eg-agent-body .msg.bot li {
  margin: 0.15em 0;
}
#eg-agent-body .msg.bot strong {
  font-weight: 650;
  color: var(--eg-forest-700);
}
#eg-agent-body .msg.bot a {
  color: var(--accent);
}
#eg-agent-body .msg.bot code {
  font-size: 0.9em;
  background: var(--eg-tint-50);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}
#eg-agent-body .msg.sys {
  align-self: center;
  background: var(--eg-tint-50);
  color: var(--ink-soft);
  font-size: 13px;
}
#eg-agent-body .typing {
  display: flex;
  gap: 5px;
  padding: 8px;
}
#eg-agent-body .typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--eg-green-400);
  animation: eg-pulse 1s infinite;
}
#eg-agent-body .typing i:nth-child(2) { animation-delay: 0.15s; }
#eg-agent-body .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes eg-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

#eg-agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 8px;
  background: var(--bg);
}
#eg-agent-chips button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
#eg-agent-chips button:hover,
#eg-agent-chips button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

#eg-agent-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
#eg-agent-input {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
}
#eg-agent-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
#eg-agent-send {
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
}
#eg-agent-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 520px) {
  #eg-agent-launcher span.lbl { display: none; }
  #eg-agent-launcher { padding: 12px; }
  #eg-agent-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
}

/* EFC Phase 1 guide chrome — packet pages keep the Evergreen tokens above. */
#eg-agent-launcher.eg-efc,
#eg-agent-panel.eg-efc {
  --ink: #0F2233;
  --ink-soft: #34505F;
  --muted: #5A7180;
  --panel: #FFFFFF;
  --bg: #F4F7F9;
  --line: #DCE4E9;
  --accent: #C1731A;
  --accent-ink: #A65F12;
  --on-accent: #FFFFFF;
  --shadow: 0 10px 30px rgba(11, 25, 38, 0.18);
}

#eg-agent-launcher.eg-efc:hover,
#eg-agent-launcher.eg-efc:focus-visible {
  background: #A65F12;
  outline: 2px solid #F0A85E;
  outline-offset: 2px;
}
#eg-agent-launcher.eg-efc .eg-av {
  -webkit-mask: none;
  mask: none;
  background: #0B1926;
  color: #F4F7F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
#eg-agent-launcher.eg-efc .eg-av::before {
  content: "EFC";
}

#eg-agent-panel.eg-efc header {
  background: #0B1926;
  border-bottom: 2px solid #C1731A;
  color: #F4F7F9;
}
#eg-agent-panel.eg-efc header .eg-lockup {
  -webkit-mask: none;
  mask: none;
  background: transparent;
  width: auto;
  height: auto;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #F0A85E;
  display: inline-block;
}
#eg-agent-panel.eg-efc header p {
  color: #9FB0BC;
}
#eg-agent-panel.eg-efc #eg-agent-close {
  color: #9FB0BC;
}
#eg-agent-panel.eg-efc #eg-agent-body .msg.sys {
  background: #FBEEDC;
  color: #0F2233;
}
#eg-agent-panel.eg-efc #eg-agent-body .typing i {
  background: #C1731A;
}
#eg-agent-panel.eg-efc #eg-agent-chips button {
  color: #A65F12;
  border-color: #DCE4E9;
}
#eg-agent-panel.eg-efc #eg-agent-chips button:hover,
#eg-agent-panel.eg-efc #eg-agent-chips button:focus-visible {
  border-color: #C1731A;
}
#eg-agent-panel.eg-efc #eg-agent-input:focus-visible {
  outline: 2px solid #C1731A;
}
