.bot-workspace { padding: var(--space-5) 0; }
.bot-workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
#bot-chat-access { color: var(--muted); font-size: var(--text-small); }
.bot-workspace-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); height: calc(100dvh - 176px); min-height: 420px; max-height: 1000px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
body:has(#page-bot:not([hidden])) #support-agent { display: none; }
.bot-workspace-sidebar { padding: var(--space-4); background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; }
.bot-workspace-sidebar > .btn { width: 100%; }
.bot-workspace-sidebar h2 { font-size: var(--text-small); color: var(--muted); margin: var(--space-5) 0 var(--space-2); font-weight: 500; }
#bot-history-empty { font-size: var(--text-small); color: var(--muted); padding-block: var(--space-2); }
.bot-history-item { display: block; width: 100%; border: 0; background: transparent; color: var(--ink-soft); padding: var(--space-3); border-radius: var(--control-radius); text-align: left; font: inherit; font-size: var(--text-control); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-history-item:hover, .bot-history-item[aria-current="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.bot-workspace-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.bot-chat-heading { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); flex: none; }
.bot-chat-heading img { object-fit: contain; flex: none; }
.bot-chat-heading > div { flex: 1; min-width: 0; }
.bot-chat-heading h1 { font-size: 18px; line-height: 1.4; }
.bot-chat-heading p { color: var(--muted); font-size: var(--text-small); margin-top: var(--space-1); }
.bot-chat-transcript { flex: 1; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; padding: var(--space-5); }
.bot-chat-transcript .message-bubble, .bot-chat-transcript .chat-text { font-size: 14px; line-height: 1.8; }
.bot-chat-transcript .message.user { max-width: 90%; }
.bot-chat-approvals:empty, .bot-chat-notice:has([hidden]):not(:has(:not([hidden]))) { display: none; }
.bot-chat-notice { flex: none; padding: 0 var(--space-5); color: var(--danger); font-size: var(--text-small); }
.bot-chat-approvals { padding: 0 var(--space-5); }
.bot-chat-approval { border: 1px solid var(--line); border-radius: var(--control-radius); padding: var(--space-3); font-size: var(--text-control); }
.bot-chat-approval button { margin: var(--space-2) var(--space-2) 0 0; }
.bot-chat-composer { flex: none; padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); }
.bot-chat-parameters { color: var(--muted); font-size: var(--text-small); margin-bottom: var(--space-3); }
.bot-chat-parameters summary { cursor: pointer; width: fit-content; padding-block: var(--space-1); }
.bot-chat-parameters[open] { max-height: 210px; overflow-y: auto; }
.bot-parameter-fields, .bot-parameter-group { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.bot-parameter-fields { margin-top: var(--space-3); }
.bot-parameter-fields label { display: flex; flex-direction: column; gap: var(--space-1); min-width: 110px; font-size: var(--text-small); }
.bot-chat-composer textarea { display: block; width: 100%; min-height: 88px; max-height: 180px; resize: vertical; border: 1px solid var(--control-border); border-radius: var(--control-radius); background: var(--control-surface); color: var(--ink); font: inherit; font-size: 14px; padding: var(--space-3); }
.bot-chat-composer textarea:focus { outline: 2px solid var(--control-focus); outline-offset: 2px; }
.bot-chat-composer textarea:disabled { background: var(--bg); }
.bot-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); }
.bot-composer-footer > span { color: var(--muted); font-size: var(--text-small); }
.bot-composer-footer .btn { display: inline-flex; align-items: center; gap: var(--space-3); }
.bot-result-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); max-width: 560px; padding: var(--space-3); border: 1px solid var(--line); border-radius: 12px; margin: var(--space-3) 0; }
.bot-result-file > img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: var(--control-radius); background: var(--bg); }
.bot-result-file > strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: var(--text-control); }
.bot-file-state { color: var(--muted); font-size: var(--text-small); }
.bot-detail-actions { display: flex; gap: var(--space-2); }
@media (max-width: 760px) {
  .bot-workspace { padding-top: var(--space-4); }
  .bot-workspace-heading { align-items: flex-start; gap: var(--space-2); }
  .bot-workspace-heading #bot-chat-access { text-align: right; max-width: 58%; }
  .bot-workspace-shell { grid-template-columns: minmax(0,1fr); height: calc(100dvh - 170px); min-height: 500px; }
  .bot-workspace-sidebar { display: flex; align-items: center; gap: var(--space-2); border-right: 0; border-bottom: 1px solid var(--line); padding: var(--space-2) var(--space-3); overflow: auto; }
  .bot-workspace-sidebar > .btn { width: auto; flex: none; }
  .bot-workspace-sidebar h2, #bot-history-empty { display: none; }
  #bot-chat-history { display: flex; gap: var(--space-2); } .bot-history-item { max-width: 160px; flex: none; }
  .bot-workspace-main { min-height: 0; }
  .bot-workspace-shell { grid-template-rows: auto minmax(0,1fr); }
  .bot-chat-heading { padding: var(--space-3); gap: var(--space-2); }
  .bot-chat-heading img { width: 36px; height: 36px; } .bot-chat-heading h1 { font-size: 16px; }
  .bot-chat-heading p { display: none; } .bot-chat-heading > button { padding-inline: 4px; }
  .bot-chat-transcript { padding: var(--space-4); }
  .bot-chat-composer { padding: var(--space-3); }
  .bot-chat-composer textarea { font-size: 16px; }
  .bot-chat-parameters[open] { max-height: 210px; overflow-y: auto; }
  .bot-composer-footer > span { font-size: 11px; }
  .bot-chat-notice, .bot-chat-approvals { padding-inline: var(--space-3); }
  .bot-detail-footer { flex-wrap: wrap; } .bot-detail-actions { margin-left: auto; }
}
