/**
 * Coderizo AI — floating contact button, AI modal and full chat page.
 */

/* ---------- Tokens ---------- */
.cz-ai-scope,
.cz-app.cz-theme-dark {
  --cz-accent-1: #39da8a;
  --cz-accent-2: #5a8dee;
  --cz-link: #7fa8f3;
  --cz-glow: rgba(0, 207, 221, 0.35);
  --cz-focus: rgba(0, 207, 221, 0.22);
  --cz-grad: linear-gradient(135deg, #2fc982 0%, #0fb6c9 50%, #5a8dee 100%);
  --cz-bg: #1c222f;
  --cz-glass: rgba(28, 34, 47, 0.9);
  --cz-surface: rgba(255, 255, 255, 0.04);
  --cz-surface-hover: rgba(255, 255, 255, 0.08);
  --cz-border: rgba(90, 141, 238, 0.2);
  --cz-border-strong: rgba(57, 218, 138, 0.45);
  --cz-text: #e8edf5;
  --cz-muted: rgba(207, 216, 230, 0.62);
  --cz-user-bubble: rgba(90, 141, 238, 0.22);
  --cz-code-bg: rgba(0, 0, 0, 0.3);
  --cz-success: #39da8a;
  --cz-danger: #ff5b5c;
  --cz-shadow: 0 24px 80px rgba(5, 8, 14, 0.6);
  color-scheme: dark;
}

.cz-app.cz-theme-light {
  --cz-accent-1: #1fb978;
  --cz-accent-2: #5a8dee;
  --cz-link: #3f74e0;
  --cz-glow: rgba(0, 207, 221, 0.3);
  --cz-focus: rgba(90, 141, 238, 0.18);
  --cz-grad: linear-gradient(135deg, #2fc982 0%, #0fb6c9 50%, #5a8dee 100%);
  --cz-bg: #ffffff;
  --cz-glass: #ffffff;
  --cz-surface: #f5f7fb;
  --cz-surface-hover: #ebf0f8;
  --cz-border: #e1e6ee;
  --cz-border-strong: #b8cdf5;
  --cz-text: #3a4a5c;
  --cz-muted: #7a8899;
  --cz-user-bubble: rgba(90, 141, 238, 0.12);
  --cz-code-bg: #f2f4f8;
  --cz-success: #1fb978;
  --cz-danger: #ff5b5c;
  --cz-shadow: 0 12px 40px rgba(38, 60, 85, 0.12);
  color-scheme: light;
}

.cz-ai-scope *,
.cz-app * {
  box-sizing: border-box;
}

.cz-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--cz-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cz-icon-btn:hover,
.cz-icon-btn:focus-visible {
  background: var(--cz-surface-hover);
  color: var(--cz-text);
}
.cz-icon-btn i {
  font-size: 1.15rem;
}
.cz-icon-btn--outline {
  border-color: var(--cz-border);
}
.cz-icon-btn--round {
  border-radius: 50%;
  padding: 0;
  background: var(--cz-surface);
}

.cz-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--cz-grad);
  color: #fff;
  box-shadow: 0 6px 18px var(--cz-glow);
}
.cz-avatar i {
  font-size: 1.25rem;
}
.cz-avatar--sm {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}
.cz-avatar--sm i {
  font-size: 1rem;
}

.cz-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--cz-success);
  font-size: 0.75rem;
  line-height: 1.2;
}
.cz-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(57, 218, 138, 0.2);
}

/* ---------- Floating contact button + menu ---------- */
.cz-fab-wrap {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 1085;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: inherit;
}

