:root {
  /* 与 Ascent Compass 平台色板对齐 */
  --canvas: #fbfaf6;
  --sidebar: #fffef9;
  --surface: #ffffff;
  --surface-soft: #f4f0e8;
  --bubble: #e8f3ed;
  --primary: #0f6a55;
  --primary-ink: #0b4f40;
  --mint: #5aa58d;
  --mint-ink: #0f6a55;
  --mint-soft: #e8f3ed;
  --ink: #1f2a24;
  --muted: #5b6660;
  --quiet: #8b918a;
  --line: #ebe3d6;
  --line-strong: #d4c7b3;
  --success: #159c74;
  --warning: #d9874b;
  --risk: #d84b55;
  --shadow-sm: 0 8px 22px rgba(52, 44, 32, 0.045);
  --shadow-lg: 0 18px 42px rgba(52, 44, 32, 0.085);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 24px;
  --sidebar-width: 256px;
  --workspace-panel-width: 360px;
  --composer-clearance: 146px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  font-family: "MiSans", "Noto Sans SC", "PingFang SC", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(15, 106, 85, 0.08), transparent 34%),
    radial-gradient(circle at 88% 2%, rgba(216, 135, 75, 0.08), transparent 30%),
    linear-gradient(180deg, #fffefa 0%, var(--canvas) 100%);
  letter-spacing: 0;
}

button,
textarea,
input,
select {
  font: inherit;
}

button,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 106, 85, 0.32);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 5px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 84px 0 minmax(0, 1fr);
}

.sidebar-collapsed .pane-resizer--sidebar {
  display: none;
}

.pane-resizer {
  position: relative;
  z-index: 6;
  width: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}

.pane-resizer::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 1px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease;
}

.pane-resizer:hover::after,
.pane-resizer:focus-visible::after,
body.is-resizing-panes .pane-resizer--active::after {
  background: rgba(15, 106, 85, 0.45);
}

.pane-resizer--workspace {
  width: 8px;
  justify-self: stretch;
  align-self: stretch;
}

body.is-resizing-panes {
  cursor: col-resize;
  user-select: none;
}

body.is-resizing-panes iframe,
body.is-resizing-panes .ws-terminal {
  pointer-events: none;
}

.sidebar-collapsed .brand-row {
  grid-template-columns: 40px;
}

.sidebar-collapsed .brand-row > div:not(.brand-mark),
.sidebar-collapsed .nav-item b,
.sidebar-collapsed .nav-item:not(.active),
.sidebar-collapsed .task-section,
.sidebar-collapsed .api-config {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 16px;
  background: var(--sidebar);
  border-right: 1px solid rgba(226, 232, 229, 0.78);
  box-shadow: 16px 0 48px rgba(30, 39, 38, 0.04);
  z-index: 5;
}

.brand-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-mark,
.assistant-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px 14px 14px 6px;
  background: linear-gradient(135deg, #0f6a55 0%, #0a4f40 100%);
  color: #fff;
  font-weight: 800;
  box-shadow:
    0 8px 18px rgba(15, 106, 85, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand-row b {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  color: var(--primary-ink);
}

.brand-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.round-tool,
.icon-action {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border-radius: var(--radius-sm);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.icon-button:hover,
.round-tool:hover,
.icon-action:hover {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.08);
}

.icon-button.active,
.round-tool.active {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.1);
}

.icon-action.recording {
  color: #c23b3b;
  background: rgba(194, 59, 59, 0.12);
  animation: voice-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-mic-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

.icon-button:active,
.round-tool:active,
.icon-action:active,
.send-button:active {
  transform: translateY(1px);
}

.nav-list,
.examples,
.history-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.examples button,
.history-item,
.task-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #1f2a24;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item span,
.examples button span:first-child,
.history-item span {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  color: var(--muted);
}

.nav-item:hover,
.examples button:hover,
.history-item:hover,
.task-filter:hover {
  background: rgba(15, 106, 85, 0.07);
  color: var(--primary-ink);
}

.nav-item.active,
.history-item.active {
  background: #e8f3ed;
  color: var(--primary-ink);
  font-weight: 650;
}

.task-section {
  display: grid;
  gap: 10px;
  min-height: 0;
  flex: 0 0 auto;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--quiet);
  font-size: 13px;
  font-weight: 650;
}

.task-filter {
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--quiet);
}

.examples button span:last-child,
.history-item {
  position: relative;
  min-width: 0;
  max-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item b {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--quiet);
  font-style: normal;
  font-weight: 760;
}

.history-item i:hover {
  color: var(--risk);
  background: rgba(216, 75, 85, 0.1);
}

.history-list {
  min-height: 0;
  align-content: start;
  grid-auto-rows: min-content;
  max-height: min(360px, 42vh);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.history-list:empty {
  display: none;
}

.sidebar-footer-wrap {
  position: relative;
  margin-top: auto;
  padding-top: 12px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
}

.round-tool {
  width: 32px;
  height: 32px;
  font-size: 17px;
}

.api-config {
  position: relative;
}

.config-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  display: grid;
  gap: 10px;
  padding: 14px;
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.config-header,
.config-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.config-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.config-close-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.config-close-btn:hover {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.08);
}

.config-header span,
.config-actions span {
  color: var(--muted);
  font-size: 12px;
}

.config-body label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.config-body input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
}

.config-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.config-secondary-btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.config-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.config-actions button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.workspace {
  position: relative;
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--canvas);
}

.topbar {
  flex: 0 0 auto;
  position: relative;
  top: auto;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 42px;
  padding: 14px clamp(18px, 4vw, 48px) 8px;
  background: var(--canvas);
}

.workspace-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 clamp(18px, 4vw, 48px) var(--composer-clearance);
}

/* 对话页：中间独立滚动，顶栏与右侧工作区固定 */
.workspace:has(#conversation:not([hidden])) .workspace-stage {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--composer-clearance);
}

.workspace:has(#conversation:not([hidden])) .conversation {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
}

.workspace:has(#conversation:not([hidden])) .conversation-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.conversation {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
  padding-top: 18px;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.conversation-layout.workspace-open {
  grid-template-columns: minmax(0, 1fr) 8px var(--workspace-panel-width);
  gap: 0 4px;
}

.conversation-main {
  display: grid;
  gap: 20px;
  min-width: 0;
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.auth-chip {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: rgba(246, 248, 247, 0.92);
  color: var(--muted);
  font-size: 12px;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.auth-chip .hub-ghost-btn {
  pointer-events: auto;
  cursor: pointer;
}

.live-activity {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

/* 执行过程已迁到右侧「执行轨迹」，中间对话不再展示 */
#liveActivity,
.live-assistant .live-activity {
  display: none !important;
}

/* 慢模型等待：看板式进度，避免长时间空白 */
.run-working {
  display: grid;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(69, 82, 199, 0.08), transparent 55%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 106, 85, 0.06);
  position: sticky;
  top: 0;
  z-index: 3;
}

.run-working[hidden] {
  display: none !important;
}

.run-working.run-working--compact {
  gap: 8px;
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 106, 85, 0.05);
}

.run-working-compact {
  display: grid;
  gap: 8px;
}

.run-working-compact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.run-working-compact-top b {
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-working-compact-top span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #0f6a55;
  white-space: nowrap;
}

.run-working-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.run-working-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.run-working-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.run-working-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(69, 82, 199, 0.1);
  color: #0f6a55;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.run-working-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 106, 85, 0.1);
  overflow: hidden;
}

.run-working-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f6a55, #10a58b);
  transition: width 0.45s ease;
}

