﻿:root {
  --ed-chat-primary: #0066b3;
  --ed-chat-primary-dark: #004f8d;
  --ed-chat-accent: #2ba9d1;
  --ed-chat-text: #17324d;
  --ed-chat-muted: #5d7084;
  --ed-chat-line: #d9e7f2;
  --ed-chat-surface: #ffffff;
  --ed-chat-shadow: 0 18px 46px rgba(12, 56, 94, 0.22);
}

.ed-chat {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 2147483000;
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--ed-chat-text);
}

.ed-chat * {
  box-sizing: border-box;
}

.ed-chat__toggle {
  display: inline-flex;
  min-width: 64px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0078d4 0%, #0057b8 58%, #003f91 100%);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(0, 102, 179, 0.32);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ed-chat__toggle:hover,
.ed-chat__toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(0, 102, 179, 0.38), 0 0 0 4px rgba(43, 169, 209, 0.16);
  outline: none;
}

.ed-chat__toggle-icon {
  font-size: 28px;
  line-height: 1;
}

.ed-chat__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: none;
  width: min(430px, calc(100vw - 28px));
  max-height: min(600px, calc(100vh - 130px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(34, 112, 179, 0.18);
  border-radius: 18px;
  background: var(--ed-chat-surface);
  box-shadow: var(--ed-chat-shadow);
}

.ed-chat.is-open .ed-chat__panel {
  display: block;
}

.ed-chat__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 18px 18px 15px;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 58%, #eef7ff 100%);
  border-bottom: 1px solid var(--ed-chat-line);
}

.ed-chat__header > div {
  min-width: 0;
}

.ed-chat__eyebrow {
  margin: 0 0 4px;
  color: var(--ed-chat-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ed-chat__title {
  margin: 0;
  color: var(--ed-chat-primary-dark);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ed-chat__intro {
  margin: 5px 0 0;
  color: var(--ed-chat-muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ed-chat__close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d5e6f4;
  border-radius: 10px;
  background: #ffffff;
  color: #31506c;
  cursor: pointer;
}

.ed-chat__body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.ed-chat__notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d9e7f2;
  border-radius: 12px;
  background: #f7fbff;
  color: #48627a;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ed-chat__options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ed-chat__option {
  border: 1px solid #cfe3f4;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ed-chat-primary-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  padding: 7px 10px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ed-chat__option:hover,
.ed-chat__option:focus-visible {
  border-color: #9dc8ea;
  background: #eef7ff;
  color: #003f91;
  outline: none;
}

.ed-chat__answer {
  min-height: 96px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #f6fafd;
  border: 1px solid #dbeaf5;
}

.ed-chat__answer-title {
  margin: 0 0 6px;
  color: var(--ed-chat-primary-dark);
  font-size: 14px;
  font-weight: 800;
}

.ed-chat__answer-text {
  margin: 0;
  color: #304b63;
  font-size: 14px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.ed-chat__actions {
  display: grid;
  gap: 9px;
}

.ed-chat__cta,
.ed-chat__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
}

.ed-chat__cta {
  background: linear-gradient(135deg, #0078d4 0%, #0057b8 58%, #003f91 100%);
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(0, 102, 179, 0.24);
}

.ed-chat__link {
  border: 1px solid #cfe3f4;
  background: #ffffff;
  color: var(--ed-chat-primary-dark) !important;
}

@media (max-width: 640px) {
  .ed-chat {
    right: 14px;
    bottom: 76px;
  }

  .ed-chat__toggle {
    min-width: 58px;
    min-height: 58px;
  }

  .ed-chat__panel {
    position: fixed;
    right: auto;
    left: 12px;
    bottom: 86px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: min(82vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .ed-chat__header {
    padding: 16px;
  }
}


.ed-chat__messages {
  display: grid;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.ed-chat__messages:empty {
  display: none;
}

.ed-chat__message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ed-chat__message--assistant {
  justify-self: start;
  border: 1px solid #dbeaf5;
  background: #f6fafd;
  color: #304b63;
}

.ed-chat__message--user {
  justify-self: end;
  background: #0066b3;
  color: #ffffff;
}

.ed-chat__message--loading {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #5d7084;
  font-style: normal;
}

.ed-chat__message--loading::after {
  content: "";
  width: 1.35em;
  text-align: left;
  animation: ed-chat-typing-dots 1.15s steps(4, end) infinite;
}

@keyframes ed-chat-typing-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

.ed-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ed-chat__input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #cfe3f4;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ed-chat-text);
  font: inherit;
  font-size: 14px;
}

.ed-chat__input:focus {
  border-color: #8fc2e8;
  outline: 3px solid rgba(43, 169, 209, 0.16);
}

.ed-chat__send {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--ed-chat-primary);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
}

.ed-chat__send:disabled,
.ed-chat__input:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ed-chat__error {
  margin: 0;
  color: #9b2c2c;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .ed-chat__messages {
    max-height: 150px;
  }

  .ed-chat__form {
    grid-template-columns: 1fr;
  }

  .ed-chat__send {
    width: 100%;
  }
}
@media (max-width: 640px) {
  .ed-chat__header {
    position: relative;
    display: block;
    padding: 16px 54px 16px 16px;
  }

  .ed-chat__title {
    max-width: 100%;
    font-size: 17px;
    line-height: 1.3;
  }

  .ed-chat__intro {
    font-size: 13px;
  }

  .ed-chat__close {
    position: absolute;
    top: 14px;
    right: 14px;
  }
}
@media (max-width: 640px) {
  .ed-chat__panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  .ed-chat__title {
    font-size: 16px;
  }
}
@media (max-width: 640px) {
  .ed-chat__close {
    display: inline-grid;
    z-index: 2;
    border-color: #b8d7ee;
    background: #ffffff;
    color: #004f8d;
    box-shadow: 0 4px 12px rgba(12, 56, 94, 0.12);
  }
}
