:root {
  --ink: #1c2939;
  --muted: #718096;
  --line: #dce4ec;
  --panel: #fff;
  --soft: #f5f8fb;
  --accent: #1769aa;
  --accent-ink: #075a98;
  --good: #16866b;
  --warn: #b56c00;
  --bad: #c44747;
  --shadow: 0 10px 32px rgba(26, 48, 69, 0.09);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #edf3f6;
  color: var(--ink);
  font:
    14px/1.5 Inter,
    "Noto Sans SC",
    "Microsoft Yahei",
    system-ui,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-mark svg {
  width: 19px;
  height: 19px;
}
.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--side-width, 276px) minmax(380px, 1fr) var(--inspector-width, 345px);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.side,
.main,
.inspector {
  background: var(--panel);
  min-height: 0;
  min-width: 0;
}
.side {
  display: flex;
  flex-direction: column;
  position: relative;
}
.panel-resizer {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  width: 9px;
  margin-left: -4px;
  cursor: col-resize;
  touch-action: none;
}
.side-resizer {
  left: var(--side-width, 276px);
}
.inspector-resizer {
  right: var(--inspector-width, 345px);
  margin-left: 0;
  margin-right: -4px;
}
.shell.side-collapsed .side-resizer,
.shell.inspector-collapsed .inspector-resizer {
  display: none;
}
.panel-resizer:hover,
.panel-resizer:focus-visible {
  background: rgba(23, 105, 170, 0.2);
  outline: none;
}
body.resizing-panels,
body.resizing-panels * {
  cursor: col-resize !important;
  user-select: none !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 19px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.2px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(145deg, #0a80b8, #19528a);
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.3px;
}
.task-actions {
  display: flex;
  padding: 0 16px 13px;
}
.primary {
  background: var(--accent);
  color: #fff;
}
.button {
  border-radius: 7px;
  padding: 8px 11px;
  font-weight: 650;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button:active {
  transform: translateY(1px);
}
.button.secondary {
  background: #e8f1f7;
  color: var(--accent-ink);
}
.task-actions .button {
  flex: 1;
}
.task-label {
  padding: 10px 20px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.8px;
}
.task-list {
  overflow: auto;
  padding: 0 9px;
}
.task {
  position: relative;
  width: 100%;
  display: flex;
  text-align: left;
  gap: 9px;
  padding: 10px 10px;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}
.task:hover {
  background: #f0f6f9;
}
.task.selected {
  background: #e6f2f8;
}
.task-state {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  margin-top: 6px;
}
.task.active .task-state {
  background: var(--good);
  box-shadow: 0 0 0 3px #d9f2eb;
}
.task-title {
  min-width: 0;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.task-menu {
  margin-left: auto;
  padding: 3px 6px;
  color: var(--muted);
  font-size: 18px;
  background: transparent;
}
.settings-card {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  margin-top: auto;
}
.settings-card h3 {
  font-size: 12px;
  margin: 0 0 3px;
}
.settings-card p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}
.settings-card .button {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.main {
  display: flex;
  flex-direction: column;
  position: relative;
}
.topbar {
  height: 67px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 16px;
  margin: 0;
  max-width: 58%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-button.panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
}
.shell.side-collapsed {
  grid-template-columns: 0 minmax(380px, 1fr) 345px;
}
.shell.inspector-collapsed {
  grid-template-columns: 276px minmax(380px, 1fr) 0;
}
.shell.side-collapsed.inspector-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.shell.side-collapsed .side,
.shell.inspector-collapsed .inspector {
  visibility: hidden;
  overflow: hidden;
}
.drawer-backdrop {
  display: none;
}
.status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: #eaf1f6;
  color: #527086;
}
.status.running {
  background: #e2f1fb;
  color: #1769aa;
}
.status.completed {
  background: #e2f5ed;
  color: #157657;
}
.status.failed {
  background: #fce8e8;
  color: #a73333;
}
.topbar .spacer {
  flex: 1;
}
.icon-button {
  display: grid;
  place-items: center;
  padding: 7px;
  border-radius: 6px;
  background: transparent;
  color: #617387;
}
.icon-button:hover {
  background: #edf3f6;
}
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.mobile-only {
  display: none;
}
.drawer-close {
  position: absolute;
  top: 14px;
  right: 10px;
  z-index: 1;
}
.transcript {
  flex: 1;
  overflow: auto;
  padding: 27px clamp(20px, 5vw, 62px) 20px;
}
.welcome {
  max-width: 680px;
  margin: 9vh auto 0;
  text-align: center;
}
.welcome .orb {
  width: 64px;
  height: 64px;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #e5f2f7;
  color: #1769aa;
}
.welcome h2 {
  font-size: 24px;
  margin: 20px 0 8px;
}
.welcome p {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
}
.message {
  max-width: 760px;
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}
.message > div {
  min-width: 0;
}
.avatar {
  height: 32px;
  width: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e9f1f6;
  color: #416075;
}
.message.user .avatar {
  background: #ddecf8;
  color: #1769aa;
}
.bubble {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px 11px 11px 11px;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.markdown {
  overflow-wrap: anywhere;
  white-space: normal;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown > :last-child {
  margin-bottom: 0;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  line-height: 1.25;
  margin: 1.1em 0 0.5em;
}
.markdown h1 { font-size: 1.45em; }
.markdown h2 { font-size: 1.28em; }
.markdown h3 { font-size: 1.12em; }
.markdown blockquote {
  margin: 0.6em 0;
  padding: 0.1em 0.85em;
  border-left: 3px solid #8abddd;
  color: #456176;
}
.markdown ul,
.markdown ol {
  margin: 0.45em 0;
  padding-left: 1.5em;
}
.markdown li > ul,
.markdown li > ol {
  margin: 0.15em 0;
}
.markdown p {
  margin: 0.55em 0;
}
.markdown code {
  padding: 0.12em 0.32em;
  border-radius: 4px;
  background: #eaf1f5;
  font: 0.9em ui-monospace, SFMono-Regular, Consolas, monospace;
}
.markdown pre {
  max-width: 100%;
  overflow: auto;
  padding: 11px;
  border-radius: 7px;
  background: #182735;
  color: #eef5f8;
  white-space: pre;
}
.markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}
.markdown table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
  font-size: 0.92em;
}
.markdown th,
.markdown td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.markdown a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
}
.message.user .bubble {
  background: #f2f8fc;
  border-color: #d9eaf5;
}
.message-error {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 7px;
  font-size: 12px;
}
.message-error {
  border: 1px solid #f0c8c8;
  background: #fff4f4;
  color: #8c3434;
}
.message-error .button {
  justify-self: start;
}
.reasoning-block {
  margin: 0 0 8px;
  padding: 8px 11px;
  border-left: 3px solid #aebdca;
  border-radius: 6px;
  background: #f5f7f9;
  color: #617382;
  font-size: 12px;
}
.reasoning-block summary {
  cursor: pointer;
  color: #536a7a;
  font-weight: 600;
}
.reasoning-content {
  margin-top: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.stream-status {
  color: var(--muted);
}
.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: stream-cursor-pulse 0.9s steps(1, end) infinite;
}
@keyframes stream-cursor-pulse {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stream-cursor { animation: none; }
}
.message-meta {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px;
}
.timeline {
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  border-left: 3px solid #78b7d9;
  background: #f5fafc;
  border-radius: 5px;
  color: #36566c;
}
.timeline strong {
  font-size: 12px;
}
.composer-wrap {
  padding: 0 clamp(20px, 5vw, 62px) 23px;
}
.composer {
  max-width: 760px;
  margin: auto;
  border: 1px solid #c8d8e1;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 15px rgba(20, 53, 78, 0.08);
}
.composer textarea {
  display: block;
  border: 0;
  outline: 0;
  resize: none;
  width: 100%;
  min-height: 72px;
  padding: 13px 14px;
  color: var(--ink);
}
.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 12px 2px;
  border-bottom: 1px solid #edf1f3;
  background: #fbfcfd;
  overflow-x: auto;
}
.attachment-card {
  position: relative;
  min-width: 0;
  width: min(250px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #d6e1e6;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(36, 60, 74, .04);
}
.attachment-preview {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.attachment-preview:hover,
.attachment-preview:focus-visible {
  outline: 0;
}
.attachment-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #37718f;
  background: #eaf4f8;
}
.attachment-icon.is-image { color: #7a5ca5; background: #f1ebfa; }
.attachment-icon.is-pdf { color: #b34c4c; background: #fbeded; }
.attachment-icon.is-table { color: #387c5e; background: #eaf6ef; }
.attachment-icon.is-model { color: #8a671e; background: #fbf3df; }
.attachment-icon svg { width: 17px; height: 17px; }
.attachment-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.attachment-copy strong,
.attachment-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-copy strong { font-size: 11px; font-weight: 650; }
.attachment-copy small { color: var(--muted); font-size: 10px; }
.attachment-remove {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #82919a;
}
.attachment-remove:hover,
.attachment-remove:focus-visible { background: #edf2f4; color: #3e5664; outline: 0; }
.attachment-remove svg { width: 14px; height: 14px; }
.attachment-card.is-uploading { border-style: dashed; }
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}
.message-attachments .attachment-card {
  width: min(235px, 100%);
  padding: 6px 8px;
  box-shadow: none;
}
.uploading-icon { color: #37718f; background: #edf5f8; }
.attachment-progress {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #e3edf1;
}
.attachment-progress::after {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--accent);
  content: "";
  animation: attachment-progress 1.2s ease-in-out infinite;
}
@keyframes attachment-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(250%); }
}
.attachment-chip {
  min-width: 0;
  max-width: 180px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #d7e1e6;
  border-radius: 6px;
  background: #f6f9fa;
  color: #36566c;
  font-size: 11px;
}
.attachment-chip:hover,
.attachment-chip:focus-visible {
  border-color: #82abc1;
  background: #edf5f8;
}
.attachment-chip svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-file {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}
.compose-foot {
  display: flex;
  align-items: center;
  padding: 7px 8px 8px 14px;
  border-top: 1px solid #edf1f3;
  color: var(--muted);
  font-size: 11px;
}
.compose-foot > span {
  flex: 1;
}
.context-usage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 10px;
  white-space: nowrap;
  color: #6c8492;
  font-variant-numeric: tabular-nums;
}
.context-usage.warning { color: #b36a25; }
.context-usage-track {
  width: 42px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9ee;
}
.context-usage-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6e9bb2;
  transition: width .2s ease, background .2s ease;
}
.context-usage.warning .context-usage-track > span { background: #c57b32; }
.compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.thinking-picker {
  position: relative;
  min-width: 0;
}
.thinking-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(310px, 38vw);
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}
.thinking-toggle:hover:not(:disabled),
.thinking-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--soft);
}
.thinking-toggle:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .65;
}
.thinking-toggle > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thinking-level {
  color: var(--muted);
  white-space: nowrap;
}
.thinking-chevron {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.thinking-menu {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 7px);
  display: grid;
  min-width: 208px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}
