.workspace-agent { color: var(--ink, #0c1720); font: inherit; }
.workspace-agent [hidden] { display: none !important; }
.studio-topbar-actions .wa-launcher { position: static; display: inline-flex; align-items: center; gap: 6px; box-shadow: none; font: inherit; cursor: pointer; }
.wa-badge { padding-left: 8px; border-left: 1px solid rgb(255 255 255 / 45%); font-size: 12px; font-weight: 500; }
.wa-dialog { position: fixed; inset: 0 0 0 auto; box-sizing: border-box; margin: 0; width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; padding: 0; border: 0; border-left: 1px solid var(--line, #d9e4e5); border-radius: 0; background: var(--paper, #fff); color: var(--ink, #0c1720); box-shadow: -12px 0 36px rgb(12 40 45 / 12%); overflow: hidden; }
.wa-dialog[open] { display: flex; flex-direction: column; }
.wa-dialog::backdrop { background: rgb(12 28 35 / 15%); }
.wa-dialog *, .wa-dialog *::before, .wa-dialog *::after { box-sizing: border-box; }
.wa-dialog :is(button, input, textarea, select) { font: inherit; font-size: 14px; }
.wa-dialog :is(button, a) { -webkit-tap-highlight-color: transparent; }
.wa-dialog button { cursor: pointer; white-space: nowrap; }
.wa-dialog button:disabled { cursor: default; opacity: .48; }
.wa-dialog :is(button, input, textarea, select, a, [tabindex]):focus-visible, .wa-launcher:focus-visible { outline: 2px solid var(--jade, #0f766e); outline-offset: 3px; }
.wa-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; flex: none; }
.wa-header h2 { margin: 0; font-size: 18px; letter-spacing: -.35px; line-height: 1.4; }
.wa-header-actions, .wa-inline-actions { display: flex; align-items: center; gap: 8px; }
.wa-toolbar { display: flex; align-items: center; gap: 7px; padding: 0 18px 12px; border-bottom: 1px solid var(--line, #d9e4e5); flex: none; }
.wa-toolbar select { flex: 1; min-width: 0; width: 0; text-overflow: ellipsis; }
.wa-dialog :is(select, input) { min-height: 36px; border: 1px solid var(--line, #d9e4e5); border-radius: 7px; background: var(--paper, #fff); color: var(--ink, #0c1720); padding: 6px 8px; }
.wa-primary, .wa-secondary, .wa-text-button { min-height: 36px; padding: 7px 11px; border-radius: 7px; line-height: 1.35; }
.wa-primary { background: var(--jade, #0f766e); border: 1px solid var(--jade, #0f766e); color: #fff; font-weight: 650 !important; }
.wa-secondary { background: var(--paper, #fff); border: 1px solid var(--line, #d9e4e5); color: var(--ink, #0c1720); }
.wa-text-button { border: 1px solid transparent; background: transparent; color: var(--jade, #0f766e); padding-inline: 6px; }
.wa-dialog button:not(:disabled):hover { filter: brightness(.96); }
.wa-dialog button:not(:disabled):active, .wa-launcher:active { transform: translateY(1px); }
.wa-settings { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; padding: 12px 18px; border-bottom: 1px solid var(--line, #d9e4e5); background: var(--surface-soft, #eff8f6); }
.wa-settings label, .wa-settings-status { grid-column: 1 / -1; font-size: 13px; }
.wa-settings input { width: 100%; min-width: 0; }
.wa-settings-status { margin: 0; color: var(--text-secondary, #4a6069); }
.wa-settings-status:empty { display: none; }
.wa-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scroll-padding-block: 15px; }
.wa-empty { display: flex; flex-direction: column; justify-content: center; min-height: min(42vh, 330px); margin: 0; padding: 25px 8px; }
.wa-empty h3 { margin: 0 0 25px; font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.wa-starter { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 10px 4px; border: 0; background: transparent; color: inherit; text-align: left; }
.wa-starter span:first-child { font-size: 16px; }
.wa-starter span:last-child { font-size: 21px; color: var(--text-secondary, #4a6069); }

.wa-turn { margin: 0 0 25px; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.wa-user-message { width: fit-content; max-width: 94%; margin: 0 0 16px auto; padding: 9px 12px; border-radius: 10px 10px 2px 10px; background: var(--surface-soft, #eaf5f3); color: var(--ink, #0c1720); white-space: pre-wrap; }
.wa-user-message p { margin: 0; }
.wa-turn-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 7px; font-size: 13px; }
.wa-turn-heading strong { color: var(--jade, #0f766e); }
.wa-turn-status, .wa-turn-elapsed { color: var(--text-secondary, #4a6069); font-size: 12px; }
.wa-turn-status[data-state="waiting_confirmation"] { color: #8b5818; }
.wa-turn-status[data-state="failed"], .wa-error { color: #a6362c; }
.wa-reply, .wa-step-detail, .wa-error, .wa-confirm-title { margin: 6px 0; white-space: pre-wrap; }
.wa-steps { margin: 12px 0; padding: 0; list-style: none; }
.wa-steps li { position: relative; margin: 0 0 10px; padding-left: 17px; }
.wa-steps li::before { content: ""; position: absolute; top: 8px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: #7b8e95; }
.wa-steps li[data-state="succeeded"]::before, .wa-steps li[data-state="done"]::before { background: var(--jade, #0f766e); }
.wa-steps li[data-state="failed"]::before { background: #a6362c; }
.wa-step-line { display: flex; justify-content: space-between; gap: 12px; }
.wa-step-title { font-size: 13px; }
.wa-step-status { flex: none; font-size: 12px; color: var(--text-secondary, #4a6069); }
.wa-step-detail { margin-top: 2px; font-size: 13px; color: var(--text-secondary, #4a6069); }
.wa-confirmation { margin: 12px 0; padding: 12px 0 12px 12px; border-left: 3px solid #ae7b37; }
.wa-confirmation h3 { margin: 0 0 6px; font-size: 14px; }
.wa-confirm-title { font-weight: 600; }
.wa-action-details { margin: 10px 0 12px; font-size: 13px; }
.wa-action-details > div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; margin: 5px 0; }
.wa-action-details dt { color: var(--text-secondary, #4a6069); }
.wa-action-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-result-links { display: flex; flex-wrap: wrap; gap: 8px 15px; margin: 12px 0 0; }
.wa-result-links a { padding: 4px 0; color: var(--jade, #0f766e); font-size: 13px; text-underline-offset: 3px; }
.wa-pending-message { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.wa-pending-label { font-size: 13px; color: var(--text-secondary, #4a6069); }
.wa-composer { flex: none; margin: 0 16px max(16px, env(safe-area-inset-bottom)); padding: 14px; border: 1px solid var(--line, #d9e4e5); border-radius: 14px; background: var(--surface-soft, #eff8f6); }
.wa-input-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.wa-page-context { color: var(--text-secondary, #4a6069); font-size: 12px; }
.wa-input-label { display: block; margin: 0; font-size: 13px; font-weight: 600; }
.wa-composer textarea { display: block; width: 100%; min-height: 90px; max-height: 180px; resize: vertical; padding: 10px 11px; border: 0; border-radius: 0; color: var(--ink, #0c1720); background: transparent; line-height: 1.6; padding: 5px 2px; }
.wa-composer textarea::placeholder { color: #647780; opacity: 1; }
.wa-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.wa-composer-actions select { max-width: 125px; }
.wa-status { margin: 8px 0 0; color: var(--text-secondary, #4a6069); font-size: 12px; line-height: 1.5; }
.wa-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 980px) {
  .wa-launcher { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .wa-launcher { min-height: 44px; }
  .wa-dialog { width: 100vw; border-left: 0; box-shadow: none; }
  .wa-header { padding: max(12px, env(safe-area-inset-top)) 14px 8px; }
  .wa-toolbar { padding: 0 14px 10px; }
  .wa-log { padding: 14px; }
  .wa-composer { padding-inline: 14px; }
  .wa-dialog :is(button, select) { min-height: 40px; }
  .wa-composer textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-dialog button:not(:disabled):active, .wa-launcher:active { transform: none; }
}

.wa-icon-button { display: inline-flex; justify-content: center; align-items: center; min-width: 34px; min-height: 34px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: inherit; font-size: 25px !important; line-height: 1; }
.wa-header-actions { gap: 3px; }
.wa-header .wa-text-button { color: var(--text-secondary, #4a6069); }
.wa-tray { flex: none; max-height: 32dvh; overflow: auto; margin: 0 20px 8px; padding: 12px 0; border-block: 1px solid var(--line, #d9e4e5); }
.wa-tray h3 { margin: 0 0 8px; font-size: 14px; }
.wa-history-item { width: 100%; padding: 9px 5px; border: 0; background: transparent; color: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.wa-history-item[aria-current=true] { color: var(--jade, #0f766e); font-weight: 650; }
.wa-skill-item { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.wa-skill-item input { min-height: auto; accent-color: var(--jade, #0f766e); }
.wa-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-chip { display: inline-flex; align-items: center; max-width: 100%; gap: 3px; padding-left: 8px; border: 1px solid var(--line, #d9e4e5); border-radius: 7px; font-size: 12px; }
.wa-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.wa-chip .wa-icon-button { min-width: 24px; min-height: 28px; font-size: 18px !important; }
.wa-composer-tools, .wa-composer-choices { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-composer-tools { margin-top: 10px; }
.wa-composer-tools .wa-page-context { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.wa-composer-choices { flex: 1; }
.wa-composer-actions { gap: 5px; margin-top: 8px; }
.wa-composer-choices select { border: 0; background: transparent; padding: 3px 2px; max-width: 175px; min-width: 0; color: var(--text-secondary, #4a6069); }
.wa-composer-choices select[aria-label="Agent 范围"] { max-width: 105px; color: var(--ink, #0c1720); }
.wa-send { flex: none; min-width: 38px; min-height: 38px; border: 0; border-radius: 50%; color: white; background: var(--jade, #0f766e); font-size: 24px !important; }
.wa-send:disabled { background: var(--line, #d9e4e5); color: var(--text-secondary, #4a6069); }
.wa-meta { color: var(--text-secondary, #4a6069); font-size: 12px; }
@media (max-width: 1370px) and (min-width: 641px) {
 .studio-topbar-actions { gap: 5px; }
 .studio-topbar-actions .user-badge { padding-inline: 9px; }
}
@media (max-width: 640px) {
 .studio-topbar > .studio-topbar-actions { display: flex !important; grid-column: 2; grid-row: 1; gap: 4px; }
 .studio-topbar-actions > :not(#workspaceHomeButton):not(#workspaceAgentLauncher):not(#topbarAccountCenterButton):not(#aiTasksButton) { display: none; }
 .studio-topbar-actions .user-badge { min-height: 36px; padding: 0 7px; font-size: 12px; }
 .studio-topbar-brand .brand-wordmark { width: 140px; height: 36px; }
 .wa-header { gap: 5px; padding-inline: 16px; }
 .wa-header h2 { font-size: 17px; }
 .wa-composer { margin-inline: 12px; padding: 12px; }
 .wa-composer-choices select { max-width: 155px; font-size: 12px; }
 .wa-composer-choices select[aria-label="Agent 范围"] { max-width: 88px; }
 .wa-empty { min-height: min(40vh, 290px); }
 .wa-tray { margin-inline: 16px; }
}
.wa-new-icon { position: relative; width: 17px; height: 15px; border: 1.6px solid currentColor; border-radius: 3px; }
.wa-new-icon::before { content: '+'; position: absolute; inset: -3px 0 0; font: 18px/17px system-ui; text-align: center; }
.wa-new-icon::after { content: ''; position: absolute; left: 1px; bottom: -4px; width: 4px; height: 4px; border-left: 1.6px solid currentColor; transform: skewY(-40deg); background: var(--paper,#fff); }
.wa-history-icon { position: relative; display: block; width: 19px; height: 19px; border: 1.6px solid currentColor; border-left-color: transparent; border-radius: 50%; }
.wa-history-icon::before { content: ''; position: absolute; top: -1px; left: -3px; width: 6px; height: 6px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; }
.wa-history-icon::after { content: ''; position: absolute; top: 3px; left: 7px; height: 6px; width: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; }
.wa-upload-icon { display: block; position: relative; width: 12px; height: 21px; border: 1.7px solid currentColor; border-radius: 8px; transform: rotate(40deg); }
.wa-upload-icon::after { content: ''; position: absolute; top: 2px; left: 2px; width: 4px; height: 12px; border: 1.4px solid currentColor; border-top: 0; border-radius: 0 0 4px 4px; }
.wa-composer:focus-within { border-color: var(--jade,#0f766e); box-shadow: 0 0 0 1px var(--jade,#0f766e); }
.wa-composer textarea:focus { box-shadow: none; outline: none; }
.wa-dialog .wa-composer textarea:focus-visible { outline: 0; border: 0; box-shadow: none; }
@media (max-width: 640px) {
 .studio-topbar-actions #workspaceHomeButton,
 .studio-topbar-actions #topbarAccountCenterButton:not([hidden]) { display: inline-flex !important; }
}