.run-working-bar.is-indeterminate > i {
  width: 38% !important;
  animation: hubProgressPulse 1.4s ease-in-out infinite;
}

.run-working-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

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

.run-working-stage {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(248, 250, 252, 0.9);
  min-width: 0;
}

.run-working-stage b {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-working-stage small {
  color: var(--muted);
  font-size: 11px;
}

.run-working-stage.is-done {
  border-color: rgba(16, 165, 139, 0.22);
  background: rgba(16, 165, 139, 0.06);
}

.run-working-stage.is-done b {
  color: #0f8f78;
}

.run-working-stage.is-active {
  border-color: rgba(69, 82, 199, 0.28);
  background: rgba(69, 82, 199, 0.08);
  box-shadow: inset 0 0 0 1px rgba(69, 82, 199, 0.06);
}

.run-working-stage.is-active b {
  color: #0f6a55;
}

.run-working-stage.is-active small::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-radius: 50%;
  background: #0f6a55;
  vertical-align: middle;
  animation: runWorkingDot 1s ease-in-out infinite;
}

@keyframes runWorkingDot {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.run-working-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.run-working-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.run-working-foot button {
  border: 1px solid rgba(69, 82, 199, 0.2);
  background: #fff;
  color: #0f6a55;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.run-working-foot button:hover {
  background: rgba(69, 82, 199, 0.06);
}

.ws-step-list .run-working {
  margin: 0;
}

.ws-step-list--waiting {
  display: grid;
  gap: 0;
}

.run-working-wait {
  display: grid;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
}

.run-working-wait b {
  font-size: 13px;
  color: var(--ink);
}

.run-working-wait > span {
  font-size: 12px;
  color: #0f6a55;
  font-weight: 600;
}

.run-working-wait small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.artifacts.run-working-host {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 720px) {
  .run-working-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ws-step-list--timeline {
  gap: 10px;
}

.ws-step-list--timeline .activity-card {
  margin: 0;
}

.ws-step-list--timeline .inline-terminal {
  margin-top: 8px;
}

.ws-step-list--timeline .term-script,
.ws-step-list--timeline .term-exec {
  max-height: 180px;
  overflow: auto;
  font-size: 11px;
}

.activity-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  color: inherit;
  cursor: pointer;
}

.activity-card.thought-card {
  cursor: default;
}

.activity-card.thought-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
}

.activity-card.thought-card summary::-webkit-details-marker {
  display: none;
}

