
      /* Restyled chat — matches the per-project pattern from the main dashboard */
      #cortex-chat .chat-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
      #cortex-chat .chat-avatar {
        width: 36px; height: 36px; border-radius: 8px;
        background: var(--ink); color: white;
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
      }
      #cortex-chat .chat-avatar svg { width: 18px; height: 18px; }
      #cortex-chat .chat-head-text { flex: 1; min-width: 0; }
      #cortex-chat .chat-title { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.1; }
      #cortex-chat .chat-context {
        font-size: 10px; color: var(--ink-3);
        font-family: 'JetBrains Mono', monospace;
        letter-spacing: 0.08em; text-transform: uppercase;
        margin-top: 4px;
      }
      #cortex-chat .chat-close {
        background: transparent; border: none; cursor: pointer;
        color: var(--ink-3); font-size: 18px; padding: 4px 8px;
        line-height: 1; border-radius: 4px;
      }
      #cortex-chat .chat-close:hover { background: rgba(0,0,0,0.05); color: var(--ink); }

      #cortex-chat .chat-welcome {
        padding: 18px 20px 14px;
        font-size: 13.5px; color: var(--ink); line-height: 1.55;
        flex-shrink: 0;
      }
      #cortex-chat .chat-welcome b { font-weight: 600; }
      #cortex-chat .chat-welcome code {
        background: rgba(0,0,0,0.04); padding: 1px 5px; border-radius: 3px;
        font-family: 'JetBrains Mono', monospace; font-size: 12px;
      }

      #cortex-chat .chat-suggestions { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; overflow-y: auto; min-height: 0; }
      #cortex-chat .chat-suggestion {
        background: white; border: 1px solid var(--border-2, rgba(0,0,0,0.10));
        border-radius: 999px; padding: 10px 16px;
        font-size: 12.5px; color: var(--ink); cursor: pointer;
        font-family: inherit; text-align: left;
        transition: all 0.12s;
        line-height: 1.3;
      }
      #cortex-chat .chat-suggestion:hover {
        background: var(--clay-soft); border-color: var(--clay); color: var(--clay);
      }

      #cortex-chat .chat-input { padding: 14px 20px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-shrink: 0; background: var(--bg-card); }
      #cortex-chat .chat-input-box {
        flex: 1; background: white; border: 1px solid var(--border-2, rgba(0,0,0,0.12));
        border-radius: 999px; padding: 10px 18px;
        font-size: 13px; color: var(--ink); font-family: inherit;
        outline: none;
      }
      #cortex-chat .chat-input-box:focus { border-color: var(--ink); }
      #cortex-chat .chat-input-box::placeholder { color: var(--ink-4); }
      #cortex-chat .chat-send {
        width: 38px; height: 38px; border-radius: 50%;
        background: var(--ink); color: white; border: none;
        cursor: pointer; display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
      }
      #cortex-chat .chat-send:hover { background: #000; }
      #cortex-chat .chat-send svg { width: 14px; height: 14px; fill: white; }
      #cortex-chat .chat-send:disabled { opacity: 0.35; cursor: not-allowed; }

      /* Live message thread (appears once user clicks a suggestion) */
      #cortex-chat .chat-thread { padding: 16px 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
      #cortex-chat .chat-thread:empty { display: none; }
      #cortex-chat .msg { display: flex; gap: 10px; align-items: flex-start; }
      #cortex-chat .msg-avatar {
        width: 22px; height: 22px; border-radius: 50%;
        font-size: 10px; font-weight: 600; color: white;
        display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        font-family: 'JetBrains Mono', monospace;
      }
      #cortex-chat .msg-avatar.c { background: var(--ink); }
      #cortex-chat .msg-avatar.c svg { width: 13px; height: 13px; stroke: white; }
      #cortex-chat .msg-avatar.r { background: var(--clay); }
      #cortex-chat .msg-body { flex: 1; font-size: 13px; line-height: 1.55; color: var(--ink); padding-top: 2px; }
      #cortex-chat .msg-body.c { color: var(--ink); }
      #cortex-chat .msg-body.r { color: var(--ink-2); }
