.gpt-chat-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.gpt-chat-page-head h1 { margin: 0; font-size: 1.25rem; }
.gpt-chat-layout { display: grid; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); min-height: min(720px, calc(100vh - 160px)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.gpt-chat-sidebar { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: #f7f8fa; }
.gpt-chat-sidebar-head, .gpt-chat-controls { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.gpt-chat-sidebar-head { justify-content: space-between; }
.gpt-chat-sidebar-head h2 { margin: 0; font-size: 1rem; }
.gpt-chat-conversations { list-style: none; display: grid; align-content: start; gap: 3px; min-height: 0; overflow: auto; padding: 7px; margin: 0; }
.gpt-chat-conversation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 3px; min-width: 0; }
.gpt-chat-select-conversation { width: 100%; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; border-color: transparent; background: transparent; }
.gpt-chat-select-conversation[aria-current="page"] { border-color: #c8d8e7; background: #e8f1f8; color: #163b58; }
.gpt-chat-row-action { padding: 5px 6px; font-size: .74rem; }
.gpt-chat-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.gpt-chat-controls { flex-wrap: wrap; }
.gpt-chat-controls label { display: flex; align-items: center; gap: 6px; min-width: min(240px, 100%); color: var(--muted); font-size: .86rem; }
.gpt-chat-controls select { min-width: 0; max-width: 290px; }
.gpt-chat-transcript { list-style: none; display: flex; flex-direction: column; align-items: stretch; gap: 12px; overflow: auto; min-height: 260px; padding: 18px clamp(12px, 4vw, 40px); margin: 0; }
.gpt-chat-message { max-width: min(780px, 92%); padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.gpt-chat-message-user { align-self: flex-end; border-color: #c8d8e7; background: #edf4f9; }
.gpt-chat-message-assistant { align-self: flex-start; }
.gpt-chat-message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.gpt-chat-message-meta strong { color: #263746; }
.gpt-chat-task-status { padding: 2px 6px; border-radius: 4px; background: #eef1f4; }
.gpt-chat-task-status.status-succeeded { color: #216d37; background: #e4f4e8; }
.gpt-chat-task-status.status-failed, .gpt-chat-task-status.status-needs_review { color: var(--danger); background: #fdecea; }
.gpt-chat-message p { margin: 7px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.55; }
.gpt-chat-composer { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fbfcfd; }
.gpt-chat-composer textarea { width: 100%; min-height: 92px; resize: vertical; }
.gpt-chat-composer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gpt-chat-charge-confirm { display: inline-flex; align-items: center; gap: 6px; }
.gpt-chat-charge-confirm input { width: auto; }
.gpt-chat-charge-note, .gpt-chat-empty { color: var(--muted); font-size: .86rem; }
.gpt-chat-composer-actions > button { margin-left: auto; }
.gpt-chat-waiting { align-self: center; color: var(--muted); font-size: .86rem; }
.gpt-chat-failed-note { align-self: stretch; padding: 8px 10px; border-left: 3px solid #c69220; background: #fff8e1; color: #725500; font-size: .84rem; }
@media (max-width: 720px) {
  .gpt-chat-layout { grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 150px); }
  .gpt-chat-sidebar { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .gpt-chat-conversations { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .gpt-chat-controls label { flex: 1 1 100%; }
  .gpt-chat-controls select { flex: 1; max-width: none; }
  .gpt-chat-message { max-width: 100%; }
  .gpt-chat-charge-note { flex: 1 1 100%; }
}
