.cq-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cq-assistant-host {
  --cq-a-blue: var(--city-blue, #00599c);
  --cq-a-dark: var(--city-dark, #04386d);
  --cq-a-surface: var(--card, #fff);
  --cq-a-sunken: var(--bone, #f4f9fe);
  --cq-a-line: var(--line, #d7e7f6);
  --cq-a-ink: var(--ink, #071426);
  --cq-a-muted: var(--ink-mute, #687993);
  --cq-a-secondary: var(--ink-soft, #34455f);
  --cq-a-good: var(--good, #0b7a53);
  --cq-a-warning: #f2c94c;
  --cq-a-danger: var(--bad, #b42318);
  --cq-a-head-bg: linear-gradient(135deg, var(--cq-a-blue), var(--cq-a-dark));
  --cq-a-head-ink: #fff;
  --cq-a-head-ink-dim: rgb(255 255 255 / 82%);
  --cq-a-chrome: rgb(0 0 0 / 14%);
  --cq-a-chrome-hover: rgb(0 0 0 / 26%);
  --cq-a-user-bg: color-mix(in srgb, var(--cq-a-blue) 22%, #fff);
  --cq-a-user-ink: #0a2440;
  --cq-a-bot-bg: color-mix(in srgb, var(--cq-a-blue) 92%, #000);
  --cq-a-bot-ink: #fff;
  --cq-a-bot-ink-dim: rgb(255 255 255 / 72%);
  position: relative;
  z-index: 70;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.cq-assistant-host *,
.cq-assistant-host *::before,
.cq-assistant-host *::after { box-sizing: border-box; }

.cq-assistant-host button,
.cq-assistant-host input { font-family: inherit; }

.cq-assistant-launch {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 11px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cq-a-dark), var(--cq-a-blue));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgb(15 42 74 / 26%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cq-assistant-launch:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgb(15 42 74 / 32%);
}

.cq-assistant-launch:focus-visible,
.cq-assistant :focus-visible {
  outline: 3px solid var(--cq-a-warning);
  outline-offset: 2px;
}

.cq-assistant-launch-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgb(255 255 255 / 22%);
}

.cq-assistant-launch-mark svg {
  width: 16px;
  height: 16px;
}

.cq-assistant {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 40px));
  border: 1.5px solid var(--cq-a-line);
  border-radius: 16px;
  background: var(--cq-a-surface);
  color: var(--cq-a-ink);
  box-shadow: 0 4px 20px rgb(0 0 0 / 16%);
  overflow: hidden;
  animation: cq-assistant-in 0.28s ease-out;
}

.cq-assistant[hidden],
.cq-assistant-launch[hidden] { display: none; }

@keyframes cq-assistant-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.cq-assistant-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 16px;
  background: var(--cq-a-head-bg);
  color: var(--cq-a-head-ink);
}

.cq-assistant-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 55%), 0 2px 6px rgb(0 0 0 / 18%);
}

.cq-assistant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cq-assistant-id { flex: 1; min-width: 0; }
.cq-assistant-id h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.cq-assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  color: var(--cq-a-head-ink-dim);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cq-assistant-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 6px rgb(53 208 127 / 60%);
}

.cq-assistant-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cq-assistant-icon,
.cq-assistant-send,
.cq-assistant-mic {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.cq-assistant-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: var(--cq-a-chrome);
  color: var(--cq-a-head-ink);
  font-size: 13px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cq-assistant-icon:hover { background: var(--cq-a-chrome-hover); transform: scale(1.08); }
.cq-assistant-icon svg { width: 15px; height: 15px; }
.cq-assistant-icon[hidden] { display: none; }

.cq-assistant-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.cq-assistant-empty {
  padding: 16px 16px 12px;
  border: 1px solid var(--cq-a-line);
  border-radius: 12px;
  background: var(--cq-a-sunken);
}

.cq-assistant-empty h3 {
  margin: 0 0 8px;
  color: var(--cq-a-blue);
  font-size: 17px;
  font-weight: 600;
}

.cq-assistant-empty p {
  margin: 0;
  color: var(--cq-a-secondary);
  font-size: 12.5px;
  line-height: 1.5;
}
.cq-assistant-limit {
  margin-top: 8px !important;
  color: var(--cq-a-muted) !important;
}

.cq-assistant-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 10px 16px;
  flex-shrink: 0;
}

.cq-assistant-prompt {
  padding: 10px 12px;
  border: 1px solid #b9d9f4;
  border-radius: 20px;
  background: var(--cq-a-sunken);
  color: var(--cq-a-blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  transition: background 0.18s ease, transform 0.18s ease;
}
.cq-assistant-prompt:hover { background: #e7f3fd; transform: translateY(-1px); }

.cq-assistant-turn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 80%;
  animation: cq-message-in 0.24s ease-out;
}
.cq-assistant-turn.at-user { align-self: flex-end; align-items: flex-end; }
.cq-assistant-turn.at-assistant { align-self: flex-start; align-items: flex-start; }

@keyframes cq-message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.cq-assistant-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.at-user .cq-assistant-msg {
  border-bottom-right-radius: 4px;
  background: var(--cq-a-user-bg);
  color: var(--cq-a-user-ink);
}
.at-assistant .cq-assistant-msg {
  border-bottom-left-radius: 4px;
  background: var(--cq-a-bot-bg);
  color: var(--cq-a-bot-ink);
}
.at-assistant.at-nodata .cq-assistant-msg {
  border: 1px solid var(--cq-a-line);
  background: var(--cq-a-sunken);
  color: var(--cq-a-secondary);
}

.cq-assistant-evidence {
  width: min(100%, 360px);
  padding: 9px 10px;
  border: 1px solid var(--cq-a-line);
  border-radius: 10px;
  background: var(--cq-a-surface);
  color: var(--cq-a-secondary);
  font-size: 11.5px;
  line-height: 1.45;
}

.cq-assistant-claims {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cq-assistant-claims li { display: grid; gap: 4px; }
.cq-assistant-confidence {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid #7bc996;
  border-radius: 999px;
  color: #086b2b;
  font-size: 10.5px;
  font-weight: 700;
}
.cq-assistant-confidence.is-calculated {
  border-color: var(--cq-a-muted);
  background: var(--cq-a-sunken);
  color: var(--cq-a-ink);
}
.cq-assistant-confidence.is-analysis {
  border-color: var(--cq-a-blue);
  border-style: dashed;
  background: var(--cq-a-sunken);
  color: var(--cq-a-blue);
}
.cq-assistant-formula { color: var(--cq-a-muted); font-family: "IBM Plex Mono", monospace; }

.cq-assistant-sources {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--cq-a-line);
}
.cq-assistant-sources summary {
  width: fit-content;
  color: var(--cq-a-blue);
  font-weight: 700;
  cursor: pointer;
}
.cq-assistant-sources ol { display: grid; gap: 8px; margin: 8px 0 0; padding-left: 20px; }
.cq-assistant-sources span { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.cq-assistant-retention {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--cq-a-line);
  color: var(--cq-a-muted);
  font-weight: 600;
}
.cq-assistant-turn-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}
.cq-assistant-copy {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--cq-a-line);
  border-radius: 999px;
  background: var(--cq-a-surface);
  color: var(--cq-a-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.cq-assistant-copy:hover { border-color: var(--cq-a-blue); color: var(--cq-a-blue); }
.cq-assistant-speak {
  gap: 4px;
}
.cq-assistant-speak svg { width: 14px; height: 14px; }

.cq-assistant-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  background: var(--cq-a-bot-bg);
}
.cq-assistant-typing span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cq-a-bot-ink-dim);
  animation: cq-assistant-bounce 1.3s ease-in-out infinite;
}
.cq-assistant-typing span:nth-child(2) { animation-delay: 0.16s; }
.cq-assistant-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes cq-assistant-bounce {
  0%, 62%, 100% { transform: none; opacity: 0.55; }
  31% { transform: translateY(-12px); opacity: 1; }
}

.cq-assistant-error,
.cq-assistant-data-notice {
  flex-shrink: 0;
  margin: 0;
  padding: 9px 14px;
  font-size: 12.5px;
  line-height: 1.45;
}
.cq-assistant-error {
  border-top: 1px solid #f3aaa3;
  border-bottom: 1px solid #f3aaa3;
  background: #fff0ef;
  color: var(--cq-a-danger);
}
.cq-assistant-data-notice {
  border-top: 1px solid #efd083;
  background: #fff8e6;
  color: #4f3b00;
}
.cq-assistant-error[hidden],
.cq-assistant-data-notice[hidden] { display: none; }

.cq-assistant-voice-consent {
  flex-shrink: 0;
  margin: 0 12px 10px;
  padding: 12px;
  border: 1px solid #b9d9f4;
  border-radius: 12px;
  background: var(--cq-a-sunken);
  color: var(--cq-a-secondary);
}
.cq-assistant-voice-consent[hidden] { display: none; }
.cq-assistant-voice-consent h3 {
  margin: 0 0 6px;
  color: var(--cq-a-blue);
  font-size: 14px;
}
.cq-assistant-voice-consent p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
}
.cq-assistant-voice-consent-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cq-assistant-voice-accept,
.cq-assistant-voice-cancel,
.cq-assistant-voice-end {
  padding: 6px 10px;
  border: 1px solid #b9d9f4;
  border-radius: 999px;
  background: var(--cq-a-surface);
  color: var(--cq-a-blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.cq-assistant-voice-accept {
  border-color: var(--cq-a-blue);
  background: var(--cq-a-blue);
  color: #fff;
}
.cq-assistant-voice-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 7px 12px;
  border-top: 1px solid #b9d9f4;
  background: #edf7ff;
  color: var(--cq-a-secondary);
  font-size: 11px;
  line-height: 1.3;
}
.cq-assistant-voice-bar[hidden] { display: none; }
.cq-assistant-voice-bar span { flex: 1; min-width: 0; }
.cq-assistant-voice-end[hidden] { display: none; }

.cq-assistant-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--cq-a-line);
  background: var(--cq-a-surface);
}
.cq-assistant-input {
  min-width: 0;
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #c9ddeb;
  border-radius: 20px;
  background: var(--cq-a-sunken);
  color: var(--cq-a-ink);
  font-size: 14px;
}
.cq-assistant-input::placeholder { color: var(--cq-a-muted); }
.cq-assistant-input:focus {
  outline: 0;
  border-color: var(--cq-a-blue);
  background: var(--cq-a-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cq-a-blue) 22%, transparent);
}
.cq-assistant-send {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--cq-a-blue);
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cq-assistant-mic {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid #b9d9f4;
  background: var(--cq-a-sunken);
  color: var(--cq-a-blue);
  transition: background 0.2s ease, transform 0.2s ease;
}
.cq-assistant-mic:hover { background: #e7f3fd; transform: scale(1.06); }
.cq-assistant-mic:disabled { cursor: not-allowed; opacity: 0.45; }
.cq-assistant-mic[hidden] { display: none; }
.cq-assistant-mic.is-recording {
  border-color: var(--cq-a-danger);
  background: #fff0ef;
  color: var(--cq-a-danger);
  animation: cq-assistant-recording 1.2s ease-in-out infinite;
}
.cq-assistant-mic svg { width: 17px; height: 17px; }
@keyframes cq-assistant-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgb(180 35 24 / 12%); }
  50% { box-shadow: 0 0 0 6px rgb(180 35 24 / 12%); }
}
.cq-assistant-send:not(:disabled):hover { background: var(--cq-a-dark); transform: scale(1.06); }
.cq-assistant-send:disabled { cursor: not-allowed; opacity: 0.4; }
.cq-assistant-send svg { width: 17px; height: 17px; }

.cq-assistant-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--cq-a-line);
  background: var(--cq-a-sunken);
  color: var(--cq-a-muted);
  font-size: 10.5px;
  font-weight: 600;
}
.cq-assistant-foot span:first-child { min-width: 0; }
.cq-assistant-foot span:last-child { flex-shrink: 0; }

@media (max-width: 520px) {
  .cq-assistant {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
  }
  .cq-assistant-prompts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .cq-assistant-host *,
  .cq-assistant-host *::before,
  .cq-assistant-host *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .cq-assistant,
  .cq-assistant-launch,
  .cq-assistant-icon,
  .cq-assistant-input,
  .cq-assistant-send,
  .cq-assistant-prompt,
  .cq-assistant-confidence {
    border: 2px solid CanvasText;
    forced-color-adjust: auto;
  }
}
