/* Packshot Flow — chat / adjust-with-AI panel */
  /* ========= CHAT ========= */
  .chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 12px 14px;
    flex: 0.95 1 0;
    max-height: 700px;
  }
  .chat-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    flex-shrink: 0;
  }
  .chat-head-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
  }
  .chat-head-title { font-size: 12.5px; font-weight: 600; }
  .chat-head-sub { font-size: 11px; color: var(--text-3); }

  .target-selector {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 10px;
    flex-shrink: 0;
  }
  .target-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  .target-btn:hover { color: var(--text-1); }
  .target-btn.active {
    background: #fff;
    color: var(--text-1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.04);
  }
  .target-btn svg { color: var(--target-ring); }

  .chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
    flex-shrink: 0;
  }
  .chat-chip {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s;
  }
  .chat-chip:hover:not(:disabled) { background: #fff; border-color: var(--border-strong); color: var(--text-1); }
  .chat-chip:disabled { opacity: 0.5; cursor: not-allowed; }

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 4px 2px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
  .chat-messages::-webkit-scrollbar { width: 5px; }
  .chat-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
  .chat-msg {
    max-width: 80%;
    padding: 7px 11px;
    border-radius: 11px;
    font-size: 12.5px;
    line-height: 1.4;
    word-wrap: break-word;
  }
  .chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
  }
  .chat-msg.bot {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text-1);
    border-bottom-left-radius: 4px;
  }
  .chat-msg.bot.thinking { color: var(--text-3); font-style: italic; }
  .chat-msg-target {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    padding: 2px 7px;
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.9;
  }
  .chat-msg.bot .chat-msg-target {
    background: rgba(99,102,241,0.12);
    color: var(--target-ring);
  }

  .chat-input-row {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px 5px 5px 11px;
    display: flex;
    gap: 6px;
    align-items: center;
    transition: border-color 0.15s;
    flex-shrink: 0;
  }
  .chat-input-row:focus-within {
    border-color: var(--text-1);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 6px 2px;
    color: var(--text-1);
  }
  .chat-input::placeholder { color: var(--text-3); }
  .chat-input:disabled { cursor: not-allowed; }
  .chat-send {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
  }
  .chat-send:hover:not(:disabled) { transform: scale(1.06); }
  .chat-send:disabled { background: #ededed; color: #aaa; cursor: not-allowed; }

  /* Attach-reference button (left of the input) */
  .chat-attach {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
  }
  .chat-attach:hover:not(:disabled) { background: var(--surface-2); color: var(--text-1); }
  .chat-attach:disabled { color: #ccc; cursor: not-allowed; }

  /* Attached reference thumbnails, shown above the input row */
  .chat-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }
  .chat-refs:empty { display: none; }
  .chat-ref {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f2f2f2;
  }
  .chat-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .chat-ref button {
    position: absolute;
    top: -6px; right: -6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    background: rgba(10,10,10,0.85);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