.thought-body {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.thought-body p {
  margin: 0 0 4px;
}

.tool-pill-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-pill-head b {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.tool-pill-head small {
  color: var(--quiet);
  font-size: 11px;
}

.activity-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: #e8edf5;
  color: #445;
}

.activity-icon.ok,
.activity-icon.success {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.activity-icon.running {
  background: rgba(234, 179, 8, 0.18);
  color: #a16207;
}

.activity-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.tool-path {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.inline-terminal {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1720;
  color: #d7e2ef;
}

.inline-terminal pre {
  margin: 0;
  padding: 10px 12px;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

.inline-terminal .term-exec {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9fb3c8;
}

.term-cursor {
  display: inline-block;
  width: 7px;
  background: #4ade80;
  animation: termBlink 1s steps(1) infinite;
}

@keyframes termBlink {
  50% { opacity: 0; }
}

.completion-receipt {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #ccefe8;
  border-radius: 10px;
  background: rgba(249, 255, 253, 0.9);
}

.receipt-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.receipt-chips,
.thread-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.receipt-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2a24;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.thread-activity {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.workspace-open-btn {
  margin-left: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.agent-workspace {
  position: relative;
  top: auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 40px rgba(20, 28, 40, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.workspace-head b {
  display: block;
  font-size: 14px;
}

.workspace-head small {
  color: #15803d;
  font-size: 11px;
}

.workspace-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.workspace-tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}

.workspace-tab.active {
  background: #eef5ee;
  color: #0f6a55;
  font-weight: 700;
}

.workspace-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.ws-file-list,
.ws-step-list {
  display: grid;
  gap: 8px;
}

.ws-file-list.empty,
.ws-step-list.empty {
  color: var(--quiet);
  padding: 18px 8px;
  font-size: 13px;
}

.ws-file-row,
.ws-step-row {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.ws-file-row small,
.ws-step-row small {
  color: var(--quiet);
  font-size: 11px;
  word-break: break-all;
}

.ws-file-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ws-file-actions a,
.ws-file-actions button {
  font-size: 12px;
  color: #0f6a55;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.ws-sandbox-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  flex: 0 0 auto;
}

#wsPanelSandbox {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ws-terminal {
  margin: 0;
  padding: 12px;
  flex: 1 1 auto;
  min-height: 280px;
  border-radius: 10px;
  background: #0f1720;
  color: #d7e2ef;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  scrollbar-width: thin;
}

@media (max-width: 960px) {
  .conversation-layout.workspace-open {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .pane-resizer--workspace {
    display: none;
  }
  .agent-workspace {
    position: relative;
    top: 0;
    height: auto;
    max-height: min(480px, 55vh);
  }
  .conversation-main {
    max-height: none;
    overflow: visible;
  }
  .workspace:has(#conversation:not([hidden])) .workspace-stage {
    overflow: auto;
  }
}

.launchpad {
  width: min(808px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 260px);
  display: grid;
  align-content: center;
  gap: 48px;
  padding: 40px 0 92px;
}

.launch-copy {
  text-align: center;
}

.launch-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.1;
  font-weight: 780;
}

.launch-copy p {
  width: min(650px, 100%);
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

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

.capability-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-height: 98px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 229, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 42px rgba(32, 42, 39, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.capability-card:hover {
  border-color: rgba(16, 165, 139, 0.28);
  background: #fff;
  box-shadow: 0 18px 52px rgba(32, 42, 39, 0.08);
  transform: translateY(-1px);
}

.capability-card b {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.25;
}

.capability-card small {
  display: block;
  color: #4c5860;
  font-size: 15px;
  line-height: 1.48;
}

.capability-card.todo-card {
  opacity: 0.72;
}

.capability-card.lark-card .capability-icon {
  background: rgba(37, 99, 235, 0.1);
  color: #0f6a55;
}

.capability-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 20px;
  font-weight: 760;
}

.chat-thread {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.chat-thread .thread-turn {
  display: grid;
  gap: 14px;
}

.chat-thread .thread-user {
  display: flex;
  justify-content: flex-end;
}

.chat-thread .thread-user .bubble,
.chat-thread .thread-assistant .bubble {
  max-width: 650px;
  padding: 14px 18px;
  border-radius: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-thread .thread-user .bubble {
  background: var(--bubble);
  color: #2f3443;
}

.chat-thread .thread-assistant {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-thread .thread-assistant .assistant-avatar {
  flex: 0 0 auto;
}

.chat-thread .thread-assistant .bubble {
  background: #fff;
  border: 1px solid var(--line);
  color: #2f3443;
}

.chat-thread .assistant-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 650px;
}

.thread-attachments,
.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.composer-attachments {
  margin: 0 0 8px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f8fc;
  color: #4a5163;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-chip.pending {
  background: #eef3ff;
  border-color: #c9d6f5;
}

.attach-remove {
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.lark-confirm-card {
  border: 1px solid #d7e0f5;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
  border-radius: 14px;
  padding: 14px 16px;
}

.lark-confirm-card.is-done {
  opacity: 0.72;
}

.lark-confirm-title {
  font-size: 14px;
  font-weight: 650;
  color: #243152;
  margin-bottom: 4px;
}

.lark-confirm-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #5b6478;
  line-height: 1.5;
}

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

.lark-confirm-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #2f3443;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.lark-confirm-btn.primary {
  background: #2f5bff;
  border-color: #2f5bff;
  color: #fff;
}

.lark-confirm-btn:hover:not(:disabled) {
  filter: brightness(0.98);
}

.lark-confirm-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.message {
  min-width: 0;
}

.user-message {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.bubble {
  max-width: 650px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--bubble);
  color: #2f3443;
  line-height: 1.7;
  box-shadow: inset 0 0 0 1px rgba(15, 106, 85, 0.03);
}

.message-actions,
.feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 160ms ease;
}

.message:hover .message-actions,
.assistant-copy:hover .inline-actions,
.artifacts-message:hover .feedback-actions {
  opacity: 1;
}

.message-actions button,
.feedback-actions button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.message-actions button:hover,
.feedback-actions button:hover {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.08);
}

.inline-actions {
  margin-top: 4px;
}

.assistant-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.assistant-avatar {
  display: none;
  position: sticky;
  top: 62px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.muted-avatar {
  background: #eef0f7;
  color: var(--muted);
  box-shadow: none;
}

.assistant-copy {
  min-width: 0;
  line-height: 1.75;
}

.assistant-copy p {
  margin: 0 0 10px;
}

.kicker {
  color: var(--quiet);
  font-size: 13px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

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

.run-meta span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.run-meta span:first-child {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}

.run-meta span:nth-child(2) {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.08);
  border-color: rgba(15, 106, 85, 0.13);
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

.trace-disclosure {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(194, 198, 216, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
}

.trace-disclosure[open] {
  width: 100%;
  background: rgba(255, 255, 255, 0.76);
}

.trace-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
  font-weight: 650;
}

.trace-disclosure > summary::-webkit-details-marker {
  display: none;
}

.trace-disclosure > summary::after {
  content: "⌄";
  color: var(--quiet);
}

.trace-disclosure[open] > summary::after {
  transform: rotate(180deg);
}

.trace-disclosure small {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 650;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
}

.panel-head span {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
}

.timeline {
  max-height: 260px;
  overflow: auto;
  padding: 12px 14px 4px;
}

.timeline.empty,
.artifacts.empty {
  color: var(--quiet);
  padding: 18px;
}

.plan-progress {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.plan-progress[hidden] {
  display: none !important;
}

.plan-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.plan-progress-head b {
  font-size: 13px;
  color: #1f2a24;
}

.plan-progress-head small {
  color: var(--quiet);
  font-size: 12px;
}

.plan-narrative {
  margin: 0 0 10px;
  color: #5b6475;
  font-size: 12px;
  line-height: 1.5;
}

.plan-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.plan-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #3a4250;
}

.plan-step-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8ceda;
}

.plan-step.running .plan-step-marker {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18);
}

.plan-step.success .plan-step-marker {
  background: var(--success);
}

.plan-step.error .plan-step-marker {
  background: var(--risk);
}

.plan-step.pending .plan-step-marker {
  background: #c8ceda;
}

.plan-step.advisory .plan-step-marker {
  background: #8568d9;
}

.plan-step small {
  color: var(--quiet);
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 14px;
}

.event::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 22px;
  bottom: -1px;
  width: 1px;
  background: var(--line);
}

.event:last-child::before {
  display: none;
}

.marker {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  margin-top: 4px;
  border: 4px solid #eef1fb;
  border-radius: 50%;
  background: var(--primary);
}

.event.tool_called .marker,
.event.running .marker {
  background: var(--warning);
}

.event.tool_completed .marker,
.event.success .marker,
.event.artifact_ready .marker {
  background: var(--success);
}

.event.validation_completed .marker {
  background: var(--success);
}

.event.tool_failed .marker,
.event.run_failed .marker,
.event.error .marker {
  background: var(--risk);
}

.event.pending .marker {
  background: #c8ceda;
}

.event.advisory .marker {
  background: #8568d9;
}

.event-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
}

.event-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #1f2a24;
  font-weight: 760;
}

.event-status {
  color: var(--quiet);
  font-weight: 600;
  font-size: 11px;
}

.ppt-outline-preview {
  display: grid;
  gap: 8px;
}

.ppt-outline-label {
  margin: 0;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
}

.event-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-title small {
  flex: 0 0 auto;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 700;
}

.event-detail {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.event-meta {
  margin-top: 7px;
  color: var(--quiet);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}

.tab {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--primary);
  background: rgba(15, 106, 85, 0.09);
  font-weight: 760;
}

.json-view {
  margin: 0;
  max-height: 429px;
  overflow: auto;
  padding: 14px;
  background: #fbfcff;
  color: #5b6660;
  font: 12px/1.62 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.artifacts {
  display: grid;
  gap: 12px;
}

.workflow-cards {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.workflow-cards:empty {
  display: none;
}

.stage-pill {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid #bdeee4;
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  color: var(--mint-ink);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 3px 0 0 var(--mint);
}

.stage-pill span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.stage-pill b {
  min-width: 0;
  font-size: 12px;
}

.stage-pill i {
  color: #75b8ad;
  font-style: normal;
  text-align: right;
}

.outline-card,
.design-system-card,
.agent-swarm-card {
  border: 1px solid #ccefe8;
  border-radius: 10px;
  background: rgba(249, 255, 253, 0.86);
  box-shadow: inset 3px 0 0 var(--mint), 0 12px 34px rgba(32, 42, 39, 0.04);
  overflow: hidden;
}

.outline-card {
  padding: 14px;
}

.outline-head,
.system-title,
.swarm-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.outline-icon,
.system-title span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 12px;
  font-weight: 800;
}

.outline-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.outline-head p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.outline-desc {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.outline-list {
  display: grid;
  gap: 2px;
}

.outline-row {
  display: grid;
  grid-template-columns: 32px 58px minmax(0, 1fr);
  align-items: center;
  min-height: 31px;
  gap: 10px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 12px;
}

.outline-index {
  text-align: right;
  color: #8f938e;
  font-weight: 700;
}

.outline-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #dff8ed;
  color: #137a5d;
  font-size: 11px;
  font-weight: 750;
}

.outline-tag.cover {
  background: #e6e4ff;
  color: #6252c7;
}

.outline-tag.toc {
  background: #e1f0ff;
  color: #2479b8;
}

.outline-tag.closing {
  background: #eef0f3;
  color: #63666f;
}

.outline-row b {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-system-card {
  padding: 14px;
  border-color: #e4d8ff;
  background: rgba(253, 251, 255, 0.9);
  box-shadow: inset 3px 0 0 #8b5cf6, 0 12px 34px rgba(32, 42, 39, 0.04);
}

.system-title span {
  background: #efe7ff;
  color: #8b5cf6;
}

.system-title b,
.swarm-head b {
  color: var(--ink);
  font-size: 14px;
}

.design-system-card > p {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.design-system-card ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.design-system-card li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.design-system-card li b {
  color: var(--ink);
}

.agent-swarm-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 3px 0 0 var(--primary), 0 12px 34px rgba(32, 42, 39, 0.04);
}

.swarm-head {
  min-height: 38px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
}

.swarm-head div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swarm-head small {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 750;
}

.swarm-head i {
  width: 70px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) var(--progress), rgba(16, 165, 139, 0.18) 0);
}

.swarm-list {
  display: grid;
  gap: 8px;
  padding: 8px 10px 10px;
}

.swarm-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px 20px minmax(0, 1fr) 36px 52px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.swarm-row.expanded {
  align-items: start;
}

.swarm-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: var(--agent-color);
}

.swarm-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.agent-avatar {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(145deg, #f8faf9, #dfe8e4);
  border: 1px solid #cfdad5;
  box-shadow: inset 0 0 0 3px #fff;
}

.swarm-copy {
  min-width: 0;
}

.swarm-copy b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
}

.swarm-copy em {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.swarm-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swarm-dots {
  justify-self: center;
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--agent-color) 0 4px, transparent 4px 7px);
}

.swarm-row button {
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.swarm-detail {
  display: none;
  grid-column: 3 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 4px 0 2px;
}

.swarm-row.expanded .swarm-detail {
  display: block;
}

.artifact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
  overflow: hidden;
}

.artifact-top {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.artifact-top h3 {
  margin: 0 0 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.artifact-top p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef0f6;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.artifact-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: #eef0f6;
  text-decoration: none;
  font-weight: 760;
  cursor: pointer;
}

.ghost-download {
  color: var(--muted);
  background: transparent;
}

.office-preview {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}

.ppt-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.office-visual {
  padding: 14px 14px 0;
}

.office-visual img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.office-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.office-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.office-summary b {
  color: var(--ink);
  font-size: 14px;
}

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

.slide-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.slide-row > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef0f6;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.slide-row b,
.sheet-head b {
  color: var(--ink);
  font-size: 14px;
}

.slide-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.full-ppt-preview .office-visual img {
  max-height: 360px;
  object-fit: contain;
}

.ppt-page-stack {
  display: grid;
  gap: 14px;
}

.ppt-page {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  min-height: 240px;
  aspect-ratio: 16 / 9;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ffffff 0%, #f7faf9 100%);
  box-shadow: inset 3px 0 0 var(--primary);
}

.ppt-page-num {
  display: grid;
  place-items: center;
  align-self: start;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef0f6;
  color: var(--primary);
  font-weight: 800;
}

.ppt-page-content {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 14px;
}

.ppt-page-content h4 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.18;
}

.ppt-page-content ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.ppt-page-content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.sheet-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-preview table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12px;
}

.sheet-preview td {
  max-width: 160px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  color: #474a45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-preview tr:first-child td {
  color: var(--ink);
  background: #f8f7fb;
  font-weight: 700;
}

.doc-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.doc-preview h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.doc-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.preview-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(26, 28, 32, 0.34);
  backdrop-filter: blur(10px);
}

.preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, 100%);
  max-height: min(860px, calc(100vh - 68px));
  border: 1px solid rgba(232, 230, 225, 0.92);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(23, 24, 27, 0.22);
  overflow: hidden;
}

.preview-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-dialog-head b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.preview-dialog-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.preview-dialog-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.preview-dialog-actions button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #eef0f6;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.preview-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #fbfaf8;
}

.preview-dialog-body .office-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.preview-dialog-body .office-visual img {
  max-height: none;
  object-fit: contain;
}

.preview-dialog-body .slide-list {
  gap: 10px;
}

.preview-dialog-body .slide-row {
  min-height: 38px;
}

.full-html-preview {
  display: block;
  width: 100%;
  height: min(720px, calc(100vh - 170px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.full-text-preview {
  margin: 0;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #22252a;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview {
  min-height: 260px;
  background: #fff;
}

.preview iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  background: #fff;
}

.preview pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  color: #1f2937;
  background: #fbfcff;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.artifact-card details {
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.artifact-card summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 700;
}

.assistant-final {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.utility-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.utility-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

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

.utility-list p {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(246, 248, 247, 0.72);
}

.utility-list b {
  color: var(--ink);
}

.utility-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── Library Hub (产物库独立页) ─────────────────────────────────── */
.library-hub {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 24px;
}

/* ── Schedule Hub (定时任务独立页) ───────────────────────────────── */
.schedule-hub {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  gap: 20px;
}

.sched-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 28px 28px 24px;
  border: 1px solid rgba(203, 216, 210, 0.72);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(16, 165, 139, 0.14), transparent 56%),
    radial-gradient(90% 100% at 0% 100%, rgba(15, 106, 85, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 249, 0.92));
  box-shadow: var(--shadow-sm);
}

.sched-page-hero-copy h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  color: var(--primary-ink);
}

.sched-page-hero-copy p:last-child {
  margin: 10px 0 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.sched-page-stats {
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
}

.sched-stat {
  min-width: 84px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(203, 216, 210, 0.7);
  text-align: center;
}

.sched-stat span {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-ink);
  line-height: 1.1;
}

.sched-stat small {
  color: var(--muted);
  font-size: 12px;
}

.sched-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sched-filter-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(237, 243, 241, 0.9);
  border: 1px solid rgba(203, 216, 210, 0.7);
}

.sched-filter {
  min-height: 34px;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.sched-filter:hover {
  color: var(--mint-ink);
}

.sched-filter.active {
  background: #fff;
  color: var(--mint-ink);
  box-shadow: 0 4px 12px rgba(32, 42, 39, 0.06);
}

.sched-page-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.sched-page-layout.has-drawer {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.sched-list-host {
  min-width: 0;
}

.sched-form-drawer {
  position: sticky;
  top: 16px;
}

.scheduled-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.scheduled-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 22px;
}

.scheduled-empty p {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}

.scheduled-empty span {
  max-width: 36ch;
  font-size: 13px;
  line-height: 1.5;
}

.scheduled-empty .hub-primary-btn {
  margin-top: 8px;
}

.scheduled-list {
  display: grid;
  gap: 12px;
}

.scheduled-list .scheduled-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid rgba(203, 216, 210, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.scheduled-item.is-off {
  opacity: 0.78;
}

.scheduled-list .scheduled-item:hover {
  border-color: rgba(16, 165, 139, 0.35);
}

.scheduled-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 18px;
}

.scheduled-item-icon.is-off {
  background: #f1f3f2;
  color: var(--quiet);
}

.scheduled-item-main {
  min-width: 0;
}

.scheduled-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.scheduled-item-title b {
  color: var(--ink);
  font-size: 15px;
}

.scheduled-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}

.scheduled-badge.on {
  background: #dcfce7;
  color: #166534;
}

.scheduled-badge.off {
  background: #f3f4f3;
  color: #5b645f;
}

