[data-screen="agent"] { --thread-width: min(100%, 824px); }
[data-screen="agent"] > :is(.agent-header, #agent-current-thread, #agent-thread-info, .agent-setup) {
  width: var(--thread-width);
  margin-inline: auto;
}
.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid #292c31;
}
.agent-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.agent-heading h1 { margin: 0 0 2px; font-size: 24px; line-height: 1.2; letter-spacing: 0; }
#agent-model-label { color: #a6a9b1; font-size: 12px; }
.agent-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border: 1px solid #41434a;
  border-radius: 8px;
  color: #eef1f6;
  background: linear-gradient(145deg,#2c3035,#17191c);
  box-shadow: inset 0 1px 0 #ffffff13;
}
.agent-emblem svg { width: 19px; height: 19px; }
.agent-connection {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #363a40;
  border-radius: 7px;
  background: #15171a;
  color: #e5e7ec;
  text-align: left;
  font-size: 12px;
}
.agent-connection[hidden] { display: none; }
.agent-connection:hover { background: #202328; }
.agent-connection[data-connected="true"] { color: #b3ddce; }
.agent-connection svg { width: 15px; height: 15px; flex: none; }
.agent-nav {
  margin: 5px 0 6px 18px;
  padding-left: 9px;
  border-left: 1px solid #34373b;
}
#agent-tablist {
  display: grid;
  gap: 3px;
  max-height: min(36vh, 306px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #42454c transparent;
}
.agent-tab {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 36px;
  padding-right: 2px;
  color: #aeb0b8;
  border: 1px solid transparent;
  border-radius: 7px;
}
.agent-tab.active {
  background: linear-gradient(160deg,#232529,#191a1d);
  border-color: #3e4148;
  color: #f2f3f5;
  box-shadow: inset 0 1px 0 #ffffff0b;
}
.agent-tab-title,.agent-tab-close {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  text-align: left;
}
.agent-tab-title { flex: 1; }
.agent-tab-title:hover { color: #f4f5f6; }
.agent-tab :is(button):focus-visible { outline: 1px solid #b8c2cf; outline-offset: -3px; }
.agent-tab-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-tab-title svg,.agent-tab-close svg { flex: none; width: 14px; height: 14px; }
.agent-tab-close { justify-content: center; flex: 0 0 32px; color: #9da0aa; }
.agent-tab-close:disabled { visibility: hidden; }
.agent-tab-close:hover { background: #ffffff14; color: #f1d2cd; }
.agent-nav .agent-new-chat {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 36px;
  margin: 0 0 3px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #bdc2cc;
  font-size: 12px;
  text-align: left;
}
.agent-nav .agent-new-chat:hover { color: #f4f5f6; background: #ffffff12; }
.agent-nav .agent-new-chat svg { width: 14px; height: 14px; flex: none; }
#agent-current-thread:focus:not(:focus-visible) { outline: 0; }
.agent-welcome { padding: 28px 0 15px; }
.agent-welcome h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: 0; }
#agent-thread-info { margin-top: 10px; color: #e7c492; font-size: 12px; }
.generation-screen[data-screen="agent"] .agent-transcript { margin: 0; padding: 12px 0 4px; max-width: none; }
.generation-screen[data-screen="agent"] .agent-transcript .request-turn { padding: 12px 0 18px; }
.generation-screen[data-screen="agent"] .agent-transcript .request-turn + .request-turn { border-top: 1px solid #232528; }
.generation-screen[data-screen="agent"] .agent-transcript .request-user { margin-block-end: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.generation-screen[data-screen="agent"] .agent-transcript .request-answer { margin: 0; padding-left: 36px; }
.agent-pending { color: #999eaa; font-size: 13px; }
.generation-screen[data-screen="agent"] > form.composer[data-composer] { --prompt-height: 130px; }
.generation-screen[data-screen="agent"][data-agent-chat="true"] > form.composer[data-composer] { --prompt-height: 76px; }
.generation-screen[data-screen="agent"] .voice-disclosure { display: none; }
.generation-screen[data-screen="agent"] .voice-disclosure.agent-voice-visible { display: block; }
.generation-screen[data-screen="agent"] > .examples-heading { margin-top: 32px; }
.generation-screen[data-screen="agent"][data-agent-chat="true"] > #agent-gallery .example { aspect-ratio: 16/10; }
.agent-setup {
  margin-block: 12px;
  padding: 13px;
  border: 1px solid #41434a;
  border-radius: 8px;
  background: #131518;
}
.agent-setup label { display: block; font-size: 13px; margin-bottom: 8px; }
.agent-setup-actions { display: flex; align-items: center; gap: 7px; }
.agent-setup input { flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #373b41; border-radius: 6px; background: #0b0d0f; color: inherit; }
.agent-setup-status { margin-top: 8px; color: #e0c196; font-size: 12px; overflow-wrap: anywhere; }
.agent-setup .primary-button { min-height: 40px; white-space: nowrap; padding-inline: 10px; }

@media (max-width: 700px) {
  .agent-heading h1 { font-size: 20px; }
  .agent-nav .agent-new-chat, .agent-tab-title, .agent-tab-close { min-height: 44px; }
  .agent-tab-close { flex-basis: 42px; }
  .agent-welcome { padding: 22px 0 14px; }
  .generation-screen[data-screen="agent"] .agent-transcript .request-answer { padding-left: 0; }
  .generation-screen[data-screen="agent"] > form.composer[data-composer] { --prompt-height: 112px; }
}
