/* ---------- Chat assistant widget ---------- */
/* Uses the site's existing design tokens (--bg, --accent, --text, --radius, etc. from style.css)
   so it always matches the current brand — never hardcode colours here. */

.dsl-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  font-family: var(--font-body);
}

.dsl-chat-toggle {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
  transition: transform 0.15s ease;
}
.dsl-chat-toggle:hover { transform: scale(1.05); }
.dsl-chat-toggle-icon { width: 26px; height: 26px; fill: currentColor; position: absolute; transition: opacity 0.15s ease; }
.dsl-chat-icon-close { opacity: 0; }
.dsl-chat-root.dsl-chat-open .dsl-chat-icon-open { opacity: 0; }
.dsl-chat-root.dsl-chat-open .dsl-chat-icon-close { opacity: 1; }

.dsl-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: 2px solid var(--bg);
}

@keyframes dsl-chat-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35); }
  50% { box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35), 0 0 0 8px rgba(20, 184, 166, 0.25); }
}
.dsl-chat-pulse { animation: dsl-chat-pulse 1.6s ease-in-out 3; }

.dsl-chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(30, 42, 40, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dsl-chat-panel[hidden] {
  display: none;
}

.dsl-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--accent-gradient);
  color: #fff;
  flex-shrink: 0;
}
.dsl-chat-header-logo { width: 30px; height: 30px; flex-shrink: 0; }
.dsl-chat-header-text { display: flex; flex-direction: column; line-height: 1.3; flex-grow: 1; min-width: 0; }
.dsl-chat-header-text strong { font-family: var(--font-head); font-size: 15px; }
.dsl-chat-header-text span { font-size: 12px; opacity: 0.85; }
.dsl-chat-restart {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
.dsl-chat-restart:hover { background: rgba(255, 255, 255, 0.28); }
.dsl-chat-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
.dsl-chat-close:hover { background: rgba(255, 255, 255, 0.28); }

.dsl-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.dsl-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.dsl-chat-msg a { color: inherit; text-decoration: underline; }
.dsl-chat-msg--bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}
.dsl-chat-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.dsl-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 4px;
}
.dsl-chat-chip {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dsl-chat-chip:hover { background: var(--accent); color: #fff; }

.dsl-chat-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.dsl-chat-inputbar input {
  flex-grow: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}
.dsl-chat-inputbar input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.dsl-chat-inputbar button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.dsl-chat-inputbar button:hover { background: var(--accent-2); }

@media (max-width: 480px) {
  .dsl-chat-root { right: 14px; bottom: 14px; }
  .dsl-chat-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 88px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: calc(100vh - 110px);
  }
}