.scheduled-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.scheduled-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.scheduled-rule {
  color: var(--mint-ink) !important;
  background: var(--mint-soft) !important;
}

.scheduled-item-msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.scheduled-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sched-action {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.sched-action:hover {
  color: var(--mint-ink);
  border-color: #b7ddbd;
  background: var(--mint-soft);
}

.sched-action.danger:hover {
  color: #991b1b;
  border-color: #fecaca;
  background: #fef2f2;
}

.scheduled-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(203, 216, 210, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.scheduled-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scheduled-form-head h4 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.scheduled-form-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.sched-drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.sched-drawer-close:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.scheduled-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 650;
}

.scheduled-field input,
.scheduled-field select,
.scheduled-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7e3dc;
  border-radius: 12px;
  background: #f4faf6;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  outline: none;
}

.scheduled-field input:focus,
.scheduled-field select:focus,
.scheduled-field textarea:focus {
  border-color: #b7ddbd;
  box-shadow: 0 0 0 3px rgba(16, 165, 139, 0.12);
}

.sched-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sched-preset {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid #d7e3dc;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.sched-preset:hover {
  color: var(--mint-ink);
  border-color: #b7ddbd;
  background: var(--mint-soft);
}

.sched-preset.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #12b191, #0f6a55);
  box-shadow: 0 8px 18px rgba(15, 106, 85, 0.18);
}

.scheduled-enable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 650;
}

.scheduled-enable input {
  width: 16px;
  height: 16px;
  accent-color: #0f6a55;
}

.scheduled-form-actions {
  display: flex;
  gap: 8px;
}

.sched-primary-btn,
.sched-secondary-btn {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sched-primary-btn {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #12b191, #0f6a55);
  box-shadow: 0 10px 22px rgba(15, 106, 85, 0.2);
}

.sched-primary-btn:hover {
  filter: brightness(1.03);
}

.sched-secondary-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.sched-secondary-btn:hover {
  color: var(--mint-ink);
  background: var(--mint-soft);
  border-color: #b7ddbd;
}

.scheduled-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--quiet);
}

.utility-panel .muted {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

/* 任务看板 × Agent 办公室 */
.board-office {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid rgba(203, 216, 210, 0.85);
  border-radius: 18px;
  overflow: hidden;
}

.board-office-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(203, 216, 210, 0.6);
}

