:root {
    --cdl-gold: #d4af37;
    --cdl-gold-dark: #b8962e;
    --cdl-dark: #222222;
    --cdl-bg: #f7f7f7;
    --cdl-border: #dddddd;
  }

  #cdl-chat-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--cdl-gold);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    z-index: 2147483000;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .18s ease, background .18s ease;
  }

  #cdl-chat-btn:hover,
  #cdl-chat-btn:focus-visible {
    transform: scale(1.06);
    background: var(--cdl-gold-dark);
  }

  #cdl-chat-window {
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 370px;
    height: min(540px, calc(100vh - 125px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.28);
    z-index: 2147483000;
    font-family: Arial, Helvetica, sans-serif;
  }

  #cdl-chat-window.cdl-open {
    display: flex;
  }

  #cdl-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    background: var(--cdl-dark);
    color: var(--cdl-gold);
  }

  #cdl-chat-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
  }

  #cdl-chat-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  #cdl-chat-close:hover,
  #cdl-chat-close:focus-visible {
    background: rgba(255,255,255,.12);
  }

  #cdl-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--cdl-bg);
    scroll-behavior: smooth;
  }

  .cdl-msg {
    max-width: 87%;
    margin: 0 0 11px;
    padding: 10px 13px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .cdl-msg-user {
    margin-left: auto;
    color: #fff;
    background: var(--cdl-gold);
    border-bottom-right-radius: 4px;
  }

  .cdl-msg-bot {
    margin-right: auto;
    color: #333;
    background: #e9ecef;
    border-bottom-left-radius: 4px;
  }

  .cdl-link {
    color: #8b6f12;
    font-weight: 700;
    text-decoration: underline;
  }

  #cdl-chat-suggestions {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 9px 10px;
    border-top: 1px solid #eee;
    background: #fff;
    scrollbar-width: thin;
  }

  .cdl-chip {
    flex: 0 0 auto;
    border: 1px solid #d9c06d;
    border-radius: 999px;
    padding: 7px 10px;
    background: #fffaf0;
    color: #5f4c0c;
    font-size: 12px;
    cursor: pointer;
  }

  .cdl-chip:hover,
  .cdl-chip:focus-visible {
    background: #f3e8bd;
  }

  #cdl-chat-input-container {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--cdl-border);
    background: #fff;
  }

  #cdl-chat-input {
    min-width: 0;
    flex: 1;
    padding: 12px;
    border: 0;
    outline: 0;
    font-size: 14px;
  }

  #cdl-chat-send {
    border: 0;
    padding: 10px 16px;
    background: var(--cdl-gold);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
  }

  #cdl-chat-send:hover,
  #cdl-chat-send:focus-visible {
    background: var(--cdl-gold-dark);
  }

  #cdl-chat-btn:focus-visible,
  #cdl-chat-close:focus-visible,
  #cdl-chat-send:focus-visible,
  .cdl-chip:focus-visible,
  #cdl-chat-input:focus-visible {
    outline: 3px solid rgba(212,175,55,.35);
    outline-offset: 2px;
  }

  @media (max-width: 520px) {
    #cdl-chat-btn {
      right: 14px;
      bottom: 14px;
      width: 56px;
      height: 56px;
    }

    #cdl-chat-window {
      left: 10px;
      right: 10px;
      bottom: 80px;
      width: auto;
      height: min(70vh, 560px);
      border-radius: 12px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    #cdl-chat-btn,
    #cdl-chat-messages {
      transition: none;
      scroll-behavior: auto;
    }
  }