.cz-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  height: 58px;
  padding: 0 1.5rem 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: var(--cz-grad);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  box-shadow: 0 14px 36px var(--cz-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.cz-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0, 207, 221, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.cz-fab:focus-visible {
  outline: 3px solid rgba(0, 207, 221, 0.55);
  outline-offset: 3px;
}
.cz-fab__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.cz-fab__icon i {
  position: absolute;
  font-size: 1.5rem;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.cz-fab__icon .cz-fab__close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
.cz-fab[aria-expanded='true'] .cz-fab__open {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}
.cz-fab[aria-expanded='true'] .cz-fab__close {
  opacity: 1;
  transform: none;
}
.cz-fab-wrap.is-hidden .cz-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.cz-fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.cz-fab-menu.is-open {
  pointer-events: auto;
}
.cz-fab-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  max-width: calc(100vw - 2.5rem);
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
  border: 1px solid var(--cz-border);
  border-radius: 20px;
  background: var(--cz-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  color: var(--cz-text);
  text-align: right;
  text-decoration: none;
  box-shadow: var(--cz-shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.15s, background 0.15s;
}
.cz-fab-menu.is-open .cz-fab-item {
  opacity: 1;
  transform: none;
}
.cz-fab-menu.is-open li:nth-last-child(1) .cz-fab-item { transition-delay: 0s, 0s, 0s, 0s; }
.cz-fab-menu.is-open li:nth-last-child(2) .cz-fab-item { transition-delay: 0.04s, 0.04s, 0s, 0s; }
.cz-fab-menu.is-open li:nth-last-child(3) .cz-fab-item { transition-delay: 0.08s, 0.08s, 0s, 0s; }
.cz-fab-item:hover,
.cz-fab-item:focus-visible {
  border-color: var(--cz-border-strong);
  background: rgba(40, 49, 68, 0.96);
  color: var(--cz-text);
  outline: none;
}
.cz-fab-item__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.1rem;
}
.cz-fab-item__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}
.cz-fab-item__subtitle {
  color: var(--cz-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.cz-fab-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cz-grad);
  color: #fff;
  box-shadow: 0 8px 20px var(--cz-glow);
}
.cz-fab-item__icon i {
  font-size: 1.45rem;
}
.cz-fab-item--light .cz-fab-item__icon {
  background: #ffffff;
  color: #5a8dee;
}

/* ---------- Modal ---------- */
.cz-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.cz-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease;
}
.cz-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 24, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cz-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  height: min(780px, calc(100dvh - 3rem));
  overflow: hidden;
  border: 1px solid var(--cz-border);
  border-radius: 24px;
  background:
    radial-gradient(90% 55% at 15% 0%, rgba(57, 218, 138, 0.12), transparent 60%),
    radial-gradient(90% 55% at 85% 0%, rgba(90, 141, 238, 0.16), transparent 60%),
    var(--cz-glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  color: var(--cz-text);
  box-shadow: var(--cz-shadow), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cz-modal.is-open .cz-modal__dialog {
  transform: none;
}
.cz-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--cz-border);
}
.cz-modal__title {
  flex: 1;
  min-width: 0;
}
.cz-modal__title strong {
  display: block;
  font-size: 0.975rem;
  line-height: 1.25;
}
.cz-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ---------- Chat panel (shared by modal & page) ---------- */
.cz-chat {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  color: var(--cz-text);
}
.cz-chat__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--cz-border) transparent;
}
.cz-chat__inner {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
}

.cz-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cz-empty[hidden] {
  display: none;
}
.cz-empty__title {
  margin: 0.5rem 0 0.5rem;
  background: linear-gradient(90deg, var(--cz-accent-1) 0%, #00cfdd 45%, var(--cz-accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
}
.cz-empty__text {
  margin-bottom: 1.5rem;
  color: var(--cz-muted);
  font-size: 0.9375rem;
}
.cz-suggestions {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.cz-suggestion {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--cz-border);
  border-radius: 16px;
  background: var(--cz-surface);
  color: var(--cz-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.cz-suggestion:hover,
.cz-suggestion:focus-visible {
  border-color: var(--cz-border-strong);
  background: var(--cz-surface-hover);
  transform: translateY(-1px);
  outline: none;
}
.cz-suggestion__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.cz-suggestion__title i {
  color: var(--cz-accent-1);
  font-size: 1.15rem;
}
.cz-suggestion__prompt {
  color: var(--cz-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* Messages */
.cz-msg {
  margin-bottom: 1.5rem;
  animation: cz-fade-in 0.25s ease;
}
.cz-msg--user {
  display: flex;
  justify-content: flex-end;
}
.cz-msg--user .cz-msg__bubble {
  max-width: min(80%, 600px);
  padding: 0.65rem 1rem;
  border-radius: 20px 20px 6px 20px;
  background: var(--cz-user-bubble);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
}
.cz-msg--assistant {
  display: flex;
  gap: 0.875rem;
}
.cz-msg__body {
  flex: 1;
  min-width: 0;
  padding-top: 0.2rem;
}
.cz-msg__error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--cz-danger);
  font-size: 0.875rem;
}
.cz-msg__note {
  color: var(--cz-muted);
  font-size: 0.8125rem;
  font-style: italic;
}

.cz-md {
  font-size: 0.9625rem;
  line-height: 1.7;
  word-wrap: break-word;
}
.cz-md > :first-child { margin-top: 0; }
.cz-md > :last-child { margin-bottom: 0; }
.cz-md p,
.cz-md ul,
.cz-md ol,
.cz-md pre,
.cz-md blockquote,
.cz-md table {
  margin: 0 0 0.85rem;
}
.cz-md ul,
.cz-md ol {
  padding-left: 1.35rem;
}
.cz-md li {
  margin-bottom: 0.25rem;
}
.cz-md li::marker {
  color: var(--cz-accent-1);
}
.cz-md h1,
.cz-md h2,
.cz-md h3,
.cz-md h4 {
  margin: 1.1rem 0 0.5rem;
  color: var(--cz-text);
  font-weight: 700;
  line-height: 1.35;
}
.cz-md h1 { font-size: 1.25rem; }
.cz-md h2 { font-size: 1.125rem; }
.cz-md h3,
.cz-md h4 { font-size: 1rem; }
.cz-md strong {
  color: var(--cz-text);
  font-weight: 650;
}
.cz-md a {
  color: var(--cz-link);
  text-decoration: underline;
  text-decoration-color: rgba(90, 141, 238, 0.45);
  text-underline-offset: 3px;
}
.cz-md a:hover {
  text-decoration-color: currentColor;
}
.cz-md code {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: var(--cz-code-bg);
  color: inherit;
  font-size: 0.85em;
}
.cz-md pre {
  position: relative;
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--cz-border);
  border-radius: 12px;
  background: var(--cz-code-bg);
}
.cz-md pre code {
  padding: 0;
  background: none;
  font-size: 0.8125rem;
}
.cz-md blockquote {
  padding-left: 0.9rem;
  border-left: 3px solid var(--cz-accent-2);
  color: var(--cz-muted);
}
.cz-md table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cz-md th,
.cz-md td {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--cz-border);
}
.cz-md th {
  background: var(--cz-surface);
}
.cz-md hr {
  border: 0;
  border-top: 1px solid var(--cz-border);
  opacity: 1;
}
.cz-md--streaming > :last-child::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.25em;
  border-radius: 50%;
  background: var(--cz-accent-1);
  vertical-align: middle;
  animation: cz-pulse 1s ease-in-out infinite;
}