.board-office-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.board-office-title b {
  font-size: 14px;
  color: var(--ink, #10213a);
}

.board-office-title small {
  font-size: 12px;
  color: var(--muted);
}

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

.board-office-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.board-office-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.board-office-dot--running { background: #0ea5e9; }
.board-office-dot--pending { background: #d97706; }
.board-office-dot--idle { background: #a8a89c; }

/* Agent 办公室主体为共享 React 组件(3D/像素视图、demo 布局),样式内联;
   小岛只需提供面板高度 */
.board-office-react {
  height: clamp(340px, 44vw, 520px);
}

@media (max-width: 720px) {
  .board-office-react {
    height: 420px;
  }
}

/* 任务看板 */
.board-card-list {
  display: grid;
  gap: 12px;
}

.board-section-label {
  margin: 4px 2px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

.board-card--scheduled {
  border-color: rgba(167, 139, 250, 0.55);
  background: linear-gradient(180deg, #faf8ff 0%, #fff 48%);
}

.board-card {
  background: #fff;
  border: 1px solid rgba(203, 216, 210, 0.85);
  border-radius: 18px;
  padding: 16px 18px;
}

.board-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.board-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #10213a);
}

.board-card-sub,
.board-card-meta,
.board-card-summary {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.board-card-summary {
  margin-top: 8px;
  line-height: 1.45;
}

.board-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.board-progress {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(203, 216, 210, 0.55);
  overflow: hidden;
}

.board-progress > i {
  display: block;
  height: 100%;
  background: #0ea5e9;
  border-radius: inherit;
}

.board-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.board-badge--pending { background: #fef3c7; color: #92400e; }
.board-badge--running { background: #e0f2fe; color: #075985; }
.board-badge--success { background: #dcfce7; color: #166534; }
.board-badge--failed { background: #fee2e2; color: #991b1b; }
.board-badge--muted { background: #f3f4f6; color: #6b7280; }
.board-badge--scheduled { background: #ede9fe; color: #5b21b6; }

.board-detail p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
}

.board-detail-traces ul,
.board-detail-arts ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .sched-page-layout.has-drawer {
    grid-template-columns: 1fr;
  }

  .sched-form-drawer {
    position: static;
  }
}

@media (max-width: 720px) {
  .sched-page-hero {
    grid-template-columns: 1fr;
  }

  .sched-page-stats {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .scheduled-list .scheduled-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .scheduled-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .sched-page-toolbar {
    align-items: stretch;
  }

  .sched-page-toolbar-actions {
    width: 100%;
  }

  .sched-page-toolbar-actions .hub-ghost-btn,
  .sched-page-toolbar-actions .hub-primary-btn {
    flex: 1;
  }
}

/* ── Control Hub (工作台) ─────────────────────────────────────────── */
.control-hub {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 24px;
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 28px 28px 24px;
  border: 1px solid rgba(203, 216, 210, 0.72);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(15, 106, 85, 0.12), transparent 58%),
    radial-gradient(80% 100% at 0% 100%, rgba(16, 165, 139, 0.1), transparent 52%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.hub-eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-hero-copy h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  color: var(--primary-ink);
}

.hub-hero-copy p:last-child {
  margin: 10px 0 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.hub-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
}

.hub-stat {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 229, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.hub-stat span {
  font-size: 22px;
  font-weight: 780;
  color: var(--ink);
  line-height: 1;
}

.hub-stat small {
  color: var(--quiet);
  font-size: 11px;
}

.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.hub-tab {
  flex: 1 1 auto;
  min-width: 88px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.hub-tab:hover {
  color: var(--ink);
  background: rgba(15, 106, 85, 0.06);
}

.hub-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #0f6a55, #0a4f40);
  box-shadow: 0 10px 24px rgba(15, 106, 85, 0.22);
}

.hub-panels {
  min-height: 360px;
}

.hub-panel {
  display: grid;
  gap: 16px;
  animation: hubFadeIn 220ms ease;
}

@keyframes hubFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-panel-meta {
  color: var(--quiet);
  font-size: 13px;
}

.hub-search {
  flex: 1;
  max-width: 360px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.hub-ghost-btn,
.hub-primary-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hub-ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.hub-primary-btn {
  border: none;
  background: linear-gradient(135deg, #0f6a55, #0a4f40);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 106, 85, 0.2);
}

.hub-file-grid,
.hub-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.hub-file-card,
.hub-tool-card,
.hub-run-card,
.hub-status-card {
  padding: 16px;
  border: 1px solid rgba(226, 232, 229, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(32, 42, 39, 0.04);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.hub-file-card:hover,
.hub-run-card:hover,
.hub-tool-card:hover,
button.hub-agent-card:hover {
  border-color: rgba(16, 165, 139, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(32, 42, 39, 0.08);
}

button.hub-agent-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(226, 232, 229, 0.92);
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(32, 42, 39, 0.04);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button.hub-agent-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

button.hub-agent-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hub-agent-grid {
  max-width: 720px;
}

.hub-file-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.hub-file-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 18px;
}

.hub-file-card h3,
.hub-run-card h3,
.hub-tool-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.hub-file-card p,
.hub-run-card p,
.hub-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hub-tools-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top right, rgba(69, 82, 199, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(246, 248, 247, 0.96), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(226, 232, 229, 0.92);
}

.hub-tools-banner b {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: var(--ink);
}

.hub-tools-banner p {
  margin: 0;
  max-width: 48rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hub-tools-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hub-tools-stat {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(226, 232, 229, 0.92);
  background: rgba(255, 255, 255, 0.9);
}

.hub-tools-stat b {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink);
}

.hub-tools-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hub-tools-toolbar {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-skill-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.hub-skill-cat {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.hub-skill-cat.active,
.hub-skill-cat:hover {
  border-color: rgba(69, 82, 199, 0.18);
  background: rgba(69, 82, 199, 0.08);
  color: #0a4f40;
}

.hub-skill-grid {
  align-items: stretch;
}

.hub-skill-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1px solid rgba(226, 232, 229, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(32, 42, 39, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.hub-skill-card:hover {
  border-color: rgba(69, 82, 199, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(32, 42, 39, 0.08);
}

.hub-skill-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hub-skill-icon,
.hub-skill-sheet-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}

.hub-skill-icon.asset-pos-0,
.hub-skill-sheet-icon.asset-pos-0 { background: #e8f3ed; color: #0f6a55; }
.hub-skill-icon.asset-pos-1,
.hub-skill-sheet-icon.asset-pos-1 { background: #dcfce7; color: #166534; }
.hub-skill-icon.asset-pos-2,
.hub-skill-sheet-icon.asset-pos-2 { background: #fef3c7; color: #92400e; }
.hub-skill-icon.asset-pos-3,
.hub-skill-sheet-icon.asset-pos-3 { background: #ede9fe; color: #5b21b6; }
.hub-skill-icon.asset-pos-4,
.hub-skill-sheet-icon.asset-pos-4 { background: #ffe4e6; color: #9f1239; }
.hub-skill-icon.asset-pos-5,
.hub-skill-sheet-icon.asset-pos-5 { background: #e0f2fe; color: #075985; }

.hub-skill-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.hub-skill-level,
.hub-skill-version {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.hub-skill-level.advanced { background: #dcfce7; color: #166534; }
.hub-skill-level.intermediate { background: #fef3c7; color: #92400e; }
.hub-skill-level.basic { background: #e8e4dd; color: #44403c; }
.hub-skill-version {
  background: #e6ecfa;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: 10px;
}

.hub-skill-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.hub-skill-meta-line {
  margin: 0 0 8px !important;
  color: #9ca3af !important;
  font-size: 12px !important;
}

.hub-skill-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 12px !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  flex: 1;
}

.hub-skill-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  color: #9ca3af;
  font-size: 11px;
}

.hub-platform-card {
  opacity: 0.96;
}

.hub-skill-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}

.hub-skill-sheet[hidden] {
  display: none !important;
}

.hub-skill-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(1px);
  cursor: pointer;
}

.hub-skill-sheet-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid rgba(226, 232, 229, 0.92);
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.12);
  animation: hubSkillSheetIn 0.28s ease-out;
}

@keyframes hubSkillSheetIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.hub-skill-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(226, 232, 229, 0.92);
}

.hub-skill-sheet-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.hub-skill-sheet-heading {
  min-width: 0;
}

.hub-skill-sheet-heading h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.hub-skill-sheet-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hub-skill-sheet-close {
  flex-shrink: 0;
}

.hub-skill-sheet-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 28px;
}

.hub-skill-section {
  margin-bottom: 18px;
}

.hub-skill-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}

.hub-skill-lead,
.hub-skill-section p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.hub-skill-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.hub-skill-facts > div {
  padding: 12px;
  border-radius: 12px;
  background: #eef2fd;
}

.hub-skill-facts span {
  display: block;
  color: #9ca3af;
  font-size: 11px;
}

.hub-skill-facts b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.hub-skill-intro-text {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 229, 0.92);
  color: #374151;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

.hub-skill-tool-list {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.7;
}

.hub-muted {
  margin: 0;
  color: #9ca3af;
  font-size: 13px;
}

body.hub-skill-sheet-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .hub-tools-stats {
    grid-template-columns: 1fr;
  }

  .hub-skill-sheet-panel {
    width: 100%;
  }
}

.hub-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hub-card-actions a,
.hub-card-actions button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 248, 247, 0.9);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.hub-card-actions a:hover,
.hub-card-actions button:hover {
  border-color: rgba(15, 106, 85, 0.28);
  color: var(--primary);
}

.hub-run-list {
  display: grid;
  gap: 12px;
}

.hub-run-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.hub-run-card.active {
  border-color: rgba(15, 106, 85, 0.32);
  background: rgba(232, 235, 247, 0.72);
}

.hub-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.hub-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(246, 248, 247, 0.96);
  color: var(--muted);
  font-size: 11px;
}

.hub-badge.ok {
  background: rgba(21, 156, 116, 0.12);
  color: var(--success);
}

.hub-badge.warn {
  background: rgba(216, 75, 85, 0.1);
  color: var(--risk);
}

.hub-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.hub-status-card {
  display: grid;
  gap: 8px;
}

.hub-status-card .label {
  color: var(--quiet);
  font-size: 12px;
}

.hub-status-card .value {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.hub-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(246, 248, 247, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.hub-status-pill.ok {
  background: rgba(21, 156, 116, 0.12);
  color: var(--success);
}

.hub-config-card {
  position: static;
  max-height: none;
  overflow: visible;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.hub-config-lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hub-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--quiet);
  text-align: center;
  line-height: 1.7;
}

.hub-empty b {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
}

.hub-briefing-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(37, 99, 235, 0.1), transparent 58%),
    radial-gradient(80% 100% at 0% 100%, rgba(16, 165, 139, 0.08), transparent 52%),
    rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.hub-briefing-banner b {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  color: var(--primary-ink);
}

.hub-briefing-banner p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.hub-briefing-banner a {
  color: var(--primary);
}

.hub-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.hub-briefing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.hub-briefing-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(226, 232, 229, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(32, 42, 39, 0.04);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.hub-briefing-card:hover {
  border-color: rgba(37, 99, 235, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(32, 42, 39, 0.08);
}

.hub-briefing-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e8f3ed, #e8f3ed);
  font-size: 22px;
}

.hub-briefing-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}

.hub-briefing-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hub-briefing-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(15, 106, 85, 0.08);
}

.hub-briefing-progress.failed {
  border-color: rgba(216, 75, 85, 0.24);
}

.hub-briefing-progress.done {
  border-color: rgba(21, 156, 116, 0.24);
}

.hub-briefing-reader {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: min(72vh, 820px);
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(15, 106, 85, 0.08);
}

.hub-briefing-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-briefing-reader-frame {
  flex: 1;
  width: 100%;
  min-height: min(64vh, 760px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
}

.hub-briefing-progress-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.hub-briefing-progress-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.hub-briefing-progress-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hub-progress-bar {
  margin-top: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 106, 85, 0.1);
  overflow: hidden;
}

.hub-progress-bar-fill {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f6a55, #10a58b);
  animation: hubProgressPulse 1.4s ease-in-out infinite;
}

@keyframes hubProgressPulse {
  0% { transform: translateX(-120%); width: 36%; }
  50% { width: 68%; }
  100% { transform: translateX(320%); width: 36%; }
}

.hub-primary-btn:disabled,
.hub-ghost-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.assistant-final:empty {
  display: none;
}

.assistant-final p {
  margin: 0;
  color: var(--ink);
  line-height: 1.8;
}

.feedback-actions {
  margin-top: 14px;
  opacity: 1;
}

.hitl-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 106, 85, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbf8 0%, var(--mint-soft) 100%);
  box-shadow: var(--shadow-sm);
}

.hitl-panel[hidden] {
  display: none !important;
}

.hitl-panel-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.hitl-panel-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(15, 106, 85, 0.12);
  color: var(--primary);
  font-size: 14px;
}

.hitl-panel-copy small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-ink);
  margin-bottom: 4px;
}

.hitl-panel-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
}

.hitl-fields {
  display: grid;
  gap: 10px;
  max-height: min(50vh, 420px);
  overflow: auto;
  margin-bottom: 12px;
  padding-right: 2px;
}

.hitl-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.hitl-field label em {
  color: var(--risk);
  font-style: normal;
  margin-left: 2px;
}

.hitl-field input,
.hitl-field textarea,
.hitl-field select {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.hitl-field textarea {
  min-height: 64px;
  resize: vertical;
}

.hitl-field input:focus,
.hitl-field textarea:focus,
.hitl-field select:focus {
  border-color: rgba(15, 106, 85, 0.45);
}

.hitl-actions {
  display: grid;
  gap: 8px;
}

.hitl-submit {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f6a55 0%, #0a4f40 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 107, 95, 0.18);
}

.hitl-submit:hover:not(:disabled) {
  filter: brightness(0.97);
}

.hitl-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hitl-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hitl-options button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.hitl-dismiss {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  justify-self: start;
  padding: 0;
}

.hitl-dismiss:hover {
  color: var(--primary-ink);
}

.suggestions {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 14px;
}

.suggestions button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(194, 198, 216, 0.36);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.suggestions button:hover {
  border-color: rgba(15, 106, 85, 0.28);
  background: #fff;
  color: var(--primary);
}

.suggestions span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.composer-wrap {
  position: fixed;
  left: calc(var(--sidebar-width) + 5px);
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 14px clamp(18px, 4vw, 48px) 18px;
  background: linear-gradient(180deg, rgba(248, 247, 245, 0), rgba(248, 247, 245, 0.92) 34%, var(--canvas));
  pointer-events: none;
}

.sidebar-collapsed .composer-wrap {
  left: 84px;
}

/* 仅当对话页可见且右侧工作区打开时，才给输入框让出右侧空间
   （避免离开对话后 workspace-open 残留导致新任务页输入框错位） */
.workspace:has(#conversation:not([hidden]) .conversation-layout.workspace-open) .composer-wrap {
  right: calc(var(--workspace-panel-width) + 20px);
}

.workspace:has(#conversation:not([hidden]) .conversation-layout.workspace-open) .composer {
  width: min(706px, 100%);
}

.composer {
  width: min(706px, 100%);
  margin: 0 auto;
  min-height: 110px;
  padding: 15px 16px 12px;
  border: 1px solid rgba(226, 232, 229, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 62px rgba(32, 42, 39, 0.12);
  /* 不用 backdrop-filter：Safari 会裁切向上展开的 picker 菜单 */
  overflow: visible;
  pointer-events: auto;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.composer.composer--drag-over {
  border-color: rgba(47, 122, 106, 0.72);
  background: rgba(236, 247, 243, 0.98);
  box-shadow: 0 22px 62px rgba(32, 42, 39, 0.12), inset 0 0 0 1px rgba(47, 122, 106, 0.28);
}

.composer.composer--drag-over::after {
  content: "松开以上传文件";
  position: absolute;
  inset: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed rgba(47, 122, 106, 0.55);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: #2f7a6a;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--ink);
}

#message {
  min-height: 46px;
  max-height: 120px;
  font-size: 15px;
  line-height: 1.48;
  padding: 0 4px;
}

#message::placeholder,
#code::placeholder {
  color: var(--quiet);
}

#code {
  min-height: 0;
  height: 0;
  padding: 0;
  opacity: 0;
  border-top: 1px solid transparent;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: height 180ms ease, opacity 180ms ease, padding 180ms ease, border-color 180ms ease;
}

#code:not(:placeholder-shown),
#code:focus {
  height: 64px;
  padding-top: 6px;
  margin-top: 6px;
  opacity: 1;
  border-color: var(--line);
}

/* 工作台：任务说明放在补充区，展开更高以便阅读 */
body.workflow-reimburse #code:not(:placeholder-shown),
body.workflow-leave #code:not(:placeholder-shown),
body.workflow-reimburse #code:focus,
body.workflow-leave #code:focus {
  height: auto;
  min-height: 88px;
  max-height: 140px;
  overflow-y: auto;
  font: 13px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--quiet);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.left-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.icon-action {
  width: 30px;
  height: 30px;
  font-size: 22px;
}

.left-controls select {
  display: none;
}

.research-toggle {
  display: none;
}

.research-toggle input {
  accent-color: var(--primary);
}

.backend-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(66, 88, 216, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.composer-pickers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.picker-wrap {
  position: relative;
  z-index: 5;
}

.picker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 6px 10px;
  border: 1px solid rgba(66, 88, 216, 0.16);
  border-radius: 999px;
  background: rgba(66, 88, 216, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.picker-pill:hover,
.picker-pill[aria-expanded="true"] {
  background: rgba(66, 88, 216, 0.14);
  border-color: rgba(66, 88, 216, 0.28);
}

.picker-pill-label {
  opacity: 0.72;
  font-weight: 600;
}

.picker-pill-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-pill-caret {
  opacity: 0.55;
  font-size: 10px;
}

.picker-pill--locked {
  cursor: pointer;
  opacity: 0.92;
  border-style: dashed;
}
.picker-pill--locked:hover {
  border-color: var(--accent, #0f6b5f);
}
.picker-pill--locked .picker-pill-caret {
  display: none;
}

.picker-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 120;
  min-width: 220px;
  max-width: min(320px, 70vw);
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(40, 48, 78, 0.1);
  background: #fff;
  box-shadow: 0 16px 40px rgba(35, 42, 72, 0.16);
}

.picker-menu--wide {
  min-width: 260px;
  max-width: min(360px, 80vw);
  max-height: 360px;
}

.picker-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #1f2437;
}

.picker-menu-item:hover,
.picker-menu-item[aria-selected="true"] {
  background: rgba(66, 88, 216, 0.08);
}

.picker-menu-item b {
  font-size: 13px;
  font-weight: 700;
}

.picker-menu-item small {
  font-size: 11px;
  color: #8b918a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-menu-section {
  padding: 6px 10px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a7f70;
}
.picker-menu-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: #8b918a;
}

.send-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: #0f6a55;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 106, 85, 0.18);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.send-button:hover {
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(15, 106, 85, 0.22);
}

.send-button:disabled {
  cursor: progress;
  background: #c3c8d8;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(37, 39, 43, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1160px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hub-hero {
    grid-template-columns: 1fr;
  }

  .hub-tabs {
    border-radius: var(--radius-md);
  }

  .hub-tab {
    flex: 1 1 calc(50% - 8px);
  }

  .hub-agent-grid {
    max-width: none;
  }

  .hub-run-card {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .pane-resizer--sidebar {
    display: none;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: auto;
    gap: 16px;
    padding: 14px;
    width: 100%;
    overflow-x: hidden;
  }

  .nav-list,
  .examples,
  .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer-wrap {
    margin-top: 0;
    padding-top: 0;
  }

  .config-body {
    position: static;
    bottom: auto;
    max-height: none;
    margin-bottom: 12px;
  }

  .workspace {
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .workspace-stage {
    padding: 0 14px 190px;
  }

  .composer-wrap {
    left: 0 !important;
    right: 0 !important;
  }

  .topbar {
    min-height: 34px;
    padding: 10px 14px 6px;
  }

  .conversation {
    padding-top: 6px;
  }

  .launchpad {
    min-height: auto;
    align-content: start;
    gap: 28px;
    padding: 42px 0 160px;
  }

  .capability-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .assistant-line {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .assistant-avatar {
    width: 32px;
    height: 32px;
  }

  .composer-wrap {
    left: 0;
    padding: 18px 14px 20px;
  }
}

@media (max-width: 560px) {
  .brand-row {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    gap: 10px;
    box-shadow: 0 14px 34px rgba(58, 63, 92, 0.08);
  }

  .history-list {
    display: none;
  }

  .nav-list,
  .sidebar-footer {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar,
  .sidebar-footer::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 88px;
  }

  .sidebar-footer {
    padding: 0;
    margin-top: 0;
  }

  .task-section {
    gap: 8px;
  }

  .examples {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .examples::-webkit-scrollbar {
    display: none;
  }

  .examples button {
    flex: 0 0 auto;
    width: auto;
    max-width: 210px;
  }

  .bubble {
    max-width: 100%;
    padding: 14px 16px;
  }

  .launch-copy {
    text-align: left;
  }

  .launchpad {
    gap: 20px;
    padding: 24px 0 260px;
  }

  .launch-copy h1 {
    font-size: 34px;
  }

  .launch-copy p {
    margin-top: 14px;
    font-size: 15px;
  }

  .capability-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 112px;
    padding: 16px;
    gap: 14px;
  }

  .capability-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .assistant-line {
    grid-template-columns: 1fr;
  }

  .assistant-avatar {
    position: static;
  }

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

  .left-controls {
    width: 100%;
  }

  .send-button {
    align-self: flex-end;
  }

  .ppt-page {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
    min-height: 220px;
    padding: 18px;
  }

  .ppt-page-content h4 {
    font-size: 24px;
  }
}

.auth-chip #authUserLabel {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  max-width: 420px;
  width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(20, 28, 45, 0.28);
  background: #fff;
  margin: auto;
}

.auth-dialog[open] {
  display: block;
}

.auth-dialog::backdrop {
  background: rgba(18, 24, 38, 0.45);
}

.auth-dialog-body {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.auth-dialog-body h2 {
  margin: 0;
  font-size: 20px;
}

.auth-dialog-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-dialog-body label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.auth-dialog-body input {
  min-height: 40px;
  border: 1px solid rgba(20, 28, 45, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}

.auth-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.auth-error {
  color: #b42318;
  font-size: 13px;
}


/* ── 报销 / 请假专属工作台 ───────────────────────────────────────── */
.workflow-desk {
  margin: 0 0 18px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(47, 122, 106, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(236, 247, 243, 0.95), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at top right, rgba(47, 122, 106, 0.12), transparent 48%);
  box-shadow: 0 12px 36px rgba(32, 42, 39, 0.06);
}

.conversation--leave .workflow-desk {
  border-color: rgba(29, 78, 216, 0.16);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 48%);
}

.workflow-desk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.workflow-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f7a6a;
  font-weight: 700;
}

.conversation--leave .workflow-eyebrow {
  color: #0f6a55;
}

.workflow-desk-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: #1f2933;
}

.workflow-desk-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #5b6770;
  max-width: 42em;
}

.workflow-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}

.conversation--leave .workflow-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(226, 232, 229, 0.9);
  min-height: 72px;
}

.workflow-step-index {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #2f7a6a;
  background: rgba(47, 122, 106, 0.12);
}

.conversation--leave .workflow-step-index {
  color: #0f6a55;
  background: rgba(29, 78, 216, 0.12);
}

.workflow-step-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.workflow-step-copy b {
  font-size: 13px;
  color: #1f2933;
}

.workflow-step-copy small {
  font-size: 12px;
  color: #7b8790;
}

.workflow-step.current {
  border-color: rgba(47, 122, 106, 0.45);
  box-shadow: inset 0 0 0 1px rgba(47, 122, 106, 0.18);
}

.conversation--leave .workflow-step.current {
  border-color: rgba(29, 78, 216, 0.4);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.16);
}

.workflow-step.done {
  opacity: 0.78;
}

.workflow-step.done .workflow-step-index {
  background: #2f7a6a;
  color: #fff;
}

.conversation--leave .workflow-step.done .workflow-step-index {
  background: #0f6a55;
}

.workflow-desk-artifacts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 232, 229, 0.9);
}

.workflow-arts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.workflow-arts-head b {
  font-size: 13px;
  color: #1f2933;
}

.workflow-arts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-art-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 229, 0.95);
  font-size: 13px;
}

