/* Diamond Light – Assistant IA (widget) */
@font-face {
  font-family: "DLA Montserrat";
  src: url("montserrat.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

.dla-root {
  --dla-violet: #750ed7;
  --dla-violet-deep: #4a0890;
  --dla-night: #1d0b38;
  --dla-lilac: #f3ecfd;
  --dla-crystal: #fdfbff;
  --dla-gold: #c9a54c;
  --dla-ink: #2a2238;
  --dla-muted: #6d6380;
  --dla-line: #e4daf3;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483000;
  font-family: "DLA Montserrat", "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  color: var(--dla-ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.dla-root.dla-left { right: auto; left: 20px; }
.dla-root *, .dla-root *::before, .dla-root *::after { box-sizing: border-box; }

/* Launcher: a portrait set in a faceted gold ring */
.dla-launcher {
  position: relative;
  width: 64px;
  height: 64px;
  border: 0;
  padding: 3px;
  border-radius: 50%;
  cursor: pointer;
  background: conic-gradient(from 210deg, #f2dc9b, var(--dla-gold), #8a6a22, var(--dla-gold), #f2dc9b);
  box-shadow: 0 10px 28px rgba(74, 8, 144, 0.35);
  transition: transform .2s ease;
}
.dla-launcher:hover { transform: scale(1.05); }
.dla-launcher:focus-visible { outline: 3px solid var(--dla-violet); outline-offset: 3px; }
.dla-launcher img, .dla-avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 2px solid #fff;
  background: var(--dla-violet);
}
.dla-avatar-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
}
.dla-launcher .dla-gem {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--dla-violet);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.dla-root.dla-open .dla-launcher { display: none; }

.dla-teaser {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: max-content;
  max-width: 230px;
  background: #fff;
  color: var(--dla-ink);
  border: 1px solid var(--dla-line);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 34px 10px 14px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(29, 11, 56, 0.14);
  cursor: pointer;
  animation: dla-rise .35s ease both;
}
.dla-left .dla-teaser { right: auto; left: 0; border-radius: 16px 16px 16px 4px; }
.dla-teaser button {
  position: absolute; top: 4px; right: 6px;
  border: 0; background: none; color: var(--dla-muted);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 4px;
}

/* Panel */
.dla-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 40px);
  display: none;
  flex-direction: column;
  background: var(--dla-crystal);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(29, 11, 56, 0.32);
  border: 1px solid rgba(117, 14, 215, 0.18);
}
.dla-left .dla-panel { right: auto; left: 0; }
.dla-root.dla-open .dla-panel { display: flex; animation: dla-rise .25s ease both; }

.dla-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--dla-violet);
  color: #fff;
}
.dla-head .dla-head-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  padding: 2px; border-radius: 50%;
  background: conic-gradient(from 210deg, #f2dc9b, var(--dla-gold), #8a6a22, var(--dla-gold), #f2dc9b);
}
.dla-head .dla-head-avatar img, .dla-head .dla-head-avatar .dla-avatar-fallback { border-width: 2px; border-color: var(--dla-violet); font-size: 20px; }
.dla-head-text { flex: 1; min-width: 0; }
.dla-head-name { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.dla-head-sub { font-size: 12px; font-weight: 500; opacity: .85; }
.dla-head-sub::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #7ef0b0; margin-right: 6px; vertical-align: 1px;
}
.dla-icon-btn {
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.dla-icon-btn:hover { background: rgba(255,255,255,.26); }
.dla-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dla-icon-btn svg { width: 18px; height: 18px; }

.dla-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.dla-msg {
  max-width: 86%;
  padding: 10px 14px;
  font-size: 14.5px;
  border-radius: 18px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.dla-msg.dla-bot {
  align-self: flex-start;
  background: var(--dla-lilac);
  color: var(--dla-ink);
  border-bottom-left-radius: 6px;
}
.dla-msg.dla-user {
  align-self: flex-end;
  background: var(--dla-violet);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.dla-msg a { color: var(--dla-violet); text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }
.dla-msg.dla-user a { color: #fff; }
.dla-msg strong { font-weight: 700; }
.dla-msg.dla-error { background: #fff3f3; color: #7a1f2b; border: 1px solid #f3d0d5; }

.dla-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.dla-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--dla-violet);
  opacity: .35; animation: dla-blink 1.2s infinite ease-in-out;
}
.dla-typing span:nth-child(2) { animation-delay: .15s; }
.dla-typing span:nth-child(3) { animation-delay: .3s; }

.dla-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.dla-chip {
  border: 1.5px solid var(--dla-violet);
  background: #fff;
  color: var(--dla-violet);
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
}
.dla-chip:hover { background: var(--dla-violet); color: #fff; }
.dla-chip:focus-visible { outline: 2px solid var(--dla-violet); outline-offset: 2px; }

.dla-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--dla-line);
  background: #fff;
}
.dla-input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--dla-line);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--dla-ink);
  max-height: 110px;
  min-height: 44px;
  background: var(--dla-crystal);
}
.dla-input:focus { outline: none; border-color: var(--dla-violet); }
.dla-send {
  width: 44px; height: 44px; flex: 0 0 44px;
  border: 0; border-radius: 50%;
  background: var(--dla-violet); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.dla-send:disabled { opacity: .45; cursor: default; }
.dla-send:focus-visible { outline: 3px solid var(--dla-gold); outline-offset: 2px; }
.dla-send svg { width: 20px; height: 20px; }

.dla-foot {
  padding: 6px 14px 10px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: var(--dla-muted);
  line-height: 1.4;
}
.dla-foot a { color: var(--dla-violet); font-weight: 600; }
.dla-foot .dla-human { float: right; margin-left: 10px; }

@keyframes dla-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dla-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 480px) {
  .dla-root { bottom: 14px; right: 14px; }
  .dla-root.dla-left { left: 14px; }
  .dla-root.dla-open { inset: 0; bottom: 0; right: 0; }
  .dla-root.dla-open .dla-panel {
    position: fixed; inset: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0; border: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .dla-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .dla-root *, .dla-root *::before { animation: none !important; transition: none !important; }
}