.cz-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cz-muted);
  font-size: 0.875rem;
}
.cz-typing__dots {
  display: inline-flex;
  gap: 4px;
}
.cz-typing__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cz-accent-1);
  animation: cz-bounce 1.2s infinite ease-in-out;
}
.cz-typing__dots span:nth-child(2) { animation-delay: 0.15s; }
.cz-typing__dots span:nth-child(3) { animation-delay: 0.3s; }

.cz-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.cz-sources__label {
  width: 100%;
  color: var(--cz-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cz-source {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--cz-border);
  border-radius: 999px;
  background: var(--cz-surface);
  color: var(--cz-text);
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.cz-source span {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cz-source i {
  color: var(--cz-accent-1);
}
.cz-source:hover {
  border-color: var(--cz-border-strong);
  background: var(--cz-surface-hover);
  color: var(--cz-text);
}

.cz-msg__actions {
  display: flex;
  gap: 0.15rem;
  margin-top: 0.4rem;
  margin-left: -0.4rem;
  opacity: 0.85;
}
.cz-msg__actions .cz-icon-btn {
  min-width: 30px;
  height: 30px;
}
.cz-msg__actions .cz-icon-btn i {
  font-size: 1rem;
}

/* Jump to bottom */
.cz-jump {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--cz-border);
  border-radius: 50%;
  background: var(--cz-glass);
  color: var(--cz-text);
  box-shadow: var(--cz-shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.15s, transform 0.15s;
}
.cz-jump.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

/* Composer */
.cz-composer-wrap {
  position: relative;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 0.75rem;
}
.cz-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border: 1px solid var(--cz-border);
  border-radius: 26px;
  background: var(--cz-surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cz-composer:focus-within {
  border-color: var(--cz-border-strong);
  box-shadow: 0 0 0 4px var(--cz-focus);
}
.cz-composer__input {
  flex: 1;
  min-height: 24px;
  max-height: 200px;
  margin: 0;
  padding: 0.45rem 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--cz-text);
  font: inherit;
  font-size: 0.9625rem;
  line-height: 1.5;
}
.cz-composer__input::placeholder {
  color: var(--cz-muted);
}
.cz-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--cz-grad);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.cz-send:hover:not(:disabled) {
  transform: scale(1.05);
}
.cz-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cz-send i {
  font-size: 1.25rem;
}
.cz-send .cz-send__stop {
  display: none;
}
.cz-chat.is-streaming .cz-send .cz-send__go {
  display: none;
}
.cz-chat.is-streaming .cz-send .cz-send__stop {
  display: inline-block;
}
.cz-disclaimer {
  margin: 0.5rem 0 0;
  color: var(--cz-muted);
  font-size: 0.7rem;
  text-align: center;
}

/* ---------- Full page ---------- */
body.cz-chat-page {
  overflow: hidden;
}
.cz-app {
  position: fixed;
  inset: var(--cz-top, 76px) 0 0 0;
  z-index: 1;
  display: flex;
  background: var(--cz-bg);
  color: var(--cz-text);
}
.cz-app.cz-theme-dark {
  background:
    radial-gradient(60% 45% at 20% 0%, rgba(57, 218, 138, 0.08), transparent 70%),
    radial-gradient(60% 45% at 80% 0%, rgba(90, 141, 238, 0.12), transparent 70%),
    var(--cz-bg);
}
.cz-sidebar {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 280px;
  padding: 0.875rem 0.875rem 4.25rem; /* room for the site's cookie-settings button */
  border-right: 1px solid var(--cz-border);
  background: var(--cz-surface);
  transition: margin-left 0.25s ease, transform 0.25s ease;
}
.cz-app.is-sidebar-collapsed .cz-sidebar {
  margin-left: -280px;
}
.cz-sidebar__new {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--cz-border);
  border-radius: 12px;
  background: var(--cz-bg);
  color: var(--cz-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cz-sidebar__new:hover {
  border-color: var(--cz-border-strong);
  background: var(--cz-surface-hover);
}
.cz-sidebar__new i {
  font-size: 1.15rem;
}
.cz-sidebar__list {
  flex: 1;
  min-height: 0;
  margin: 1rem -0.25rem 0;
  padding: 0 0.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.cz-sidebar__group {
  margin: 0.9rem 0 0.35rem 0.6rem;
  color: var(--cz-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cz-sidebar__empty {
  padding: 0.6rem;
  color: var(--cz-muted);
  font-size: 0.8125rem;
}
.cz-history-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 10px;
}
.cz-history-item__link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0.5rem 2.2rem 0.5rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cz-text);
  font-size: 0.85rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.cz-history-item:hover .cz-history-item__link,
.cz-history-item.is-active .cz-history-item__link {
  background: var(--cz-surface-hover);
}
.cz-history-item.is-active .cz-history-item__link {
  font-weight: 600;
}
.cz-history-item__delete {
  position: absolute;
  right: 0.2rem;
  min-width: 28px;
  height: 28px;
  opacity: 0;
}
.cz-history-item:hover .cz-history-item__delete,
.cz-history-item.is-active .cz-history-item__delete,
.cz-history-item__delete:focus-visible {
  opacity: 1;
}
.cz-sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--cz-border);
}
.cz-sidebar__footer a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  color: var(--cz-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.cz-sidebar__footer a:hover {
  background: var(--cz-surface-hover);
  color: var(--cz-text);
}
.cz-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.cz-main__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
}
.cz-main__header strong {
  font-size: 0.975rem;
}
.cz-sidebar-backdrop {
  display: none;
}

/* ---------- Animations ---------- */
@keyframes cz-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes cz-bounce {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}
@keyframes cz-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cz-ai-scope *,
  .cz-app * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .cz-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 3;
    background: var(--cz-bg);
    box-shadow: var(--cz-shadow);
    transform: translateX(-100%);
  }
  .cz-app.is-sidebar-collapsed .cz-sidebar {
    margin-left: 0;
  }
  .cz-app.is-sidebar-open .cz-sidebar {
    transform: none;
  }
  /* The site's cookie-settings button would cover the composer; show it only with the sidebar open */
  body.cz-chat-page:has(.cz-app:not(.is-sidebar-open)) #cookie-settings-icon {
    display: none !important;
  }
  .cz-app.is-sidebar-open .cz-sidebar-backdrop {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: rgba(12, 16, 24, 0.45);
  }
}

@media (max-width: 575.98px) {
  .cz-fab {
    height: 54px;
    font-size: 1rem;
  }
  .cz-fab__label {
    display: none;
  }
  .cz-fab {
    padding: 0 4px;
  }
  .cz-fab-item {
    min-width: 0;
    width: calc(100vw - 2.5rem);
  }
  .cz-modal {
    padding: 0;
  }
  .cz-modal__dialog {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .cz-modal__open-label {
    display: none;
  }
  .cz-suggestions {
    grid-template-columns: 1fr;
  }
  .cz-chat__inner,
  .cz-composer-wrap {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
}