.workflow-art-actions {
  display: inline-flex;
  gap: 8px;
  flex-shrink: 0;
}

.workflow-art-actions a,
.workflow-art-actions button {
  border: 0;
  background: transparent;
  color: #2f7a6a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.composer.composer--reimburse {
  border-color: rgba(47, 122, 106, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 247, 243, 0.92));
  box-shadow: 0 22px 62px rgba(47, 122, 106, 0.14);
}

.composer.composer--leave {
  border-color: rgba(29, 78, 216, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.92));
  box-shadow: 0 22px 62px rgba(29, 78, 216, 0.12);
}

body.workflow-reimburse #currentUserMessage:has(#userPromptBubble:empty),
body.workflow-leave #currentUserMessage:has(#userPromptBubble:empty) {
  display: none;
}

body.workflow-reimburse .conversation-main,
body.workflow-leave .conversation-main {
  padding-bottom: 8px;
}

@media (max-width: 900px) {
  .workflow-steps,
  .conversation--leave .workflow-steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .workflow-steps,
  .conversation--leave .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-desk-head {
    flex-direction: column;
  }
}

/* 报销/请假工作台：去掉聊天式运行状态条，空闲时隐藏对话壳 */
body.workflow-reimburse .run-meta,
body.workflow-leave .run-meta {
  display: none !important;
}

body.workflow-idle #liveAssistantMessage,
body.workflow-idle .artifacts-message,
body.workflow-idle #legacyTraceMessage,
body.workflow-idle #currentUserMessage:has(#userPromptBubble:empty) {
  display: none !important;
}

body.workflow-reimburse.workflow-idle .conversation-main,
body.workflow-leave.workflow-idle .conversation-main {
  min-height: auto;
}