.thinking-menu[hidden] {
  display: none;
}
.thinking-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 8px;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.thinking-option:hover,
.thinking-option:focus-visible,
.thinking-option[aria-checked="true"] {
  background: #edf5fa;
  color: var(--accent-ink);
}
.thinking-option small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.send {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 6px;
}
.send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.inspector {
  display: flex;
  flex-direction: column;
}
.inspector-head {
  display: flex;
  align-items: center;
  min-height: 67px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}
.inspector-head h2 {
  font-size: 14px;
  margin: 0;
}
.inspector-head .icon-button {
  margin-left: auto;
}
.inspect-scroll {
  overflow: auto;
  padding: 15px;
}
.section {
  margin-bottom: 22px;
}
.section h3 {
  margin: 0 0 9px;
  font-size: 11px;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.run-card,
.artifact {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
}
.run-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.run-actions .button {
  padding: 4px 7px;
  font-size: 11px;
}
.run-warning {
  margin-top: 9px;
  padding: 7px 8px;
  border-radius: 5px;
  background: #fff5df;
  color: #815700;
  font-size: 11px;
}
.run-details {
  margin-top: 9px;
  color: #4c6273;
  font-size: 12px;
}
.run-details summary {
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 650;
}
.run-details h4 {
  margin: 9px 0 3px;
  font-size: 11px;
}
.run-details pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 7px;
  border-radius: 5px;
  background: #f3f7f9;
  white-space: pre-wrap;
  word-break: break-word;
  font:
    11px/1.45 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.engine-badge {
  margin: -2px 0 9px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #fff3d9;
  color: #83580b;
  font-size: 11px;
  font-weight: 650;
}
.run-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.run-row span:first-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact {
  cursor: pointer;
}
.artifact:hover {
  border-color: #8abddd;
}
.artifact-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.gallery .artifact {
  padding: 5px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
  background: #eef4f7;
  border-radius: 5px;
}
.empty {
  padding: 14px;
  border: 1px dashed #cddbe3;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.modal {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 37, 53, 0.38);
  padding: 20px;
}
.modal.open {
  display: flex;
}
.dialog {
  width: min(540px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.dialog h2 {
  font-size: 18px;
  margin: 0 0 3px;
}
.dialog .hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.field {
  margin: 0 0 13px;
}
.field label {
  display: block;
  font-weight: 650;
  font-size: 12px;
  margin-bottom: 5px;
}
.field input,
.field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd9e1;
  border-radius: 6px;
  outline-color: var(--accent);
}
.key-row {
  display: flex;
  gap: 8px;
}
.key-row input {
  flex: 1;
}
.notice {
  padding: 9px 10px;
  border-radius: 6px;
  background: #fff5df;
  color: #815700;
  font-size: 12px;
  margin: 0 0 13px;
}
.notice.ok {
  background: #e6f5ed;
  color: #19684e;
}
.dialog-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  position: sticky;
  bottom: -22px;
  padding: 12px 0 0;
  background: white;
}
.dialog-foot .button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.dialog-foot .primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.button.danger {
  background: #fff0f0;
  border: 1px solid #d98484;
  color: #a33131;
}
.settings-dialog {
  width: min(760px, 100%);
}
.settings-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin: 0 0 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.settings-tab {
  flex: 1;
  padding: 8px 11px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.settings-tab[aria-selected="true"] {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(26, 48, 69, 0.12);
}
.archive-settings {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.archive-settings h3 {
  margin: 0 0 3px;
  font-size: 15px;
}
.archive-list {
  display: grid;
  gap: 8px;
}
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.archive-item > div:last-child {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.capability-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.capability-heading h3, .capability-form h3 { margin: 0 0 7px; font-size: 15px; }
.capability-heading .button { flex-shrink: 0; }
.capability-scope { margin: 0 0 16px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.capability-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.capability-toolbar input, .capability-toolbar select, .capability-form textarea {
  padding: 9px 10px; border: 1px solid #cbd9e1; border-radius: 6px; outline-color: var(--accent); background: white;
}
.capability-toolbar input { flex: 1; min-width: 0; }
.capability-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.capability-filters button { background: var(--soft); color: var(--muted); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
.capability-filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: white; }
.capability-filters span { margin-left: 4px; font-variant-numeric: tabular-nums; }
.capability-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.capability-info { flex: 1; min-width: 180px; display: grid; gap: 5px; }
.capability-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.capability-item strong { font-size: 13px; overflow-wrap: anywhere; }
.capability-badge { font-size: 10px; padding: 2px 6px; background: var(--soft); color: var(--muted); border-radius: 4px; }
.capability-item small, .capability-item summary { color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }
.capability-item p { margin: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.capability-item .capability-blocked { color: #815700; }
.capability-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.capability-actions .button { padding: 6px 9px; font-size: 11px; }
#settings-panel-capabilities button:disabled { opacity: 0.5; cursor: not-allowed; }
.capability-actions .status.active { background: #e6f5ed; color: #19684e; }
.capability-actions .status.disabled { color: var(--muted); background: var(--soft); }
.capability-form { margin-bottom: 18px; padding: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.capability-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.capability-form-grid > * { min-width: 0; }
.capability-form textarea { width: 100%; resize: vertical; font-family: monospace; }
.capability-form summary { cursor: pointer; margin-bottom: 10px; font-size: 12px; }
.capability-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.capability-confirm { flex-basis: 100%; padding: 12px; background: #fff5df; border-radius: 6px; }
.capability-confirm p { margin-bottom: 10px; }
.archive-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 600px) {
  .capability-toolbar { flex-wrap: wrap; }
  .capability-toolbar input { flex-basis: 100%; }
  .capability-toolbar select { flex: 1; min-width: 0; }
  .capability-form-grid { grid-template-columns: 1fr; }
  .capability-info { flex-basis: 100%; min-width: 0; }
  .archive-item { align-items: flex-start; flex-direction: column; }
  .archive-item > div:last-child { justify-content: flex-start; }
  .dialog { padding: 16px; }
  .dialog-foot { flex-wrap: wrap; bottom: -16px; }
  .compose-foot { align-items: flex-end; gap: 6px; }
  .compose-foot > span { display: none; }
  .compose-actions { flex: 1; justify-content: flex-end; }
  .thinking-toggle { max-width: min(62vw, 260px); }
}
.toast {
  position: fixed;
  z-index: 9;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 14px;
  border-radius: 7px;
  background: #263b4c;
  color: #fff;
  box-shadow: var(--shadow);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: var(--side-width, 250px) minmax(360px, 1fr);
  }
  .inspector {
    position: fixed;
    z-index: 4;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(360px, 92vw);
    box-shadow: var(--shadow);
    transform: translateX(104%);
    transition: transform 0.2s;
  }
  .inspector.open {
    transform: none;
  }
  .shell.inspector-collapsed {
    grid-template-columns: var(--side-width, 250px) minmax(360px, 1fr);
  }
  .shell.side-collapsed,
  .shell.side-collapsed.inspector-collapsed {
    grid-template-columns: 0 minmax(360px, 1fr);
  }
  .shell.side-collapsed .side {
    visibility: hidden;
  }
  .inspector-resizer {
    display: none;
  }
  .drawer-backdrop:not([hidden]) {
    position: fixed;
    z-index: 3;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(17, 37, 53, 0.3);
  }
  .mobile-only {
    display: grid;
  }
  .side .drawer-close {
    display: none;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .side {
    position: fixed;
    z-index: 4;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(292px, 88vw);
    box-shadow: var(--shadow);
    transform: translateX(-104%);
    transition: transform 0.2s;
  }
  .panel-resizer {
    display: none;
  }
  .side.open {
    transform: none;
  }
  .main {
    height: 100vh;
  }
  .topbar {
    padding: 0 12px;
  }
  .transcript {
    padding: 18px 14px;
  }
  .composer-wrap {
    padding: 0 14px 15px;
  }
  .topbar h1 {
    max-width: 44%;
  }
  .panel-toggle span {
    display: none;
  }
  .side .drawer-close {
    display: grid;
  }
}

/* The right side is a persistent document workspace. */
[hidden] {
  display: none !important;
}
.workspace-head {
  min-height: 67px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.workspace-head > div {
  min-width: 0;
  flex: 1;
}
.workspace-head h2,
.workspace-head p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-head h2 {
  font-size: 13px;
}
.workspace-head p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}
.workspace-download,
.workspace-upload {
  flex: 0 0 auto;
}
.workspace-download {
  text-decoration: none;
}
.workspace-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 41px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.workspace-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.workspace-tabs button[aria-selected="true"] {
  color: var(--ink);
}
.workspace-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 28%;
  bottom: -1px;
  left: 28%;
  height: 2px;
  background: var(--accent);
  content: "";
}
.inspect-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: #fff;
}
.workspace-context {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 14px;
  border-bottom: 1px solid #edf1f3;
  color: #536678;
  font-size: 11px;
}
.context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}
.context-dot.synthetic {
  background: #c17a10;
}
.workspace-section {
  padding: 13px 0 4px;
}
.workspace-section > h3 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0 14px 8px;
  color: #5d6f7d;
  font-size: 11px;
  font-weight: 700;
}
.workspace-section > h3 span {
  font-weight: 500;
}
.workspace-file-group {
  margin: 6px 10px;
  border: 1px solid #e0e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.workspace-file-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  background: #f8fafb;
}
.workspace-file-group > summary::-webkit-details-marker {
  display: none;
}
.workspace-file-group > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-right: 1.5px solid #647887;
  border-bottom: 1.5px solid #647887;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.workspace-file-group[open] > summary::before {
  transform: rotate(45deg);
}
.workspace-file-group > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.file-group-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 5px 8px;
}
.file-group-title {
  font-size: 12px;
  font-weight: 700;
}
.file-group-heading > small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 10px;
}
.file-group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.file-group-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.workspace-file-group.is-final {
  border-color: #b7ceef;
}
.workspace-file-group.is-final > summary {
  background: #edf4ff;
  color: #2457a7;
}
.file-group-badge.is-final {
  color: #244f97;
  background: #dce8fc;
}
.workspace-file-group.is-feasible {
  border-color: #acd8c8;
}
.workspace-file-group.is-feasible > summary {
  background: #eef9f4;
  color: #17694f;
}
.file-group-badge.is-feasible {
  color: #17694f;
  background: #d7efe3;
}
.file-group-content {
  border-top: 1px solid #e0e7eb;
}
.workspace-file {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.workspace-file:hover,
.workspace-file:focus-visible {
  border-color: #e6ecef;
  background: #f4f7f8;
  outline: 0;
}
.workspace-file > span:nth-child(2) {
  min-width: 0;
}
.workspace-file strong,
.workspace-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-file strong {
  font-size: 12px;
}
.workspace-file small,
.file-run {
  color: var(--muted);
  font-size: 10px;
}
.file-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e1e6;
  border-radius: 6px;
  color: #42657d;
  background: #f7fafb;
}
.workspace-empty,
.workspace-loading {
  margin: 18px 14px;
  padding: 20px 14px;
  border: 1px dashed #cad5dc;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.workspace-more {
  width: calc(100% - 28px);
  margin: 7px 14px 14px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #536678;
}
.workspace-preview {
  min-height: 100%;
  background: #f4f6f7;
}
.image-preview {
  display: grid;
  place-items: start center;
  padding: 16px;
  overflow: auto;
}
.image-preview img {
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(27, 45, 58, 0.12);
}
.code-preview pre {
  min-width: min-content;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #253847;
  white-space: pre;
  font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.table-preview {
  overflow: auto;
  padding: 12px;
}
.table-preview table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 11px;
}
.table-preview th,
.table-preview td {
  padding: 7px 9px;
  border: 1px solid #dce4e8;
  text-align: left;
  white-space: nowrap;
}
.table-preview th {
  position: sticky;
  top: 0;
  background: #edf2f4;
}
.workspace-pdf {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 108px);
  border: 0;
  background: #e9edef;
}
.model-preview {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 67px);
  display: grid;
  grid-template-rows: 42px minmax(360px, 1fr);
  overflow: hidden;
  background: #f1f4f5;
}
.model-toolbar {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 5px 8px;
  border-bottom: 1px solid #d9e1e5;
  background: rgba(251, 252, 253, 0.96);
}
.model-toolbar .icon-button {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
}
.model-toolbar .icon-button[aria-pressed="true"] {
  background: #dcebf2;
  color: #225f7f;
}
.model-status {
  min-width: 0;
  margin-left: 5px;
  overflow: hidden;
  color: #617582;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-status.error {
  color: #a73333;
}
.model-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.model-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
}
.unsupported-preview {
  min-height: calc(100vh - 108px);
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  color: #526573;
  text-align: center;
}
.unsupported-preview > svg {
  width: 38px;
  height: 38px;
  color: #69869a;
}
.unsupported-preview h3 {
  max-width: 100%;
  margin: 14px 0 2px;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.unsupported-preview p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.unsupported-preview .button {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.activity-list {
  position: relative;
}
.activity-row,
.workflow-run {
  position: relative;
  min-height: 50px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 7px 14px;
}
.workflow-run {
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
}
.activity-row::before,
.workflow-run::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 1px;
  background: #dfe6ea;
  content: "";
}
.activity-marker {
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4282a9;
  box-shadow: 0 0 0 1px #9ab5c5;
}
.activity-row strong,
.activity-row small,
.workflow-run strong,
.workflow-run small {
  display: block;
}
.activity-row strong,
.workflow-run strong {
  font-size: 11px;
}
.activity-row small,
.workflow-run small,
.activity-row time {
  color: var(--muted);
  font-size: 10px;
}
.activity-row small {
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.activity-row time {
  white-space: nowrap;
}
.output-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-outputs {
  max-width: 1100px;
}
.timeseries-panel {
  border: 1px solid #d6e1e9;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  font-size: 12px;
}
.timeseries-panel [hidden] {
  display: none !important;
}
.series-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: #f3f8fc;
  border-bottom: 1px solid #e3ebf1;
}
.series-header h3 {
  margin: 0 0 3px;
  color: #244e6b;
  font-size: 16px;
}
.series-header p {
  margin: 0;
  color: #63798b;
  font-size: 11px;
}
.series-run-label {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  color: #53697c;
  font-size: 11px;
}
.timeseries-panel select,
.timeseries-panel input[type="number"],
.timeseries-panel input[type="search"] {
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #cddbe5;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.series-run-label select {
  width: 240px;
}
.series-picker {
  margin: 12px 16px;
}
.series-picker > summary {
  cursor: pointer;
  font-weight: 600;
  color: #38576f;
}
.series-picker > summary span {
  margin-left: 8px;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}
.series-search {
  display: flex;
  gap: 8px;
  margin: 10px 0 8px;
}
.series-search input {
  flex: 1;
}
.timeseries-panel .button {
  font-size: 11px;
  padding: 6px 9px;
  white-space: nowrap;
}
.series-variables {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  max-height: 132px;
  overflow: auto;
  padding: 2px;
}
.series-variable {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid #dee7ed;
  border-radius: 6px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.series-variable.selected {
  border-color: #9dbedb;
  background: #edf5fc;
  color: #155c93;
}
.series-variable input {
  accent-color: var(--accent);
}
.series-variable small,
.series-picker-hint {
  color: var(--muted);
  font-size: 10px;
}
.series-picker-hint {
  margin: 8px 0;
}
.series-range,
.series-playback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
}
.series-range label,
.series-playback label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #63798b;
  font-size: 11px;
}
.series-range input {
  width: 90px;
}
.series-playback input[type="range"] {
  flex: 1 1 120px;
  min-width: 80px;
  accent-color: var(--accent);
}
.series-playback output {
  font-variant-numeric: tabular-nums;
  color: #38576f;
  font-size: 11px;
}
.series-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
.series-chart {
  --series-color: #1769aa;
  min-width: 0;
  border: 1px solid #e0e8ee;
  border-radius: 8px;
  background: #fcfdff;
  overflow: hidden;
}
.series-chart:nth-child(6n + 2) { --series-color: #16866b; }
.series-chart:nth-child(6n + 3) { --series-color: #a44ba2; }
.series-chart:nth-child(6n + 4) { --series-color: #c26d15; }
.series-chart:nth-child(6n + 5) { --series-color: #5866bc; }
.series-chart:nth-child(6n + 6) { --series-color: #b54e64; }
.series-chart > header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px 12px 4px;
  color: var(--series-color);
}
.series-chart strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.series-chart small {
  font-size: 10px;
  font-weight: 400;
}
.series-chart output {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.series-chart svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  stroke: none;
}
.series-chart svg text {
  fill: #6b7e8e;
  font-size: 16px;
}
.series-grid-line {
  stroke: #e5edf3;
  stroke-width: 1;
}
.series-line {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.series-time-line {
  stroke: #8ca0b1;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.series-dot {
  fill: var(--series-color);
  stroke: white;
  stroke-width: 1.5;
}
.series-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 10px;
}
.series-source {
  background: none;
  color: var(--accent);
  font-size: 11px;
}
.series-status,
.series-empty {
  padding: 16px;
  color: var(--muted);
}
.series-status .button {
  margin-left: 10px;
}
.series-fallback {
  margin-top: 12px;
}
.output-link {
  max-width: 230px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #cedae1;
  border-radius: 6px;
  background: #f8fafb;
  color: #31566e;
}
.output-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.decision-card {
  padding: 13px;
  border: 1px solid #d6dfe4;
  border-radius: 7px;
  background: #fff;
}
.decision-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
}
.decision-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.decision-custom input {
  flex: 1;
  min-width: 120px;
  padding: 8px;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
}
.decision-options {
  display: grid;
  gap: 6px;
}
.decision-option {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f8fafb;
  color: var(--ink);
  text-align: left;
}
.decision-option:hover,
.decision-option:focus-visible {
  border-color: #75a6c2;
  background: #edf5f8;
  outline: 0;
}
.decision-option strong,
.decision-option span {
  display: block;
}
.decision-option span,
.decision-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1050px) {
  .inspector {
    width: min(620px, 94vw);
  }
}

.stop-task { flex-shrink: 0; white-space: nowrap; }
.phase-summary { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.phase-summary summary { cursor: pointer; font-weight: 600; }
.phase-summary .markdown { overflow-wrap: anywhere; }

.topbar .status { flex-shrink: 0; white-space: nowrap; }
.topbar h1 { min-width: 0; flex: 1; }
