:root {
  --canvas: #f6f8f7;
  --sidebar: #fbfcfb;
  --surface: #ffffff;
  --surface-soft: #edf3f1;
  --bubble: #e8ebf7;
  --primary: #3446a8;
  --primary-ink: #263583;
  --mint: #10a58b;
  --mint-ink: #087966;
  --mint-soft: #e8fbf6;
  --ink: #25272b;
  --muted: #68716e;
  --quiet: #99a09c;
  --line: #e2e8e5;
  --line-strong: #cbd8d2;
  --success: #159c74;
  --warning: #c9792b;
  --risk: #d84b55;
  --shadow-sm: 0 8px 22px rgba(32, 42, 39, 0.05);
  --shadow-lg: 0 28px 70px rgba(32, 42, 39, 0.12);
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 24px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  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: linear-gradient(90deg, rgba(220, 232, 228, 0.38) 0, rgba(246, 248, 247, 0) 22%), var(--canvas);
  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(52, 70, 168, 0.32);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

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

.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(145deg, #4552c7, #2d3b9b);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 32px rgba(52, 70, 168, 0.24);
}

.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(52, 70, 168, 0.08);
}

.icon-button.active,
.round-tool.active {
  color: var(--primary);
  background: rgba(52, 70, 168, 0.1);
}

.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: #303542;
  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(52, 70, 168, 0.07);
  color: var(--primary-ink);
}

.nav-item.active,
.history-item.active {
  background: #e8ebf7;
  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(52, 70, 168, 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;
  min-height: 100vh;
  padding: 18px clamp(18px, 4vw, 48px) 146px;
  background: var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 42px;
  padding: 2px 0 12px;
  background: linear-gradient(180deg, var(--canvas) 72%, rgba(246, 248, 247, 0));
}

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

.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-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;
}

.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(52, 70, 168, 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(52, 70, 168, 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(52, 70, 168, 0.08);
  border-color: rgba(52, 70, 168, 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;
}

.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.tool_completed .marker {
  background: var(--warning);
}

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

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

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

.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: #303542;
  font-weight: 760;
}

.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(52, 70, 168, 0.09);
  font-weight: 760;
}

.json-view {
  margin: 0;
  max-height: 429px;
  overflow: auto;
  padding: 14px;
  background: #fbfcff;
  color: #39405a;
  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;
}

/* ── 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(52, 70, 168, 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(52, 70, 168, 0.06);
}

.hub-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #4552c7, #2d3b9b);
  box-shadow: 0 10px 24px rgba(52, 70, 168, 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, #4552c7, #2d3b9b);
  color: #fff;
  box-shadow: 0 8px 20px rgba(52, 70, 168, 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 {
  border-color: rgba(16, 165, 139, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(32, 42, 39, 0.08);
}

.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-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(52, 70, 168, 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(52, 70, 168, 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-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, #dbeafe, #ecfdf5);
  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(52, 70, 168, 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-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(52, 70, 168, 0.1);
  overflow: hidden;
}

.hub-progress-bar-fill {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4552c7, #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;
}

.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(52, 70, 168, 0.28);
  background: #fff;
  color: var(--primary);
}

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

.composer-wrap {
  position: fixed;
  left: 256px;
  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;
}

.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: blur(18px);
  pointer-events: auto;
}

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);
}

.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;
}

.send-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: #9298b1;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(83, 90, 118, 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(52, 70, 168, 0.22);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  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-run-card {
    grid-template-columns: 1fr;
  }

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

  .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: 10px 14px 190px;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  .topbar {
    min-height: 34px;
  }

  .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;
  }
}
