:root {
  --dmr-chat-navy: #061936;
  --dmr-chat-blue: #0a5ca8;
  --dmr-chat-blue-bright: #1678cf;
  --dmr-chat-gold: #d7ad52;
  --dmr-chat-ink: #142033;
  --dmr-chat-muted: #607086;
  --dmr-chat-line: #dce5ef;
  --dmr-chat-surface: #ffffff;
  --dmr-chat-soft: #f1f6fb;
  --dmr-chat-danger: #9b1c1c;
}

.dmr-assistant,
.dmr-assistant * {
  box-sizing: border-box;
}

.dmr-assistant {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--dmr-chat-ink);
  line-height: 1.45;
}

.dmr-assistant button,
.dmr-assistant input,
.dmr-assistant select,
.dmr-assistant textarea {
  font: inherit;
}

.dmr-assistant-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 20px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--dmr-chat-blue-bright), var(--dmr-chat-navy));
  box-shadow: 0 12px 30px rgba(3, 18, 43, 0.35);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dmr-assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 34px rgba(3, 18, 43, 0.42);
}

.dmr-assistant-launcher:focus-visible,
.dmr-assistant button:focus-visible,
.dmr-assistant a:focus-visible,
.dmr-assistant input:focus-visible,
.dmr-assistant select:focus-visible,
.dmr-assistant textarea:focus-visible {
  outline: 3px solid #f2c86e;
  outline-offset: 2px;
}

.dmr-assistant-launcher svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  fill: currentColor;
}

.dmr-assistant-badge {
  position: absolute;
  top: -6px;
  right: -3px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #c93434;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.dmr-assistant-badge[hidden] {
  display: none;
}

.dmr-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  width: min(390px, calc(100vw - 24px));
  max-height: min(690px, calc(100vh - 110px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(4, 31, 70, 0.22);
  border-radius: 18px;
  background: var(--dmr-chat-surface);
  box-shadow: 0 24px 65px rgba(2, 15, 37, 0.34);
  transform-origin: bottom right;
  animation: dmr-assistant-in 180ms ease-out;
}

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

@keyframes dmr-assistant-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dmr-assistant-header {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 82px;
  padding: 15px 58px 15px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--dmr-chat-navy), var(--dmr-chat-blue));
}

.dmr-assistant-brandmark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-right: 12px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: var(--dmr-chat-gold);
  font-size: 18px;
  font-weight: 900;
}

.dmr-assistant-heading {
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.dmr-assistant-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.dmr-assistant-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5be58d;
  box-shadow: 0 0 0 3px rgba(91, 229, 141, 0.15);
  content: "";
}

.dmr-assistant-close {
  position: absolute;
  top: 15px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dmr-assistant-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dmr-assistant-body {
  min-height: 260px;
  overflow-y: auto;
  padding: 16px 15px 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(17, 112, 191, 0.07), transparent 34%),
    var(--dmr-chat-soft);
  overscroll-behavior: contain;
}

.dmr-assistant-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 5px 15px 15px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(18, 42, 74, 0.08);
  color: var(--dmr-chat-ink);
  font-size: 14px;
  white-space: pre-line;
}

.dmr-assistant-message.is-user {
  margin-left: auto;
  border-radius: 15px 5px 15px 15px;
  background: var(--dmr-chat-blue);
  color: #fff;
}

.dmr-assistant-message a {
  color: #07569a;
  font-weight: 800;
}

.dmr-assistant-options {
  display: flex;
  margin: 4px 0 13px;
  flex-wrap: wrap;
  gap: 7px;
}

.dmr-assistant-option {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #8db5d9;
  border-radius: 999px;
  color: #064b87;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dmr-assistant-option:hover {
  border-color: var(--dmr-chat-blue);
  background: #eaf4fd;
}

.dmr-assistant-card-link {
  display: inline-flex;
  min-height: 38px;
  margin: 1px 0 12px;
  padding: 8px 12px;
  align-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--dmr-chat-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.dmr-assistant-card-link:hover {
  background: #084a86;
  color: #fff;
}

.dmr-assistant-form {
  margin: 5px 0 13px;
  padding: 13px;
  border: 1px solid var(--dmr-chat-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(18, 42, 74, 0.08);
}

.dmr-assistant-form[hidden] {
  display: none;
}

.dmr-assistant-form-title {
  margin: 0 0 10px;
  color: var(--dmr-chat-navy);
  font-size: 15px;
  font-weight: 900;
}

.dmr-assistant-field {
  display: block;
  margin: 0 0 9px;
}

.dmr-assistant-field > span {
  display: block;
  margin: 0 0 4px;
  color: #314057;
  font-size: 12px;
  font-weight: 800;
}

.dmr-assistant-field input,
.dmr-assistant-field select,
.dmr-assistant-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #b9c7d7;
  border-radius: 7px;
  color: #101b2b;
  background: #fff;
  font-size: 14px;
}

.dmr-assistant-field textarea {
  min-height: 80px;
  resize: vertical;
}

.dmr-assistant-field input:focus,
.dmr-assistant-field select:focus,
.dmr-assistant-field textarea:focus {
  border-color: var(--dmr-chat-blue);
  box-shadow: 0 0 0 3px rgba(10, 92, 168, 0.12);
  outline: 0;
}

.dmr-assistant-file-note,
.dmr-assistant-consent,
.dmr-assistant-form-status {
  display: block;
  margin: 4px 0 9px;
  color: var(--dmr-chat-muted);
  font-size: 11px;
}

.dmr-assistant-form-status {
  min-height: 16px;
  color: var(--dmr-chat-danger);
  font-weight: 700;
}

.dmr-assistant-submit {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--dmr-chat-blue-bright), var(--dmr-chat-blue));
  font-weight: 900;
  cursor: pointer;
}

.dmr-assistant-submit:hover {
  background: linear-gradient(135deg, #0b64b2, #06467f);
}

.dmr-assistant-submit[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.dmr-assistant-composer {
  display: flex;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid var(--dmr-chat-line);
  background: #fff;
}

.dmr-assistant-question {
  min-width: 0;
  min-height: 43px;
  flex: 1;
  padding: 9px 11px;
  border: 1px solid #b7c5d5;
  border-radius: 9px;
  color: var(--dmr-chat-ink);
  background: #fff;
}

.dmr-assistant-send {
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--dmr-chat-blue);
  cursor: pointer;
}

.dmr-assistant-send svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.dmr-assistant-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .dmr-assistant {
    right: 12px;
    bottom: 72px;
  }

  .dmr-assistant-launcher {
    min-width: 56px;
    min-height: 56px;
    padding: 0 15px;
  }

  .dmr-assistant-launcher-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .dmr-assistant-panel {
    right: 0;
    bottom: 66px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 158px);
    border-radius: 15px;
  }

  .dmr-assistant-header {
    min-height: 72px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .dmr-assistant-brandmark {
    width: 40px;
    height: 40px;
  }
}

@media (max-height: 640px) and (min-width: 721px) {
  .dmr-assistant-panel {
    max-height: calc(100vh - 88px);
  }

  .dmr-assistant {
    bottom: 12px;
  }
}

@media (max-height: 640px) and (max-width: 720px) {
  .dmr-assistant {
    bottom: 64px;
  }

  .dmr-assistant-panel {
    bottom: 60px;
    max-height: calc(100vh - 136px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmr-assistant-panel {
    animation: none;
  }

  .dmr-assistant-launcher {
    transition: none;
  }
}
