  /* ── CHAT ADVISOR ── */
  .chat-fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 9000;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--navy); color: var(--gold-light);
    border: 1px solid rgba(196,164,74,0.3);
    box-shadow: 0 4px 20px rgba(18,21,31,0.35);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 22px; transition: transform 0.2s, box-shadow 0.2s;
  }
  .chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(18,21,31,0.45); }
  .chat-fab:active { transform: scale(0.95); }
  .chat-fab.hidden { display: none; }

  .chat-overlay {
    position: fixed; inset: 0; z-index: 9500;
    background: rgba(18,21,31,0.4);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .chat-overlay.open { opacity: 1; pointer-events: auto; }

  .chat-panel {
    position: fixed; bottom: 0; right: 0; z-index: 9600;
    width: 420px; max-width: 100vw; height: 70vh; max-height: 700px;
    background: #faf7f0;
    border-top-left-radius: 12px; border-top-right-radius: 12px;
    border: 1px solid rgba(139,105,20,0.15); border-bottom: none;
    box-shadow: 0 -8px 40px rgba(18,21,31,0.2);
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  }
  .chat-panel.open { transform: translateY(0); }

  .chat-header {
    padding: 14px 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }
  .chat-header-title {
    font-family: 'Cormorant Garamond', serif; font-size: 17px;
    font-weight: 400; color: var(--navy); flex: 1;
  }
  .chat-header-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--text-secondary); font-size: 16px; line-height: 1;
    transition: color 0.15s;
  }
  .chat-header-btn:hover { color: var(--ink); }

  .chat-context-bar {
    padding: 6px 16px; font-family: 'Inter', sans-serif;
    font-size: 11px; color: var(--gold); background: var(--gold-glow);
    border-bottom: 1px solid var(--border-light);
    display: none; flex-shrink: 0;
  }
  .chat-context-bar.visible { display: block; }

  .chat-thread-picker {
    position: absolute; top: 50px; left: 16px; right: 16px;
    background: #faf7f0; border: 1px solid var(--border);
    border-radius: 6px; box-shadow: 0 8px 32px rgba(18,21,31,0.15);
    max-height: 280px; overflow-y: auto; display: none; z-index: 10;
  }
  .chat-thread-picker.open { display: block; }
  .chat-thread-item {
    padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
  }
  .chat-thread-item:hover { background: var(--cream-dark); }
  .chat-thread-item:last-child { border-bottom: none; }
  .chat-thread-item-title {
    font-family: 'Spectral', serif; font-size: 13px; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .chat-thread-item-date {
    font-family: 'Inter', sans-serif; font-size: 10px; color: var(--text-secondary); margin-top: 2px;
  }
  .chat-thread-new {
    padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 6px;
    font-family: 'Cormorant SC', serif; font-size: 12px; color: var(--gold);
    letter-spacing: 0.06em; border-bottom: 1px solid var(--border-light);
  }
  .chat-thread-new:hover { background: var(--gold-glow); }

  .chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .chat-msg {
    max-width: 85%; padding: 10px 14px;
    border-radius: 12px; line-height: 1.5;
    font-family: 'Spectral', serif; font-size: 14px; font-weight: 300;
  }
  .chat-msg.user {
    align-self: flex-end; background: var(--navy); color: var(--cream);
    border-bottom-right-radius: 4px;
  }
  .chat-msg.assistant {
    align-self: flex-start; background: #fff;
    border: 1px solid var(--border-light); color: var(--ink);
    border-bottom-left-radius: 4px;
  }
  .chat-msg-img {
    max-width: 100%; max-height: 180px; border-radius: 6px;
    margin-bottom: 6px; display: block;
  }
  .chat-msg-time {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: rgba(90,78,60,0.4); margin-top: 4px;
  }
  .chat-msg.user .chat-msg-time { color: rgba(245,240,232,0.4); }

  .chat-citation {
    display: inline-block; font-family: 'Inter', sans-serif;
    font-size: 10px; background: var(--gold-glow); color: var(--gold);
    padding: 2px 8px; border-radius: 10px; margin: 2px 2px 0 0;
    text-decoration: none; transition: background 0.15s;
  }
  .chat-citation:hover { background: rgba(196,164,74,0.25); }

  .chat-typing {
    align-self: flex-start; padding: 10px 14px;
    background: #fff; border: 1px solid var(--border-light);
    border-radius: 12px; border-bottom-left-radius: 4px;
    display: none; gap: 4px; align-items: center;
  }
  .chat-typing.visible { display: flex; }
  .chat-typing-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-secondary); opacity: 0.4;
    animation: typingBounce 1.4s infinite;
  }
  .chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
  }

  .chat-searching {
    align-self: flex-start; padding: 8px 14px;
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: var(--gold); display: none; align-items: center; gap: 6px;
  }
  .chat-searching.visible { display: flex; }

  .chat-input-area {
    padding: 12px 16px; border-top: 1px solid var(--border-light);
    display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0;
    background: #faf7f0;
  }
  .chat-input-preview {
    display: none; padding: 8px 16px 0;
    border-top: 1px solid var(--border-light); flex-shrink: 0;
  }
  .chat-input-preview.visible { display: block; }
  .chat-input-preview img {
    width: 48px; height: 48px; object-fit: cover; border-radius: 4px;
    border: 1px solid var(--border);
  }
  .chat-input-preview .remove-img {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--rust); color: #fff; border: none;
    font-size: 10px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
  }
  #chat-input {
    flex: 1; border: 1px solid var(--border-light); border-radius: 8px;
    padding: 10px 12px; font-family: 'Spectral', serif;
    font-size: 14px; font-weight: 300; color: var(--ink);
    background: #fff; resize: none; outline: none;
    max-height: 120px; min-height: 40px; line-height: 1.4;
    transition: border-color 0.2s;
  }
  #chat-input:focus { border-color: var(--gold); }
  #chat-input::placeholder { color: rgba(90,78,60,0.35); }
  .chat-attach-btn {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: none; border: 1px solid var(--border-light);
    cursor: pointer; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: border-color 0.15s, color 0.15s;
  }
  .chat-attach-btn:hover { border-color: var(--gold); color: var(--gold); }
  .chat-send-btn {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); border: none; cursor: pointer;
    color: var(--gold-light); display: flex;
    align-items: center; justify-content: center;
    font-size: 16px; transition: background 0.15s, transform 0.15s;
  }
  .chat-send-btn:hover { background: var(--navy-mid); }
  .chat-send-btn:active { transform: scale(0.92); }
  .chat-send-btn:disabled { opacity: 0.4; cursor: default; }

  @media (max-width: 600px) {
    .chat-panel { width: 100vw; height: 85vh; max-height: none;
      border-top-left-radius: 16px; border-top-right-radius: 16px; }
    .chat-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; font-size: 20px; }
  }
