:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #111827;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.quick-version {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
  vertical-align: middle;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.token-input {
  width: 180px;
}

.auth-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.auth-status-authed {
  border-color: #b7e4cf;
  background: #ecfdf3;
  color: #067647;
}

.auth-status-token {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.auth-status-guest {
  border-color: #d8dee6;
  background: #f8fafc;
  color: #4b5563;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 18px;
}

p {
  color: #4b5563;
  margin-top: 8px;
}

.panel-note {
  margin: -8px 0 16px;
  font-size: 13px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #f8fafc;
}

.mode-tabs button {
  border-color: transparent;
  background: transparent;
  color: #344054;
}

.mode-tabs button.active {
  border-color: #1f2937;
  background: #111827;
  color: #fff;
}

.panel {
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.login-modal {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
}

.login-kicker {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-intro {
  margin: -6px 0 18px;
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
}

.login-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.login-fields label {
  margin-bottom: 0;
}

.login-fields button {
  height: 42px;
  width: 100%;
}

.wecom-login {
  width: 100%;
  min-height: 44px;
  margin-bottom: 14px;
  background: #07c160;
  border-color: #07c160;
  color: #fff;
}

.wecom-login:hover {
  background: #06ad56;
  border-color: #06ad56;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #98a2b3;
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #eaecf0;
}

.login-status {
  display: block;
  min-height: 18px;
  color: #4b5563;
  font-size: 13px;
  margin-top: 10px;
}

.login-status[data-state="pending"] {
  color: #175cd3;
}

.login-status[data-state="success"] {
  color: #067647;
}

.login-status[data-state="error"] {
  color: #b42318;
}

.token-fallback {
  margin-top: 12px;
  border-top: 1px solid #eef2f6;
  padding-top: 12px;
}

.token-fallback summary {
  cursor: pointer;
  color: #4b5563;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.guide-modal {
  width: min(860px, calc(100vw - 32px));
}

.guide-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-actions #guideStatus {
  color: #475467;
  font-size: 13px;
  font-weight: 650;
}

.guide-text {
  width: 100%;
  min-height: min(54vh, 520px);
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.empty-state {
  display: grid;
  gap: 6px;
  max-width: 360px;
  color: #4b5563;
}

.empty-state strong {
  color: #111827;
  font-size: 16px;
}

.empty-state span {
  line-height: 1.45;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.site-filters {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(130px, 170px) minmax(120px, 150px);
  gap: 10px;
}

.new-site {
  margin-bottom: 20px;
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 16px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c9d2dc;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.45;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.inline-check input {
  width: 18px;
  height: 18px;
}

.upload-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.dropzone {
  min-height: 160px;
  border: 1px dashed #8b98a8;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 24px;
  background: #f9fafb;
  cursor: pointer;
}

.dropzone.drag-over {
  border-color: #111827;
  background: #eef2ff;
}

.upload-any {
  gap: 7px;
}

.dropzone span {
  font-size: 16px;
}

.dropzone strong {
  font-size: 17px;
}

.dropzone small {
  max-width: 280px;
  color: #5b6472;
  font-weight: 450;
  line-height: 1.45;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  height: 38px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 0 14px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

#refresh {
  background: #fff;
  color: #111827;
}

button.secondary {
  background: #fff;
  color: #111827;
  border-color: #c9d2dc;
}

#status {
  color: #4b5563;
  font-size: 13px;
}

#createStatus,
#settingsStatus {
  color: #4b5563;
  font-size: 13px;
}

.code-textarea {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.capability-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.capability-validation {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #f8fafc;
}

.capability-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e5e7eb;
}

.check.verified {
  color: #05603a;
  background: #d1fadf;
}

.check.plausible {
  color: #7a2e0e;
  background: #ffead5;
}

.check.invalid {
  color: #b42318;
  background: #fee4e2;
}

.capability-validation ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.capability-validation li {
  display: grid;
  gap: 2px;
  padding-left: 8px;
  border-left: 3px solid #d7dee8;
}

.capability-validation li.verified {
  border-color: #12b76a;
}

.capability-validation li.plausible {
  border-color: #f79009;
}

.capability-validation li.invalid {
  border-color: #f04438;
}

.danger-zone {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

button.danger {
  background: #fff;
  color: #b42318;
  border-color: #f3b4ad;
}

.sites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  overflow-anchor: none;
}

.load-more {
  margin: 16px auto 0;
  min-width: 128px;
}

.site {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  background: #fff;
  overflow-anchor: none;
}

.site strong {
  display: block;
}

.site small {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.auth-required {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.auth-open {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #027a48;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  height: 24px;
  border-color: #d8dee6;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.site a {
  color: #155eef;
  text-decoration: none;
  font-weight: 650;
}

.site-meta {
  min-width: 0;
}

.site-title-link {
  display: block;
  overflow: hidden;
  color: #101828;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-title-link:hover {
  color: #155eef;
  text-decoration: underline;
}

.external-link-symbol {
  display: inline-block;
  margin-right: 6px;
  color: #155eef;
  font-weight: 750;
}

.external-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-actions button,
.button-link {
  min-width: 56px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9d2dc;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}

.top-link {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.ai-page {
  margin-bottom: 16px;
}

.ai-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.ai-recent-title {
  margin: 22px 0 12px;
  font-size: 16px;
}

.ai-project-list {
  display: grid;
  gap: 10px;
}

.ai-project-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.ai-project-row strong,
.ai-project-side h3 {
  display: block;
  margin: 0;
}

.ai-project-row small,
.ai-project-side p,
.ai-status {
  color: #667085;
  font-size: 13px;
}

.ai-project-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  align-items: stretch;
  height: calc(100vh - 220px);
  min-height: 520px;
  overflow: hidden;
}

.ai-project-side {
  align-self: start;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 16px;
  background: #fbfcfd;
}

.ai-project-actions {
  align-items: stretch;
  flex-direction: column;
  margin: 14px 0;
}

.ai-project-actions .button-link,
.ai-project-actions button {
  width: 100%;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.ai-messages {
  align-content: start;
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  margin-bottom: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.ai-messages.empty {
  align-content: center;
}

.ai-message {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.ai-message strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.ai-message > pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  color: #344054;
}

.quick-markdown {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: inherit;
  line-height: 1.7;
}

.quick-markdown > :first-child {
  margin-top: 0;
}

.quick-markdown > :last-child {
  margin-bottom: 0;
}

.quick-markdown p,
.quick-markdown ul,
.quick-markdown ol,
.quick-markdown blockquote,
.quick-markdown pre,
.quick-markdown table,
.quick-markdown hr {
  margin: 0 0 1em;
}

.quick-markdown h1,
.quick-markdown h2,
.quick-markdown h3,
.quick-markdown h4,
.quick-markdown h5,
.quick-markdown h6 {
  margin: 1.25em 0 0.55em;
  color: #101828;
  line-height: 1.3;
}

.quick-markdown h1 { font-size: 1.55em; }
.quick-markdown h2 { font-size: 1.35em; }
.quick-markdown h3 { font-size: 1.18em; }

.quick-markdown ul,
.quick-markdown ol {
  padding-left: 1.5em;
}

.quick-markdown li + li {
  margin-top: 0.3em;
}

.quick-markdown blockquote {
  padding-left: 12px;
  border-left: 3px solid #d0d5dd;
  color: #475467;
}

.quick-markdown code {
  padding: 0.12em 0.32em;
  border-radius: 4px;
  background: #f2f4f7;
  font: 0.9em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quick-markdown pre {
  max-width: 100%;
  overflow: auto;
  padding: 13px 15px;
  border-radius: 8px;
  background: #101828;
  color: #f2f4f7;
  white-space: pre;
}

.quick-markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.quick-markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92em;
}

.quick-markdown th,
.quick-markdown td {
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  text-align: left;
  vertical-align: top;
}

.quick-markdown th {
  background: #f9fafb;
  color: #101828;
}

.quick-markdown a {
  color: #175cd3;
}

.quick-markdown img {
  max-width: 100%;
  height: auto;
}

.quick-markdown hr {
  border: 0;
  border-top: 1px solid #eaecf0;
}

.ai-message.streaming .quick-markdown::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 2px;
  background: #667085;
  vertical-align: -0.15em;
  animation: agent-stream-cursor 0.9s steps(2, jump-none) infinite;
}

@keyframes agent-stream-cursor {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-message.streaming .quick-markdown::after { animation: none; }
}

.agent-feedback,
.agent-handoff-status,
.agent-message-actions,
.agent-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: #475467;
  font-size: 12px;
}

.agent-message-actions button,
.agent-feedback-actions button {
  padding: 6px 10px;
}

.agent-message-actions button.copied {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.agent-message-actions button.resolved {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.agent-handoff-status {
  color: #175cd3;
}

.agent-handoff-status.resolved {
  color: #067647;
}

.agent-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: #475467;
}

.agent-evidence strong {
  margin: 0;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef8f2;
  color: #166534;
}

.agent-evidence.partial strong {
  background: #fff8e6;
  color: #92400e;
}

.agent-evidence.fallback strong,
.agent-evidence.none strong {
  background: #f4f4f5;
  color: #52525b;
}

.agent-evidence em {
  color: #667085;
  font-style: normal;
}

.agent-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.agent-citations span {
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 3px 8px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
}

.agent-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.agent-attachments span {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 220px;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  padding: 7px 9px;
  background: #f8fafc;
}

.agent-attachments strong,
.agent-attachments small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-attachments small {
  color: #667085;
  font-size: 12px;
}

.agent-citations.detailed {
  display: grid;
}

.agent-citations.detailed span {
  border-radius: 6px;
  display: grid;
  gap: 3px;
  line-height: 1.35;
}

.agent-citations.detailed strong,
.agent-citations.detailed small,
.agent-citations.detailed em {
  display: block;
}

.agent-citations.detailed small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agent-citations.detailed b {
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef2f7;
  color: #344054;
  font-size: 11px;
}

.agent-citations.detailed em {
  color: #667085;
  font-style: normal;
}

#aiMessageStatus,
#aiCreateStatus,
#agentCreateStatus,
#agentSaveStatus,
#agentMessageStatus,
#agentModelStatus {
  color: #4b5563;
  font-size: 13px;
}

.agents-page {
  margin-bottom: 16px;
}

.admin-page {
  position: relative;
  min-height: 620px;
  margin-bottom: 16px;
}

.admin-page-heading p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.admin-console-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.admin-console-shell[hidden],
.admin-content > section[hidden],
.admin-run-drawer[hidden] {
  display: none;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.admin-nav button {
  justify-content: flex-start;
  width: 100%;
  background: #ffffff;
  color: #344054;
  text-align: left;
}

.admin-nav button.active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.admin-content,
.admin-content > section {
  min-width: 0;
}

.admin-access-state,
.admin-empty {
  display: grid;
  gap: 4px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.admin-access-state {
  margin-top: 16px;
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.admin-access-state strong,
.admin-access-state span,
.admin-empty strong,
.admin-empty span {
  display: block;
}

.admin-access-state span,
.admin-empty span,
.admin-loading {
  color: #667085;
  font-size: 13px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.admin-metrics > span,
.admin-card {
  display: grid;
  gap: 4px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.admin-metrics strong {
  color: #111827;
  font-size: 20px;
}

.admin-metrics small,
.admin-card small,
.admin-list-row small {
  color: #667085;
  font-size: 12px;
}

.admin-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.admin-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-facts span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 8px 10px;
  background: #f7f8fa;
}

.admin-filter-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(160px, 240px);
  gap: 8px;
  margin-bottom: 12px;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-list-row {
  display: flex;
  height: auto;
  min-height: 62px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #101828;
  text-align: left;
}

.admin-list-row strong,
.admin-list-row small {
  display: block;
}

.admin-list-row small {
  margin-top: 3px;
}

.admin-run-row {
  display: grid;
  grid-template-columns: 10px minmax(180px, 1fr) minmax(220px, 1fr);
}

.admin-run-row:hover {
  border-color: #98a2b3;
  background: #f9fafb;
}

.admin-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98a2b3;
}

.admin-status-dot.completed {
  background: #12b76a;
}

.admin-status-dot.failed {
  background: #f04438;
}

.admin-status-dot.fallback {
  background: #f79009;
}

.admin-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-run-drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #d0d5dd;
  padding: 18px;
  background: #ffffff;
  box-shadow: -16px 0 36px rgb(16 24 40 / 16%);
}

.admin-run-drawer header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-run-drawer h3 {
  margin: 3px 0 0;
}

.admin-detail-list {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
}

.admin-detail-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid #eaecf0;
  padding: 10px 0;
}

.admin-detail-list dt {
  color: #667085;
  font-size: 12px;
}

.admin-detail-list dd {
  min-width: 0;
  margin: 0;
  color: #101828;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .admin-console-shell {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
  }

  .admin-nav button {
    justify-content: center;
    min-width: 108px;
  }

  .admin-metrics,
  .admin-facts,
  .admin-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-run-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .admin-run-row > span:last-child {
    grid-column: 2;
  }
}

.agent-create-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.agent-create-head {
  display: grid;
  gap: 2px;
}

.agent-create-head strong,
.agent-create-head small {
  display: block;
}

.agent-create-head strong {
  color: #111827;
  font-size: 15px;
}

.agent-create-head small {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.agent-create-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) auto auto;
  gap: 10px;
}

.agent-template-info {
  display: grid;
  gap: 3px;
  max-width: 760px;
  color: #475467;
  font-size: 13px;
}

.agent-template-info small {
  color: #667085;
}

.agent-template-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.agent-template-starters span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #dde3ea;
  border-radius: 999px;
  padding: 2px 8px;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
}

.agent-create-status {
  display: block;
  min-height: 0;
  color: #667085;
  font-size: 13px;
}

.agent-create-status:not(:empty) {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.agent-create-status.loading {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.agent-create-status.error {
  border-color: #fecdca;
  background: #fffbfa;
  color: #b42318;
}

.agent-create-status.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.agents-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.agents-summary span {
  display: grid;
  gap: 2px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.agents-summary strong {
  color: #111827;
  font-size: 18px;
  line-height: 1.1;
}

.agents-summary small {
  color: #667085;
  font-size: 12px;
}

.agent-review-queue {
  display: grid;
  gap: 10px;
  margin: 14px 0 16px;
}

.agent-review-queue-head,
.agent-review-queue-empty {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #f3c56b;
  border-radius: 8px;
  padding: 12px;
  background: #fff8e6;
}

.agent-review-queue strong,
.agent-review-item strong {
  display: block;
  color: #101828;
}

.agent-review-queue small,
.agent-review-item small {
  display: block;
  color: #667085;
  font-size: 13px;
  margin-top: 4px;
}

.agent-review-list {
  display: grid;
  gap: 8px;
}

.agent-review-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #ead6a2;
  border-radius: 8px;
  padding: 12px;
  background: #fffdf7;
}

.agent-acceptance-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #ecfdf3;
  color: #027a48;
}

.agent-acceptance-evidence.warning,
.agent-acceptance-evidence.fallback,
.agent-acceptance-evidence.none {
  background: #fffaeb;
  color: #b54708;
}

.agent-acceptance-evidence strong,
.agent-acceptance-evidence span {
  display: inline;
  color: inherit;
  font-size: 12px;
  margin: 0;
}

.agent-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.agent-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.agent-row strong,
.agent-chat-heading h3 {
  display: block;
  margin: 0;
}

.agent-row small,
.agent-chat-heading p {
  display: block;
  color: #667085;
  font-size: 13px;
  margin-top: 4px;
}

.agent-studio-shell {
  display: grid;
  gap: 14px;
}

.agent-workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.agent-admin-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #84caff;
  border-radius: 8px;
  padding: 11px 12px;
  background: #eff8ff;
  color: #175cd3;
}

.agent-admin-context[hidden] {
  display: none;
}

.agent-admin-context strong,
.agent-admin-context span {
  display: block;
}

.agent-admin-context span {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
}

.agent-workspace-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.agent-workspace-content,
.agent-workspace-panel,
.agent-build-panel {
  min-width: 0;
}

.agent-workspace-panel,
.agent-build-panel {
  display: grid;
  gap: 14px;
}

.agent-workspace-panel[hidden],
.agent-build-panel[hidden] {
  display: none;
}

.agent-access-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.agent-access-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
}

.agent-access-mode-card:has(input:checked) {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.agent-access-mode-card.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.agent-access-mode-card span,
.agent-access-mode-card small {
  display: block;
}

.agent-access-mode-card small,
.agent-access-password-fields > small {
  margin-top: 5px;
  color: var(--muted);
}

.agent-access-password-fields {
  margin: 12px 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--soft);
}

.agent-use-access-gate {
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  margin: 48px auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.agent-use-access-gate[hidden] {
  display: none;
}

.agent-use-page.access-locked .ai-messages,
.agent-use-page.access-locked .agent-use-composer,
.agent-use-page.access-locked .agent-chat-heading-actions {
  display: none;
}

.agent-build-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.agent-build-nav button {
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  color: #475467;
  white-space: nowrap;
}

.agent-build-nav button.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.agent-release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.agent-studio-layout {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(520px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.agent-studio-layout-test {
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 420px);
  min-height: calc(100vh - 300px);
}

.agent-config {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.agent-definition-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.agent-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f6;
}

.agent-section-head div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-section-head span {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.agent-section-head strong {
  color: #111827;
  font-size: 15px;
}

.agent-section-head small {
  max-width: 220px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.agent-studio-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #ffffff;
}

.agent-studio-summary div:first-child {
  min-width: 0;
}

.agent-studio-summary small,
.agent-studio-summary span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.agent-studio-summary strong {
  display: block;
  margin: 2px 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.agent-studio-summary-release {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.agent-studio-summary-release > span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #fedf89;
  border-radius: 999px;
  background: #fffaeb;
  color: #b54708;
  font-weight: 800;
}

.agent-studio-summary-release > span.ready {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.agent-studio-path {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  position: sticky;
  top: 12px;
}

@media (max-width: 900px) {
  .agent-admin-context {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-admin-context .button-link {
    width: fit-content;
  }

  .agent-workspace-header,
  .agent-workspace-layout {
    grid-template-columns: 1fr;
  }

  .agent-studio-path {
    display: flex;
    position: static;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .agent-studio-path button {
    flex: 0 0 140px;
  }
}

.agent-studio-path button {
  display: grid;
  gap: 2px;
  justify-items: center;
  height: auto;
  min-height: 52px;
  padding: 9px 12px;
  border-color: #d8dee6;
  background: #ffffff;
  color: #344054;
  text-align: center;
  white-space: normal;
}

.agent-studio-path button.active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.agent-studio-path span,
.agent-studio-path strong,
.agent-studio-path small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.agent-studio-path span {
  font-size: 12px;
  font-weight: 800;
}

.agent-studio-path strong {
  color: inherit;
  font-size: 14px;
}

.agent-studio-path small {
  color: inherit;
  opacity: 0.76;
  font-size: 11px;
  line-height: 1.25;
}

.agent-config #agentInstructions {
  min-height: 118px;
}

.agent-model-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.agent-model-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.agent-model-picker > span,
.agent-model-picker > small {
  color: #667085;
  font-size: 12px;
}

.agent-model-current {
  display: block;
  width: 100%;
  height: auto;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

.agent-model-current::after {
  content: "点击切换";
  float: right;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.agent-model-chooser {
  display: grid;
  gap: 10px;
}

.agent-model-chooser[hidden] {
  display: none;
}

.agent-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.model-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 14px;
}

.agent-model-search {
  margin-top: -4px;
}

.agent-model-results {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
  margin: 8px 0 14px;
  padding: 8px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fbfcfd;
}

.agent-model-results button {
  display: grid;
  gap: 2px;
  justify-items: start;
  height: auto;
  min-height: 44px;
  padding: 8px 10px;
  border-color: #d8dee6;
  background: #ffffff;
  color: #344054;
  text-align: left;
  white-space: normal;
}

.agent-model-results button.active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.agent-model-results strong,
.agent-model-results small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.agent-model-results strong {
  font-size: 12px;
}

.agent-model-results small {
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
  line-height: 1.25;
}

.agent-model-results > small {
  color: #667085;
  font-size: 12px;
}

.agent-model-recommendations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.agent-model-recommendations button {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 58px;
  height: auto;
  padding: 8px 10px;
  text-align: left;
  white-space: normal;
}

.agent-model-recommendations strong {
  color: #111827;
  font-size: 12px;
}

.agent-model-recommendations small {
  max-width: 100%;
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.agent-primary-actions,
.agent-secondary-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.agent-primary-actions button,
.agent-secondary-actions button,
.agent-secondary-actions .button-link {
  min-width: 0;
  white-space: nowrap;
}

.agent-primary-actions {
  justify-content: flex-start;
  margin-top: 0;
  padding: 10px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #ffffff;
}

.agent-primary-actions #agentSaveStatus {
  min-width: min(100%, 160px);
  color: #475467;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.agent-more-actions {
  margin-top: 8px;
}

.agent-more-actions summary {
  width: fit-content;
  cursor: pointer;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.agent-share-status {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
}

.agent-share-status strong,
.agent-share-status small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-share-status strong {
  color: #344054;
  font-size: 13px;
}

.agent-share-status small {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.agent-share-status.ready {
  border-color: #abefc6;
  background: #ecfdf3;
}

.agent-share-status.ready strong {
  color: #067647;
}

.agent-share-status.blocked {
  border-color: #fedf89;
  background: #fffaeb;
}

.agent-share-status.blocked strong {
  color: #b54708;
}

.agent-compact-details {
  margin-top: 8px;
}

.agent-compact-details summary {
  width: fit-content;
  cursor: pointer;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.agent-compact-details label {
  margin-top: 8px;
}

.agent-model-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin: -6px 0 14px;
}

.agent-model-info span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #d5dae1;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.agent-model-info small {
  color: #667085;
  font-size: 12px;
}

.agent-disclosure {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.agent-disclosure summary {
  cursor: pointer;
  color: #111827;
  font-weight: 750;
}

.agent-disclosure[open] {
  gap: 10px;
}

.agent-disclosure h3 {
  margin: 0;
  font-size: 14px;
}

.agent-test-toolbar {
  display: grid;
  gap: 12px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.agent-overview-status {
  display: grid;
  gap: 14px;
}

.agent-overview-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-overview-status-grid article,
.agent-overview-next,
.agent-overview-alert {
  display: grid;
  gap: 5px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.agent-overview-status-grid small,
.agent-overview-next small {
  color: #667085;
}

.agent-overview-next {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.agent-overview-alert {
  border-color: #fdb022;
  background: #fffaeb;
  color: #93370d;
}

.agent-overview-alert span {
  line-height: 1.45;
}

.agent-test-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-test-toolbar strong,
.agent-test-toolbar small {
  display: block;
}

.agent-test-toolbar strong {
  color: #111827;
}

.agent-test-toolbar small {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}

.agent-assignments {
  min-width: 0;
}

.agent-operations {
  background: #ffffff;
}

.agent-assignments p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

#agentAssignments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-group-list {
  display: grid;
  gap: 8px;
}

.customer-group-list article {
  display: grid;
  gap: 4px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.customer-group-list small {
  color: #667085;
  font-size: 12px;
}

.customer-group-list button {
  justify-self: start;
  margin-right: 6px;
}

.agent-assignments span {
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  color: #344054;
  font-size: 12px;
}

.agent-assignment-group {
  display: grid;
  gap: 3px;
  min-width: min(100%, 220px);
  border: 1px solid #d8dee6;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
}

.agent-assignment-group strong {
  font-size: 12px;
  color: #111827;
}

.agent-assignment-group small {
  color: #667085;
  font-size: 12px;
}

.agent-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-launch-radar {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #ffffff;
}

.agent-launch-radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-launch-radar-head strong {
  color: #111827;
  font-size: 15px;
}

.agent-launch-radar-head span {
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.agent-launch-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.agent-launch-steps button {
  display: grid;
  gap: 2px;
  width: 100%;
  height: auto;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fbfcfd;
  color: #344054;
  text-align: left;
  white-space: normal;
}

.agent-launch-steps button.current {
  border-color: #84caff;
  background: #eff8ff;
  color: #175cd3;
}

.agent-launch-steps button.done {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #027a48;
}

.agent-launch-steps strong,
.agent-launch-steps small {
  display: block;
}

.agent-launch-steps strong {
  font-size: 13px;
  line-height: 1.25;
}

.agent-launch-steps small {
  color: inherit;
  font-size: 11px;
  line-height: 1.3;
}

.readiness-meter {
  width: fit-content;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.customer-status-badge {
  width: fit-content;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.customer-status-badge.ready {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #027a48;
}

.customer-status-badge.pending {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.customer-status-badge.blocked {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b42318;
}

.agent-test-status {
  width: fit-content;
  border: 1px solid #fedf89;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaeb;
  color: #b54708;
}

.agent-test-status.tested {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #027a48;
}

.agent-test-status.partial {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.agent-test-status.warning {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b42318;
}

.agent-test-status strong,
.agent-test-status small {
  display: block;
}

.agent-test-status small {
  margin-top: 3px;
  color: inherit;
  font-size: 12px;
}

.agent-publish-checks ul,
.agent-customer-status ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-publish-checks li,
.agent-customer-status li {
  color: #667085;
  font-size: 13px;
}

.agent-publish-checks li.ok,
.agent-customer-status li.ok {
  color: #05603a;
}

.agent-publish-checks li.missing,
.agent-customer-status li.missing {
  color: #b42318;
}

.agent-files-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.agent-files-tree {
  display: grid;
  gap: 8px;
}

.agent-file-root {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #475467;
}

.agent-file-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.agent-file-list {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}

.agent-file-row {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  text-align: left;
}

.agent-file-row.active {
  border-color: #111827;
  background: #f9fafb;
}

.agent-file-row span {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.agent-file-row small {
  color: #667085;
}

.agent-file-preview {
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.45;
  min-height: 180px;
  max-height: 320px;
}

.agent-version {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.agent-version strong,
.agent-version small {
  display: block;
}

.agent-version button {
  height: 30px;
  margin-top: 8px;
}

.agent-version-status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fbfcfd;
}

.agent-version-status span {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.agent-version-status small {
  margin: 0;
  color: #667085;
  line-height: 1.35;
  text-align: right;
}

.agent-version-status.active,
.agent-version-status.approved {
  border-color: #abefc6;
  background: #ecfdf3;
}

.agent-version-status.active span,
.agent-version-status.approved span {
  color: #067647;
}

.agent-version-status.pending {
  border-color: #fedf89;
  background: #fffaeb;
}

.agent-version-status.pending span {
  color: #b54708;
}

.agent-version-status.rejected {
  border-color: #fecaca;
  background: #fef2f2;
}

.agent-version-status.rejected span {
  color: #991b1b;
}

.agent-version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.agent-version-actions button {
  margin-top: 0;
}

.agent-version small {
  color: #667085;
  font-size: 12px;
  margin-top: 4px;
}

.agent-version-review {
  margin: 6px 0 0;
  color: #475467;
  font-size: 12px;
}

.agent-version-diff {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.agent-version-diff span {
  display: block;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.agent-version-diff ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #344054;
  font-size: 12px;
}

.agent-version-diff li + li {
  margin-top: 3px;
}

.agent-asset-list {
  display: grid;
  gap: 8px;
}

.agent-asset {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.agent-asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-asset-head span {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.agent-asset-head button {
  padding: 4px 8px;
}

.agent-asset pre {
  max-height: 140px;
  overflow: auto;
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #344054;
  font: inherit;
  font-size: 13px;
}

.agent-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.agent-chat .ai-messages {
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.agent-test-composer,
.agent-use-composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.agent-test-composer textarea {
  min-height: 92px;
}

.agent-test-composer-head {
  display: grid;
  gap: 2px;
}

.agent-test-composer-head strong,
.agent-test-composer-head small {
  display: block;
}

.agent-test-composer-head strong {
  color: #111827;
  font-size: 14px;
}

.agent-test-composer-head small {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.agent-use-composer textarea {
  min-height: 104px;
}

.agent-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-composer-actions span {
  color: #667085;
  font-size: 13px;
}

.agent-chat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-chat-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.agent-chat-heading-actions button {
  min-width: max-content;
}

.agent-thread-list {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 2px;
}

.agent-thread {
  display: grid;
  gap: 2px;
  min-width: 160px;
  height: auto;
  justify-items: start;
  border-color: #d8dee6;
  background: #fff;
  color: #344054;
  padding: 8px 10px;
  text-align: left;
}

.agent-thread.active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.agent-thread span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-thread small {
  color: inherit;
  font-size: 11px;
  opacity: 0.75;
}

.agent-chat-files {
  display: grid;
  gap: 6px;
}

.agent-chat-files input {
  min-height: 40px;
  padding: 8px;
}

.agent-chat-files small {
  color: #667085;
  font-size: 12px;
}

.agent-use-page,
.agent-portal-page {
  max-width: 880px;
  margin: 0 auto;
}

.agent-use-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}

.agent-use-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.agent-use-header h2 {
  margin-bottom: 0;
}

.agent-portal-tools {
  display: grid;
  grid-template-columns: minmax(180px, 320px);
  gap: 8px;
  margin-bottom: 12px;
}

.agent-portal-summary {
  display: grid;
  gap: 3px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fbfcfd;
}

.agent-portal-summary strong,
.agent-portal-summary small {
  display: block;
}

.agent-portal-summary strong {
  color: #111827;
  font-size: 14px;
}

.agent-portal-summary small {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.agent-portal-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.agent-portal-card-main {
  min-width: 0;
}

.agent-portal-card strong,
.agent-portal-card small {
  display: block;
}

.agent-portal-card strong {
  color: #111827;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.agent-portal-card small {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.agent-portal-card .button-link {
  flex: 0 0 auto;
}

.agent-portal-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  border: 1px dashed #c9d2dc;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.agent-portal-empty strong,
.agent-portal-empty small {
  display: block;
}

.agent-portal-empty strong {
  color: #111827;
  font-size: 15px;
}

.agent-portal-empty small {
  max-width: 520px;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.agent-use-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.agent-use-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.agent-use-capabilities {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.agent-use-capabilities article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.agent-use-capabilities strong,
.agent-use-capabilities small {
  display: block;
}

.agent-use-capabilities small {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.agent-use-status-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f0fdf4;
}

.agent-use-status-panel.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.agent-use-status-panel.blocked {
  border-color: #fecaca;
  background: #fef2f2;
}

.agent-use-status-panel.unavailable span {
  background: #fee2e2;
  color: #991b1b;
}

.agent-use-status-panel strong,
.agent-use-status-panel small {
  display: block;
}

.agent-use-status-panel small {
  color: #667085;
  font-size: 12px;
  margin-top: 3px;
}

.agent-use-status-panel span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.agent-portal-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.agent-portal-capabilities span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.agent-thread-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.agent-thread-strip summary {
  width: fit-content;
  cursor: pointer;
  color: #475467;
  font-size: 13px;
  font-weight: 750;
}

.agent-thread-strip:not([open]) {
  margin-bottom: 8px;
}

.agent-thread-strip .agent-thread-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

body.agent-embed-mode {
  background: #ffffff;
}

body.agent-embed-mode .topbar,
body.agent-embed-mode #loginPanel,
body.agent-embed-mode .agent-use-about,
body.agent-embed-mode .agent-use-history,
body.agent-embed-mode .agent-use-more,
body.agent-embed-mode .agent-use-back {
  display: none !important;
}

body.agent-embed-mode .shell {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.agent-embed-mode .panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.agent-embed-mode .agent-use-page {
  max-width: none;
}

body.agent-embed-mode .agent-use-shell {
  min-height: 100vh;
  padding: 16px;
}

body.agent-embed-mode .agent-use-header {
  margin-bottom: 10px;
}

.agent-starters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-content: start;
}

.ai-messages.empty .agent-starters {
  align-self: center;
  width: min(100%, 720px);
}

.agent-unavailable-state {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(100%, 520px);
  border: 1px dashed #fecaca;
  border-radius: 8px;
  padding: 20px;
  background: #fef2f2;
  text-align: center;
}

.agent-unavailable-state strong,
.agent-unavailable-state small {
  display: block;
}

.agent-unavailable-state strong {
  color: #991b1b;
  font-size: 15px;
}

.agent-unavailable-state small {
  color: #7f1d1d;
  line-height: 1.45;
}

.agent-use-file-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f9fafb;
  padding: 10px 12px;
}

.agent-use-file-summary strong,
.agent-use-file-summary small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-use-file-summary small {
  color: #667085;
  margin-top: 4px;
}

.agent-use-file-summary button {
  flex: 0 0 auto;
}

.agent-use-draft-advice {
  border: 1px solid #f4c56a;
  border-radius: 8px;
  background: #fff9e8;
  color: #5c4300;
  padding: 10px 12px;
}

.agent-use-draft-advice strong {
  display: block;
  margin-bottom: 6px;
}

.agent-use-draft-advice ul {
  margin: 0;
  padding-left: 18px;
}

.agent-use-draft-advice li {
  margin: 3px 0;
}

/* 使用者入口：保持为专注的 AI Chat，低频信息只在用户主动打开时出现。 */
.agent-use-page {
  width: min(100%, 1080px);
  max-width: 1080px;
  height: calc(100dvh - 40px);
  min-height: 620px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-color: #e4e7ec;
  border-radius: 16px;
  background: #fff;
}

.agent-use-page .agent-use-shell {
  height: 100%;
  min-height: 0;
}

.agent-use-page .agent-use-header {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid #eaecf0;
  background: rgba(255, 255, 255, 0.96);
}

.agent-use-back {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #475467;
  font-size: 21px;
  text-decoration: none;
}

.agent-use-back:hover {
  background: #f2f4f7;
}

.agent-use-header-identity {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
}

.agent-use-avatar,
.agent-use-welcome-avatar,
.agent-message-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #101828;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.agent-use-avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.agent-use-header-identity h2,
.agent-use-header-identity p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-use-header-identity h2 {
  margin: 0;
  color: #101828;
  font-size: 16px;
}

.agent-use-header-identity p {
  max-width: 520px;
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.agent-use-page .agent-chat-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.agent-use-page .agent-chat-heading-actions > button,
.agent-use-popover > summary {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #475467;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.agent-use-popover > summary::-webkit-details-marker {
  display: none;
}

.agent-use-page .agent-chat-heading-actions > button:hover,
.agent-use-popover > summary:hover,
.agent-use-popover[open] > summary {
  background: #f2f4f7;
  color: #101828;
}

.agent-use-page #agentUseNewThread {
  background: #101828;
  color: #fff;
}

.agent-use-page #agentUseNewThread:hover {
  background: #344054;
}

.agent-use-popover {
  position: relative;
}

.agent-use-popover-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  max-height: min(560px, calc(100dvh - 110px));
  gap: 12px;
  overflow: auto;
  padding: 16px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.16);
}

.agent-use-history .agent-use-popover-panel {
  width: min(380px, calc(100vw - 32px));
}

.agent-use-more .agent-use-popover-panel {
  width: 210px;
}

.agent-use-more .agent-use-popover-panel button {
  width: 100%;
}

.agent-use-page .agent-use-meta {
  margin: 0;
}

.agent-use-page .agent-use-capabilities {
  grid-template-columns: 1fr;
  margin: 0;
}

.agent-use-page .agent-use-capabilities article {
  padding: 0;
  border: 0;
  background: transparent;
}

.agent-use-page .agent-thread-list {
  display: grid;
  gap: 6px;
}

.agent-use-page .agent-thread {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 48px;
  align-items: flex-start;
  text-align: left;
}

.agent-use-page .agent-use-status-panel {
  flex: 0 0 auto;
  margin: 12px 20px 0;
}

.agent-use-page .ai-messages {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: 32px max(28px, calc((100% - 780px) / 2));
  overflow-y: auto;
  scroll-behavior: smooth;
}

.agent-use-page .ai-messages.empty {
  justify-content: center;
}

.agent-use-page .ai-message {
  width: min(100%, 760px);
  padding: 0;
  border: 0;
  background: transparent;
}

.agent-use-page .ai-message.user {
  width: fit-content;
  max-width: min(72%, 620px);
  align-self: flex-end;
  padding: 11px 15px;
  border-radius: 18px 18px 4px 18px;
  background: #f2f4f7;
}

.agent-use-page .ai-message.assistant {
  align-self: center;
}

.agent-message-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.agent-message-heading strong {
  margin: 0;
  color: #101828;
  font-size: 13px;
}

.agent-message-heading time {
  color: #98a2b3;
  font-size: 11px;
}

.agent-use-page .ai-message.user .agent-message-heading {
  display: none;
}

.agent-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 9px;
}

.agent-use-page .ai-message > pre {
  color: #1d2939;
  font-size: 15px;
  line-height: 1.75;
}

.agent-use-page .ai-message .quick-markdown {
  color: #1d2939;
  font-size: 15px;
  line-height: 1.75;
}

.agent-message-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  margin: 8px 0 0 36px;
}

.agent-message-footer .agent-message-actions,
.agent-message-footer .agent-feedback-actions,
.agent-message-footer .agent-feedback,
.agent-message-footer .agent-handoff-status {
  display: inline-flex;
  gap: 2px;
  margin: 0;
}

.agent-message-footer button {
  min-height: 26px;
  padding: 2px 6px;
  border-color: transparent;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.agent-message-footer button:hover {
  background: #f9fafb;
  color: #475467;
}

.agent-message-footer .agent-message-actions button.copied,
.agent-message-footer .agent-message-actions button.resolved {
  border-color: transparent;
  background: #f2f4f7;
  color: #667085;
}

.agent-message-footer .agent-handoff-status,
.agent-message-footer .agent-handoff-status.resolved {
  color: #667085;
}

.agent-message-details {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.agent-message-details > summary {
  width: fit-content;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
}

.agent-message-details > summary:hover {
  background: #f9fafb;
  color: #667085;
}

.agent-message-details[open] {
  display: contents;
}

.agent-message-details > div {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 2px solid #d0d5dd;
  background: #f9fafb;
}

.agent-message-details[open] > div {
  order: 20;
  flex: 1 0 100%;
}

.agent-use-welcome {
  display: grid;
  width: min(100%, 680px);
  align-self: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.agent-use-welcome-avatar {
  width: 52px;
  height: 52px;
  font-size: 14px;
}

.agent-use-welcome h3 {
  margin: 6px 0 0;
  color: #101828;
  font-size: 24px;
}

.agent-use-welcome p {
  max-width: 560px;
  margin: 0;
  color: #667085;
  line-height: 1.6;
}

.agent-use-welcome .agent-starters {
  width: 100%;
  margin-top: 14px;
}

.agent-use-welcome .agent-starters button {
  min-height: 54px;
  border-color: #e4e7ec;
  border-radius: 14px;
  background: #fff;
  color: #344054;
}

.agent-use-composer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
  padding: 12px max(28px, calc((100% - 780px) / 2)) 14px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 16px, #fff);
}

.agent-use-composer-surface {
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
}

.agent-use-composer textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  padding: 15px 16px 6px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
}

.agent-use-composer-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 7px 12px;
}

.agent-use-attach {
  display: inline-flex;
  align-items: center;
  color: #475467;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.agent-use-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.agent-use-composer-toolbar #agentUseStatus {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-use-composer-toolbar button {
  min-width: 76px;
  border-radius: 12px;
  background: #101828;
}

.agent-use-composer-toolbar #cancelAgentUseMessage {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.agent-use-disclaimer {
  color: #98a2b3;
  text-align: center;
  font-size: 11px;
}

.agent-use-page .agent-use-file-summary,
.agent-use-page .agent-use-draft-advice {
  width: 100%;
}

@media (max-width: 720px) {
  .agent-use-page {
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .agent-use-page .agent-use-header {
    min-height: 64px;
    padding: 9px 10px;
  }

  .agent-use-header-identity p,
  .agent-use-page .agent-chat-heading-actions > button {
    display: none;
  }

  .agent-use-popover > summary {
    width: 34px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .agent-use-about > summary::before {
    content: 'i';
    font-size: 15px;
  }

  .agent-use-history > summary::before {
    content: '☰';
    font-size: 15px;
  }

  .agent-use-more > summary {
    font-size: 12px;
  }

  .agent-use-page #agentUseNewThread {
    display: inline-flex;
    width: 38px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .agent-use-page #agentUseNewThread::before {
    content: '+';
    font-size: 20px;
  }

  .agent-use-page .ai-messages {
    gap: 18px;
    padding: 24px 16px;
  }

  .agent-use-page .ai-message.user {
    max-width: 86%;
  }

  .agent-use-composer {
    padding: 10px 12px 8px;
  }

  .agent-use-welcome h3 {
    font-size: 21px;
  }

  .agent-use-welcome .agent-starters {
    grid-template-columns: 1fr;
  }
}

.agent-starters button {
  height: auto;
  min-height: 42px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

.agent-usage-summary,
.agent-usage-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.agent-usage-summary span,
.agent-usage-days span {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fbfcfd;
  font-size: 12px;
}

.agent-usage-summary span.warning {
  border-color: #f2b8a0;
  background: #fff5f0;
  color: #9a3412;
}

.agent-usage-scopes {
  display: grid;
  gap: 8px;
}

.agent-usage-scopes article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.agent-usage-scopes strong,
.agent-usage-scopes small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-feedback-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.agent-feedback-summary span {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fbfcfd;
  font-size: 12px;
}

.agent-feedback-summary span.feedback-health.attention {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b42318;
}

.agent-feedback-summary span.feedback-health.watch {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.agent-feedback-summary span.feedback-health.healthy {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #027a48;
}

.agent-feedback-trend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.agent-feedback-trend span {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}

.agent-feedback-trend strong,
.agent-feedback-trend small {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.agent-feedback-trend small {
  color: #667085;
  margin-top: 2px;
}

.agent-feedback-recommendations {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.agent-feedback-recommendations article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.agent-feedback-recommendations article.high {
  border-color: #fecaca;
  background: #fff7f7;
}

.agent-feedback-recommendations article.medium {
  border-color: #fedf89;
  background: #fffcf5;
}

.agent-feedback-recommendations strong,
.agent-feedback-recommendations small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-feedback-recommendations small {
  color: #475467;
  margin-top: 4px;
}

.agent-feedback-recommendations button {
  height: 32px;
  margin-top: 8px;
  padding: 0 10px;
}

.agent-feedback-list,
.agent-notification-list {
  display: grid;
  gap: 8px;
}

.agent-feedback-list article,
.agent-notification-list article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.agent-feedback-list strong,
.agent-feedback-list small,
.agent-notification-list strong,
.agent-notification-list small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-feedback-list p,
.agent-notification-list p {
  margin: 6px 0 0;
  color: #475467;
  font-size: 12px;
}

.agent-feedback-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.agent-feedback-evidence span {
  border: 1px solid #abefc6;
  border-radius: 999px;
  padding: 2px 7px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  font-weight: 800;
}

.agent-feedback-evidence small {
  color: #667085;
  font-size: 12px;
}

.agent-feedback-evidence.fallback span,
.agent-feedback-evidence.none span {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.agent-feedback-card-actions,
.agent-notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.agent-feedback-card-actions button,
.agent-notification-actions button {
  height: 32px;
  padding: 0 10px;
}

.agent-activity-list {
  display: grid;
  gap: 8px;
}

.agent-activity-list article {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.agent-activity-list strong,
.agent-activity-list small {
  display: block;
  overflow-wrap: anywhere;
}

.agent-activity-list p {
  margin: 6px 0 0;
  color: #475467;
  font-size: 12px;
}

.data-panel {
  grid-column: 1 / -1;
}

.data-controls {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.data-items {
  display: grid;
  gap: 10px;
}

.data-item {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.data-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.data-item code {
  font-size: 13px;
  word-break: break-all;
}

.data-item pre {
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.45;
}

.data-item button {
  background: #fff;
  color: #111827;
  border-color: #c9d2dc;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.38);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

.modal-wide {
  width: min(920px, calc(100vw - 32px));
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal header h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: #c9d2dc;
  background: #fff;
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 1180px) {
  .agent-studio-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions button {
    flex: 1;
  }

  .create-grid {
    grid-template-columns: 1fr;
  }

  .agent-overview-status-grid,
  .agent-overview-next {
    grid-template-columns: 1fr;
  }

  .login-fields,
  .token-row {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .site-filters {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .data-controls {
    grid-template-columns: 1fr;
  }

  .ai-create-grid,
  .ai-project-layout,
  .agent-studio-layout,
  .agent-studio-layout-test,
  .agent-config-grid,
  .agent-create-row,
  .agent-use-capabilities {
    grid-template-columns: 1fr;
  }

  .agents-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-studio-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-section-head small {
    max-width: none;
    text-align: left;
  }

  .agent-studio-summary-release {
    justify-items: stretch;
  }

  .agent-studio-path {
    display: flex;
  }

  .agent-release-grid {
    grid-template-columns: 1fr;
  }

  .agent-launch-steps {
    grid-template-columns: 1fr;
  }

  .agent-primary-actions button {
    flex: 1 1 120px;
  }

  .agent-version-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-version-status small {
    text-align: left;
  }

  .agent-portal-card {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-portal-card .button-link {
    width: fit-content;
  }

  .agent-composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-composer-actions button {
    width: fit-content;
  }

  .ai-project-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .ai-project-side {
    max-height: none;
    position: static;
  }

  .ai-messages {
    max-height: 58vh;
  }

  .agent-row {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-primary-actions,
  .agent-secondary-actions,
  .agent-chat-heading,
  .agent-chat-heading-actions,
  .agent-test-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .token-input {
    width: 100%;
  }
}
