:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-muted: #f0f2f1;
  --surface-strong: #e7ebe9;
  --sidebar: #171918;
  --sidebar-muted: #a7ada9;
  --ink: #1f2422;
  --muted: #68716d;
  --faint: #8b9490;
  --line: #d9dfdc;
  --line-strong: #c7cfcb;
  --teal: #0b7f6d;
  --teal-soft: #e3f3ef;
  --amber: #94610d;
  --amber-soft: #fff3d8;
  --red: #b1413d;
  --red-soft: #fbe8e6;
  --blue: #356a9d;
  --blue-soft: #eaf1f8;
  --shadow: 0 10px 28px rgba(28, 35, 32, 0.11);
  --sidebar-width: 252px;
  --activity-width: 336px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  font-size: 14px;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--activity-width);
  width: 100%;
  height: 100vh;
}

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  color: #f3f5f4;
  background: var(--sidebar);
  border-right: 1px solid #292d2b;
}

.sidebar-top {
  padding: 14px 12px 8px;
}

.brand-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 4px 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: 6px;
  font: 700 11px/1 Consolas, monospace;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 6px;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(127, 137, 132, 0.13);
}

.sidebar-close,
.sidebar-open {
  display: none;
}

.new-task-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #f8faf9;
  background: #262a28;
  border: 1px solid #353a37;
  border-radius: 7px;
}

.new-task-button:hover {
  background: #303532;
}

.new-task-button > span {
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.new-task-button strong {
  font-size: 13px;
  font-weight: 600;
}

.primary-nav {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #c7cdca;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: #262a28;
}

.nav-item small {
  color: #8f9893;
  font-size: 11px;
}

.nav-symbol {
  color: #9da6a1;
  font: 600 14px/1 Consolas, monospace;
  text-align: center;
}

.history-section {
  min-height: 0;
  flex: 1;
  padding: 12px;
  overflow: hidden;
  border-top: 1px solid #282c2a;
}

.history-section > header {
  display: flex;
  height: 32px;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: #8f9893;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-section > header .icon-button {
  width: 28px;
  height: 28px;
}

.history-section-mark {
  color: #69716d;
  font: 700 8px/1 Consolas, monospace;
}

.history-list {
  display: grid;
  max-height: calc(100vh - 322px);
  gap: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #474d49 transparent;
}

.history-item {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  color: #d4d9d6;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.history-item:hover,
.history-item.active {
  color: #ffffff;
  background: #252927;
}

.history-title {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  color: #8f9893;
  font-size: 10px;
}

.sidebar-bottom {
  padding: 10px 12px 14px;
  border-top: 1px solid #292d2b;
}

.sample-link {
  display: grid;
  width: 100%;
  grid-template-columns: 30px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  color: #e1e6e3;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.sample-link:hover {
  background: #252927;
}

.sample-glyph {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #17372f;
  background: #c9e8df;
  border-radius: 5px;
  font: 700 12px/1 Consolas, monospace;
}

.sample-link > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.sample-link strong {
  font-size: 11px;
}

.sample-link small {
  color: #8f9893;
  font-size: 9px;
}

.server-state {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 10px 8px 0;
  border-top: 1px solid #292d2b;
}

.server-state > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.server-state strong {
  overflow: hidden;
  color: #e7ebe9;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-state small {
  color: #858e89;
  font-size: 9px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #8e9692;
  border-radius: 50%;
}

.status-dot.online {
  background: #21a17d;
  box-shadow: 0 0 0 3px rgba(33, 161, 125, 0.12);
}

.status-dot.running {
  background: #c88719;
  box-shadow: 0 0 0 3px rgba(200, 135, 25, 0.14);
  animation: pulse 1.35s ease-in-out infinite;
}

.status-dot.done {
  background: var(--teal);
}

.status-dot.failed {
  background: var(--red);
}

@keyframes pulse {
  50% { opacity: 0.42; }
}

.chat-workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.chat-header {
  display: flex;
  height: 60px;
  flex: 0 0 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.chat-title-row,
.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.chat-title-row > div {
  min-width: 0;
}

.chat-header h1 {
  max-width: 52vw;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.header-chip {
  display: flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.header-chip:hover {
  border-color: var(--line-strong);
}

.session-exit-form {
  flex: 0 0 auto;
  margin: 0;
}

.session-exit {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.session-exit:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line);
}

.conversation-layout {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.conversation {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7cfcb transparent;
}

.conversation-inner {
  width: min(880px, calc(100% - 40px));
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 0 150px;
}

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
}

.message + .message {
  border-top: 1px solid #edf0ee;
}

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.agent-avatar {
  color: #ffffff;
  background: var(--teal);
  font-family: Consolas, monospace;
}

.agent-avatar.live {
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.user-avatar {
  color: #313633;
  background: #e6e9e7;
}

.message-body {
  min-width: 0;
}

.message-meta {
  display: flex;
  min-height: 22px;
  align-items: center;
  gap: 8px;
}

.message-meta strong {
  font-size: 13px;
}

.message-meta > span:not(.agent-state) {
  color: var(--faint);
  font-size: 10px;
}

.message-copy {
  color: #313734;
  font-size: 14px;
  line-height: 1.75;
}

.message-copy p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

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

.case-loader {
  display: grid;
  min-width: min(330px, 100%);
  min-height: 48px;
  gap: 3px;
  padding: 6px 9px;
  background: #f7f9f8;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.case-loader > span {
  color: var(--faint);
  font: 700 8px/1.2 Consolas, monospace;
}

.case-loader select {
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: 600 11px/1.3 "Microsoft YaHei UI", sans-serif;
}

.starter-actions button,
.compact-button {
  min-height: 32px;
  padding: 0 11px;
  color: #38403c;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 11px;
}

.starter-actions button:hover,
.compact-button:hover {
  background: var(--surface-muted);
}

.message-attachment {
  display: grid;
  width: min(360px, 100%);
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.message-attachment > span:last-child,
.attachment-chip > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.message-attachment strong,
.attachment-chip strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment small,
.attachment-chip small {
  color: var(--muted);
  font-size: 9px;
}

.file-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #315d51;
  background: #dcedE8;
  border-radius: 5px;
  font: 700 8px/1 Consolas, monospace;
}

.agent-state {
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
}

.agent-state.running {
  color: var(--amber);
  background: var(--amber-soft);
}

.agent-state.done {
  color: var(--teal);
  background: var(--teal-soft);
}

.agent-state.failed {
  color: var(--red);
  background: var(--red-soft);
}

.agent-response {
  margin: 7px 0 16px;
  color: #303633;
  font-size: 13px;
  line-height: 1.7;
}

.agent-response p {
  margin: 0;
}

.run-overview {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.75fr 0.75fr;
  margin: 0 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.run-overview > div {
  display: flex;
  min-height: 52px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
}

.run-overview > div:first-child {
  padding-left: 0;
}

.run-overview > div:last-child {
  border-right: 0;
}

.run-overview span,
.result-grid span,
.check-strip span,
.simulation-summary span {
  color: var(--faint);
  font-size: 9px;
  text-transform: uppercase;
}

.run-overview strong {
  overflow: hidden;
  font: 600 11px/1.3 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-steps {
  display: grid;
  gap: 7px;
}

.agent-step {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.agent-step.running {
  border-color: #d7b470;
  box-shadow: 0 0 0 2px rgba(202, 145, 36, 0.09);
}

.agent-step.done {
  border-color: #a9d0c6;
}

.agent-step.failed {
  border-color: #e1aaa6;
}

.step-trigger {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 30px minmax(0, 1fr) minmax(118px, auto) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.step-trigger:hover {
  background: #f7f9f8;
}

.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font: 600 10px/1 Consolas, monospace;
}

.agent-step.running .step-index {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #e6c98f;
}

.agent-step.done .step-index {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #b7dbd2;
}

.agent-step.failed .step-index {
  color: var(--red);
  background: var(--red-soft);
  border-color: #e7b9b5;
}

.step-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.step-heading strong {
  font-size: 12px;
  font-weight: 650;
}

.step-heading small {
  overflow: hidden;
  color: var(--muted);
  font: 9px/1.35 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-compact-metrics {
  display: flex;
  min-width: 118px;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--muted);
  font: 600 9px/1.3 Consolas, monospace;
  white-space: nowrap;
}

.step-compact-metrics i {
  color: var(--line-strong);
  font-style: normal;
}

.step-status {
  min-width: 58px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
  text-align: right;
}

.agent-step.running .step-status { color: var(--amber); }
.agent-step.done .step-status { color: var(--teal); }
.agent-step.failed .step-status { color: var(--red); }

.step-chevron {
  color: var(--faint);
  font-size: 16px;
  text-align: center;
}

.step-content {
  display: none;
  padding: 0 13px 14px 52px;
  border-top: 1px solid #edf0ee;
}

.agent-step.expanded .step-content {
  display: block;
}

.call-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: #37403c;
}

.call-line > span {
  color: var(--teal);
  font: 700 9px/1 Consolas, monospace;
}

.call-line strong {
  overflow: hidden;
  font: 600 10px/1.4 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-line small {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.step-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.step-metrics > div {
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
}

.step-metrics > div:last-child {
  border-right: 0;
}

.step-metrics span {
  color: var(--faint);
  font-size: 9px;
  text-transform: uppercase;
}

.step-metrics strong {
  overflow: hidden;
  font: 650 11px/1.3 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-metrics small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-grid,
.check-strip,
.simulation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
}

.result-grid > div,
.check-strip > div,
.simulation-summary > div {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
}

.result-grid > div:last-child,
.check-strip > div:last-child,
.simulation-summary > div:last-child {
  border-right: 0;
}

.result-grid strong,
.check-strip strong,
.simulation-summary strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.case-provenance {
  margin: 10px 0 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.case-provenance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.case-provenance-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.case-provenance-heading span,
.case-source-grid > a > span {
  color: var(--teal);
  font: 700 8px/1 Consolas, monospace;
}

.case-provenance-heading strong {
  font-size: 12px;
}

.verified-source {
  flex: 0 0 auto;
  padding: 5px 7px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid #b9dcd3;
  border-radius: 3px;
  font-size: 8px !important;
}

.case-source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
}

.case-source-grid > a {
  display: flex;
  min-width: 0;
  min-height: 72px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
  border-right: 1px solid var(--line);
}

.case-source-grid > a:last-child { border-right: 0; }
.case-source-grid > a:hover { background: #f4f8f6; }
.case-source-grid strong { font-size: 10px; }
.case-source-grid small {
  overflow: hidden;
  color: var(--muted);
  font: 8px/1.4 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.paper-overlap a,
.paper-overlap > span {
  padding: 5px 7px;
  color: var(--ink-soft);
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
  line-height: 1.35;
  text-decoration: none;
}

.paper-overlap a:hover {
  color: var(--teal);
  border-color: #a9cec4;
}

.source-discrepancies {
  margin-top: 8px;
  border-left: 3px solid var(--amber);
}

.source-discrepancies > div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  color: #4d3a1c;
  background: #fff7e7;
}

.source-discrepancies strong { font-size: 9px; }
.source-discrepancies span { font-size: 9px; line-height: 1.45; }
.source-discrepancies small { color: #7c6339; font-size: 8px; line-height: 1.45; }

.case-provenance > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.stage-rationale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 9px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stage-rationale > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px 8px 0;
}

.stage-rationale > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.stage-rationale span {
  color: var(--teal);
  font: 700 8px/1.5 Consolas, monospace;
}

.stage-rationale p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.pass { color: var(--teal) !important; }
.fail { color: var(--red) !important; }
.warn { color: var(--amber) !important; }

.stage-summary,
.method-note {
  margin: 0 0 10px;
  padding: 9px 10px;
  color: #39423e;
  background: #f4f7f5;
  border-left: 3px solid var(--teal);
  font-size: 11px;
  line-height: 1.6;
}

.intent-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.intent-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.intent-item:last-child {
  border-bottom: 0;
}

.intent-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: #274d44;
  font: 600 10px/1.5 Consolas, monospace;
}

.scenario-id {
  padding: 3px 5px;
  color: var(--blue);
  background: #eef5fa;
  border: 1px solid #c9dce9;
  border-radius: 3px;
  font: 700 8px/1 Consolas, monospace;
}

.intent-name code {
  overflow-wrap: anywhere;
}

.intent-details {
  display: grid;
  gap: 6px;
}

.intent-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  font-size: 10px;
  line-height: 1.5;
}

.intent-row > span:first-child {
  color: var(--faint);
}

.intent-row code {
  color: #35403b;
  font-family: Consolas, monospace;
  white-space: pre-wrap;
}

.intent-row.evidence code {
  color: var(--blue);
}

.intent-row.evidence {
  align-items: start;
}

.citation-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-citation {
  position: relative;
  display: grid;
  min-width: min(250px, 100%);
  max-width: 440px;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 7px 30px 7px 9px;
  color: #2f3934;
  background: #f6f8f7;
  border: 1px solid #cfd8d3;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.spec-citation:hover,
.spec-citation:focus-visible {
  background: #edf5f2;
  border-color: #7fb3a5;
  outline: 0;
}

.spec-citation > span {
  color: var(--teal);
  font: 700 8px/1.25 Consolas, monospace;
}

.spec-citation > strong {
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.35;
}

.spec-citation > small {
  overflow-wrap: anywhere;
  color: var(--faint);
  font: 8px/1.35 Consolas, monospace;
}

.spec-citation > i {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--teal);
  font: normal 12px/1 Arial, sans-serif;
  transform: translateY(-50%);
}

.evidence-block {
  margin-top: 10px;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.evidence-block summary {
  padding: 10px 2px 3px;
  color: #4d5853;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  list-style-position: inside;
}

pre {
  max-width: 100%;
  margin: 8px 0 0;
  overflow: auto;
  color: #dfe8e3;
  background: #1e2321;
  border-radius: 6px;
  font: 10px/1.62 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: #5d6863 #252b28;
}

.evidence-block > pre,
.tab-panel {
  max-height: 330px;
  padding: 12px;
}

.code-header {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  color: #3b4540;
  background: #eef2f0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.code-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-header span {
  color: var(--teal);
  font: 700 9px/1 Consolas, monospace;
}

.code-header strong {
  font-size: 10px;
}

.compact-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 9px;
}

.code-view {
  max-height: 390px;
  min-height: 170px;
  margin: 0;
  padding: 13px;
  border-radius: 0 0 6px 6px;
  white-space: pre;
}

.detail-tabs {
  margin-top: 7px;
}

.tab-buttons {
  display: flex;
  min-height: 34px;
  align-items: flex-end;
  gap: 2px;
  padding: 0 5px;
  background: #eef2f0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.tab-buttons button {
  height: 30px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: 600 9px/1 Consolas, monospace;
}

.tab-buttons button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.tab-panel {
  min-height: 140px;
  margin: 0;
  border-radius: 0 0 6px 6px;
}

.mapping-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.adapter-audit {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  margin: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.adapter-audit > div:first-child {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
}

.adapter-audit > div:first-child span {
  color: var(--faint);
  font: 700 8px/1 Consolas, monospace;
}

.adapter-audit > div:first-child strong {
  font: 700 17px/1 Consolas, monospace;
}

.adapter-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adapter-checks > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.adapter-checks > div:last-child { border-right: 0; }
.adapter-checks strong { font: 700 8px/1 Consolas, monospace; }
.adapter-checks span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.adapter-checks > p { align-self: center; margin: 0; padding: 10px; color: var(--muted); font-size: 9px; }

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.mapping-table th,
.mapping-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.mapping-table th {
  color: var(--muted);
  background: #f3f6f4;
  font: 600 9px/1.3 Consolas, monospace;
}

.mapping-table td {
  font-family: Consolas, monospace;
}

.mapping-table tr:last-child td {
  border-bottom: 0;
}

.checker-token-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 10px;
  background: #f4f7f5;
  border-left: 3px solid var(--teal);
}

.checker-token-note > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.checker-token-note strong {
  font-size: 10px;
}

.checker-token-note small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.zero-token-badge,
.repair-state {
  padding: 5px 7px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid #b9dcd3;
  border-radius: 3px;
  font: 700 8px/1 Consolas, monospace;
  white-space: nowrap;
}

.repair-state.repaired {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #e8ce9b;
}

.stimulus-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr) auto) minmax(82px, 1fr);
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.baseline-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.baseline-evidence > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.baseline-evidence > div:first-child span {
  color: var(--blue);
  font: 700 8px/1 Consolas, monospace;
}

.baseline-evidence > div:first-child strong { font-size: 10px; }

.baseline-evidence > a {
  color: var(--blue);
  font: 600 9px/1.3 Consolas, monospace;
  text-decoration: none;
}

.baseline-scenarios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.baseline-scenarios > div {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 9px 46px 9px 10px;
  border-right: 1px solid var(--line);
}

.baseline-scenarios > div:last-child { border-right: 0; }
.baseline-scenarios strong { color: var(--blue); font: 700 8px/1 Consolas, monospace; }
.baseline-scenarios span { font: 9px/1.4 Consolas, monospace; }
.baseline-scenarios small { color: var(--muted); font-size: 8px; }
.baseline-scenarios b { position: absolute; top: 10px; right: 10px; font: 700 8px/1 Consolas, monospace; }

.evidence-dashboard {
  padding: 13px 0 4px;
  border-bottom: 1px solid var(--line);
}

.evidence-dashboard-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.evidence-dashboard-heading > span {
  color: var(--teal);
  font: 700 9px/1 Consolas, monospace;
}

.evidence-dashboard-heading > div { display: flex; flex-direction: column; gap: 3px; }
.evidence-dashboard-heading strong { font-size: 10px; }
.evidence-dashboard-heading small { color: var(--muted); font-size: 8px; }

.coverage-panel {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.coverage-score {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.coverage-score strong { color: var(--teal); font: 700 24px/1 Consolas, monospace; }
.coverage-score span { color: var(--muted); font-size: 8px; }

.coverage-bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coverage-bins > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.coverage-bins > div:nth-child(2n) { border-right: 0; }
.coverage-bins > div:nth-last-child(-n+2) { border-bottom: 0; }
.coverage-bins strong { font: 700 8px/1.3 Consolas, monospace; }
.coverage-bins small { color: var(--muted); font: 8px/1.3 Consolas, monospace; }
.coverage-bins .covered strong::before { margin-right: 5px; color: var(--teal); content: "PASS"; }

.industrial-flow {
  display: grid;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.industrial-flow > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.industrial-flow > div > span { color: var(--faint); font: 700 8px/1 Consolas, monospace; }
.industrial-flow > div > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.industrial-flow strong { font-size: 9px; }
.industrial-flow small { color: var(--muted); font-size: 8px; }
.industrial-flow b { color: var(--teal); font: 700 8px/1.3 Consolas, monospace; text-align: right; }

.limitations-panel {
  margin-top: 10px;
  padding: 10px;
  background: #fbf7ef;
  border-left: 3px solid var(--amber);
}

.limitations-panel > strong { font-size: 9px; }
.limitations-panel ul { margin: 6px 0 0; padding-left: 16px; }
.limitations-panel li { margin: 3px 0; color: #5b5447; font-size: 9px; line-height: 1.5; }

.stimulus-chain > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
}

.stimulus-chain > div > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
  font: 700 8px/1 Consolas, monospace;
  grid-row: 1 / 3;
}

.stimulus-chain strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stimulus-chain small {
  overflow: hidden;
  color: var(--faint);
  font: 8px/1.35 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stimulus-chain > i {
  color: var(--line-strong);
  font-style: normal;
  font-size: 12px;
}

.simulation-explorer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.simulation-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
}

.simulation-toolbar > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.simulation-toolbar strong {
  font-size: 10px;
}

.simulation-toolbar small {
  color: var(--muted);
  font: 8px/1.4 Consolas, monospace;
}

.seed-segment {
  display: inline-grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 1fr);
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.seed-segment button {
  min-width: 62px;
  height: 27px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font: 600 8px/1 Consolas, monospace;
}

.seed-segment button.active {
  color: #ffffff;
  background: var(--teal);
}

.stimulus-plan-section,
.waveform-section {
  padding: 11px 0 13px;
  border-top: 1px solid var(--line);
}

.simulation-section-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.simulation-section-heading > span {
  color: var(--teal);
  font: 700 9px/1 Consolas, monospace;
}

.simulation-section-heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.simulation-section-heading strong {
  font-size: 10px;
}

.simulation-section-heading small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.stimulus-plan {
  border-top: 1px solid var(--line);
}

.stimulus-plan > p,
.waveform-scroll > p {
  margin: 0;
  padding: 18px 10px;
  color: var(--faint);
  font-size: 9px;
}

.stimulus-row {
  display: grid;
  grid-template-columns: 22px minmax(116px, 0.75fr) minmax(170px, 1.2fr) minmax(190px, 1.35fr);
  align-items: start;
  gap: 9px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.stimulus-row:last-child {
  border-bottom: 0;
}

.stimulus-row > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  border-radius: 50%;
  font: 600 8px/1 Consolas, monospace;
}

.stimulus-action,
.stimulus-effect,
.stimulus-expected {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.stimulus-action strong,
.stimulus-effect strong,
.stimulus-expected strong {
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.stimulus-action > span,
.stimulus-effect > span,
.stimulus-expected > span {
  color: #37423d;
  font-size: 9px;
  line-height: 1.5;
}

.stimulus-action code {
  color: var(--blue);
  font: 8px/1.45 Consolas, monospace;
  word-break: break-word;
}

.stimulus-expected > span {
  color: #285448;
}

.waveform-scroll {
  min-height: 380px;
  overflow-x: auto;
  color: #dbe6e1;
  background: #111715;
  border: 1px solid #29332f;
  border-radius: 5px;
  scrollbar-width: thin;
  scrollbar-color: #55645e #18201d;
}

.waveform-scroll svg {
  display: block;
  width: 100%;
  min-width: 880px;
  height: auto;
}

.waveform-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  padding: 8px 2px 0;
  color: var(--muted);
  font-size: 8px;
}

.waveform-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.waveform-legend b {
  font-weight: 400;
}

.waveform-legend i {
  width: 14px;
  height: 3px;
  background: var(--line-strong);
}

.waveform-legend .legend-setup { background: #d9a441; }
.waveform-legend .legend-access { background: #52bda7; }
.waveform-legend .legend-ready { background: #6ea4d7; }
.waveform-legend .legend-error { background: #d1645f; }

.command-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.command-heading strong {
  font-size: 10px;
}

.command-heading small {
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.command-timeline {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.command-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  grid-template-rows: auto auto;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.command-timeline li:last-child {
  border-bottom: 0;
}

.command-timeline li::before {
  content: attr(data-index);
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--muted);
  background: #edf1ef;
  border-radius: 50%;
  font: 600 8px/1 Consolas, monospace;
  grid-column: 1;
  grid-row: 1 / 3;
}

.command-timeline li.command-pass::before {
  color: var(--teal);
  background: var(--teal-soft);
}

.command-timeline strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 9px;
}

.command-timeline code {
  grid-column: 2 / 4;
  grid-row: 2;
  overflow: hidden;
  color: #45504b;
  font: 9px/1.4 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-timeline small {
  grid-column: 3;
  grid-row: 1;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.final-answer {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.final-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 700;
}

.final-answer strong {
  font-size: 12px;
}

.final-answer p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.composer-area {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 14px 20px 10px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(217, 223, 220, 0.8);
  backdrop-filter: blur(12px);
}

.composer-inner {
  width: min(820px, 100%);
  margin: 0 auto;
}

.composer-box {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(32, 39, 36, 0.07);
}

.composer-box:focus-within {
  border-color: #8fbeb2;
  box-shadow: 0 0 0 2px rgba(11, 127, 109, 0.08), 0 6px 20px rgba(32, 39, 36, 0.07);
}

#promptInput {
  display: block;
  width: 100%;
  min-height: 58px;
  max-height: 180px;
  resize: none;
  padding: 13px 14px 6px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.55;
}

#promptInput::placeholder {
  color: #909994;
}

.composer-toolbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 7px 7px 9px;
}

.composer-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.attach-button,
.send-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  border-radius: 6px;
}

.attach-button {
  color: #3f4944;
  background: #f3f5f4;
  border: 1px solid var(--line);
  font-size: 20px;
  font-weight: 300;
}

.attach-button:hover {
  background: #e9edeb;
}

.send-button {
  color: #ffffff;
  background: var(--teal);
  border: 0;
  font-size: 18px;
}

.send-button:hover {
  background: #096d5e;
}

.send-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.model-select-wrap {
  position: relative;
}

.model-select-wrap::after {
  position: absolute;
  top: 50%;
  right: 8px;
  content: "⌄";
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-55%);
}

#modelSelect {
  height: 30px;
  padding: 0 24px 0 9px;
  color: #424b47;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
}

#modelSelect:hover {
  background: #f3f5f4;
  border-color: var(--line);
}

.composer-counter {
  color: var(--faint);
  font-size: 9px;
}

.composer-footnote {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 9px;
  text-align: center;
}

.attachment-tray {
  position: relative;
  display: inline-flex;
  max-width: 420px;
  align-items: center;
  margin-bottom: 7px;
}

.attachment-chip {
  display: grid;
  max-width: 400px;
  min-height: 48px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 34px 6px 7px;
  color: var(--ink);
  text-align: left;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.attachment-remove {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: #e8ecea;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.drop-overlay {
  position: fixed;
  z-index: 30;
  inset: 14px;
  display: none;
  place-items: center;
  color: var(--teal);
  background: rgba(236, 247, 243, 0.94);
  border: 2px dashed #72b3a3;
  border-radius: 8px;
  font-size: 17px;
}

body.dragging .drop-overlay {
  display: grid;
}

.activity-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #f7f8f7;
  border-left: 1px solid var(--line);
}

.activity-header {
  display: flex;
  height: 60px;
  flex: 0 0 60px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fafbfa;
  border-bottom: 1px solid var(--line);
}

.activity-header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.activity-header span,
.provenance-panel > span {
  color: var(--teal);
  font: 700 8px/1 Consolas, monospace;
}

.activity-header strong {
  font-size: 12px;
}

.activity-status {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.progress-ring {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  background: conic-gradient(var(--teal) calc(var(--progress) * 1%), #e1e6e3 0);
  border-radius: 50%;
}

.progress-ring::before {
  width: 40px;
  height: 40px;
  content: "";
  background: #f7f8f7;
  border-radius: 50%;
}

.progress-ring span {
  position: absolute;
  font: 700 9px/1 Consolas, monospace;
}

.activity-status > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.activity-status strong {
  font-size: 12px;
}

.activity-status small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.activity-track {
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 8px 16px;
  overflow-y: auto;
  list-style: none;
}

.activity-track li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  min-height: 74px;
  padding: 9px 0;
}

.activity-track li:not(:last-child)::after {
  position: absolute;
  top: 38px;
  bottom: -9px;
  left: 13px;
  width: 1px;
  content: "";
  background: var(--line-strong);
}

.activity-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--faint);
  background: #f7f8f7;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font: 600 9px/1 Consolas, monospace;
}

.activity-track li.running .activity-node {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #dfbb72;
}

.activity-track li.done .activity-node {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #9bcabd;
}

.activity-track li.failed .activity-node {
  color: var(--red);
  background: var(--red-soft);
  border-color: #dfaaa6;
}

.activity-track li > div {
  min-width: 0;
}

.activity-track strong {
  display: block;
  font-size: 10px;
}

.activity-track small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font: 8px/1.35 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-track p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.activity-track li.running p { color: var(--amber); }
.activity-track li.done p { color: var(--teal); }
.activity-track li.failed p { color: var(--red); }

.provenance-panel {
  display: grid;
  gap: 7px;
  padding: 13px 16px 16px;
  background: #f1f3f2;
  border-top: 1px solid var(--line);
}

.provenance-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #3f4c46;
  font: 9px/1.35 Consolas, monospace;
  text-decoration: none;
}

.provenance-panel a:hover {
  color: var(--teal);
}

.provenance-panel small {
  color: var(--faint);
  font-size: 8px;
}

.document-dialog {
  width: min(1100px, calc(100vw - 40px));
  height: min(860px, calc(100vh - 40px));
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.document-dialog::backdrop {
  background: rgba(25, 29, 27, 0.48);
}

.dialog-shell {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.dialog-shell header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-shell header > div:first-child {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

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

.dialog-actions a {
  color: var(--ink);
  text-decoration: none;
}

.dialog-shell header span {
  color: var(--teal);
  font: 700 8px/1 Consolas, monospace;
}

.dialog-shell header strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-citation {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 2fr);
  gap: 16px;
  padding: 11px 14px;
  background: #f1f6f4;
  border-bottom: 1px solid #cbd8d2;
}

.dialog-citation > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.dialog-citation span {
  color: var(--teal);
  font: 700 8px/1.2 Consolas, monospace;
}

.dialog-citation strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.35;
}

.dialog-citation small {
  color: var(--faint);
  font: 8px/1.35 Consolas, monospace;
}

.dialog-citation blockquote {
  min-width: 0;
  margin: 0;
  padding: 2px 0 2px 12px;
  color: #3c4842;
  border-left: 3px solid #7fb3a5;
  font-size: 10px;
  line-height: 1.55;
}

.dialog-pdf-toolbar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 12px;
  background: #f7faf9;
  border-bottom: 1px solid #cbd8d2;
}

.dialog-pdf-toolbar span {
  min-width: 82px;
  color: #42514b;
  font: 10px/1.2 Consolas, monospace;
  text-align: center;
}

.dialog-pdf-toolbar .icon-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.dialog-document {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: #3f4643;
}

.dialog-document iframe {
  width: 100%;
  height: 100%;
  background: #525956;
  border: 0;
}

.dialog-document > img {
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
  background: #525956;
}

.dialog-document > pre {
  width: 100%;
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 18px;
  color: #2d3531;
  background: #fafbfa;
  border-radius: 0;
  font-size: 11px;
}

.dialog-source-highlight {
  scroll-margin-block: 90px;
  color: #173f35;
  background: #bde4d8;
  border-radius: 2px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .dialog-citation {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px 11px;
  }

  .dialog-citation blockquote {
    max-height: 66px;
    overflow: auto;
  }

  .spec-citation {
    width: 100%;
    max-width: none;
  }
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  max-width: 340px;
  padding: 10px 13px;
  color: #ffffff;
  background: #262b28;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Application-owned sign-in screen. */
.login-page {
  min-width: 320px;
  min-height: 100%;
  overflow: auto;
  color: var(--ink);
  background: #eef1ef;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(288px, 23vw) minmax(0, 1fr);
}

.login-context {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 28px 30px 24px;
  color: #f4f7f5;
  background: #171918;
  border-right: 1px solid #2d312f;
}

.login-brand,
.login-mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.login-brand > span:last-child,
.login-mobile-brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand strong,
.login-mobile-brand strong {
  font-size: 14px;
  font-weight: 650;
}

.login-brand small,
.login-mobile-brand small {
  color: #929b96;
  font-size: 10px;
}

.login-pipeline {
  width: 100%;
  max-width: 310px;
  margin: auto 0;
  padding: 42px 0;
}

.login-eyebrow {
  display: block;
  color: #54b49d;
  font: 700 9px/1.2 Consolas, monospace;
}

.login-pipeline h2 {
  margin: 12px 0 26px;
  font-size: 22px;
  font-weight: 620;
}

.login-pipeline ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #303432;
}

.login-pipeline li {
  display: grid;
  min-height: 53px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #303432;
}

.login-pipeline li > span {
  color: #6bc3ad;
  font: 600 9px/1 Consolas, monospace;
}

.login-pipeline li strong {
  font-size: 11px;
  font-weight: 550;
}

.login-pipeline li small {
  color: #7f8984;
  font: 9px/1 Consolas, monospace;
}

.login-node-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid #303432;
}

.login-node-state > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-node-state strong {
  color: #dfe4e1;
  font: 600 9px/1 Consolas, monospace;
}

.login-node-state small {
  color: #7f8984;
  font-size: 9px;
}

.login-main {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 48px;
  background: #f8f9f8;
}

.login-main::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: #0b7f6d;
}

.login-mobile-brand {
  display: none;
}

.login-form-wrap {
  width: min(410px, 100%);
}

.login-heading {
  margin-bottom: 31px;
}

.login-heading h1 {
  margin: 13px 0 8px;
  font-size: 28px;
  font-weight: 650;
}

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

.login-error {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 10px 12px;
  color: #8f312e;
  background: #fbe8e6;
  border: 1px solid #e6b8b4;
  border-radius: 6px;
}

.login-error > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #ffffff;
  background: var(--red);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.login-error p {
  margin: 0;
  font-size: 11px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 7px;
}

.login-field > span:first-child {
  color: #414945;
  font-size: 11px;
  font-weight: 600;
}

.login-field > input,
.password-field {
  width: 100%;
  height: 46px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.login-field > input {
  padding: 0 13px;
  font: 13px/1.2 Consolas, "Microsoft YaHei UI", sans-serif;
}

.login-field > input:hover,
.password-field:hover {
  border-color: #a6b0ab;
}

.login-field > input:focus,
.password-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 127, 109, 0.11);
  outline: 0;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.password-field input {
  min-width: 0;
  height: 44px;
  padding: 0 4px 0 13px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: 13px/1.2 Consolas, sans-serif;
}

.password-field button {
  height: 30px;
  margin-right: 7px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 10px;
}

.password-field button:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.remember-field {
  display: grid;
  width: fit-content;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
}

.remember-switch {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
}

.remember-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  display: block;
  background: #c7cfcb;
  border: 1px solid #abb5b0;
  border-radius: 10px;
  transition: background 150ms ease, border-color 150ms ease;
}

.switch-track > span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(24, 30, 27, 0.24);
  transition: transform 150ms ease;
}

.remember-switch input:checked + .switch-track {
  background: var(--teal);
  border-color: var(--teal);
}

.remember-switch input:checked + .switch-track > span {
  transform: translateX(14px);
}

.remember-switch input:focus-visible + .switch-track {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.remember-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.remember-copy strong {
  color: #414945;
  font-size: 10px;
  font-weight: 600;
}

.remember-copy small {
  color: var(--faint);
  font-size: 9px;
}

.login-submit {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: #ffffff;
  background: #146f60;
  border: 1px solid #146f60;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
}

.login-submit:hover {
  background: #0e6254;
  border-color: #0e6254;
}

.login-submit > span:last-child {
  font-size: 17px;
  font-weight: 400;
}

.login-assurance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.login-assurance span:last-child {
  font-family: Consolas, monospace;
}

body.activity-collapsed .app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 0;
}

body.activity-collapsed .activity-panel {
  display: none;
}

@media (max-width: 1320px) {
  :root { --activity-width: 310px; --sidebar-width: 230px; }
  .conversation-inner { width: min(820px, calc(100% - 32px)); }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .activity-panel {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(350px, calc(100vw - 20px));
    box-shadow: var(--shadow);
    pointer-events: none;
    transform: translateX(102%);
    transition: transform 180ms ease;
  }
  body.activity-open .activity-panel {
    pointer-events: auto;
    transform: translateX(0);
  }
  body.activity-collapsed .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  body.activity-collapsed .activity-panel { display: flex; }
  .activity-close { display: inline-grid; }
}

@media (max-width: 760px) {
  .login-shell { display: block; }
  .login-context { display: none; }
  .login-main {
    min-height: 100vh;
    min-height: 100dvh;
    align-content: center;
    padding: 92px 24px 38px;
  }
  .login-mobile-brand {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
  }
  .login-heading { margin-bottom: 26px; }
  .login-heading h1 { font-size: 24px; }
  .login-assurance { align-items: flex-start; flex-direction: column; gap: 5px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    z-index: 25;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(284px, calc(100vw - 36px));
    box-shadow: var(--shadow);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }
  body.sidebar-opened .sidebar { transform: translateX(0); }
  .sidebar-close,
  .sidebar-open { display: inline-grid; }
  .chat-header { height: 56px; flex-basis: 56px; padding: 0 12px; }
  .chat-header h1 { max-width: 52vw; }
  .header-actions .icon-button { display: none; }
  .conversation-inner { width: calc(100% - 24px); padding-top: 18px; padding-bottom: 156px; }
  .message { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; padding: 14px 0; }
  .message-avatar { width: 28px; height: 28px; }
  .message-copy { font-size: 13px; }
  .run-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-overview > div:nth-child(2) { border-right: 0; }
  .run-overview > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .run-overview > div:nth-child(3) { padding-left: 0; }
  .step-trigger { grid-template-columns: 28px minmax(0, 1fr) 14px; padding: 8px; }
  .step-status,
  .step-compact-metrics { display: none; }
  .step-heading small { white-space: normal; }
  .step-content { padding: 0 9px 11px; }
  .call-line { grid-template-columns: 36px minmax(0, 1fr); }
  .call-line small { grid-column: 2; text-align: left; }
  .result-grid,
  .check-strip,
  .simulation-summary,
  .step-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid > div:nth-child(2),
  .check-strip > div:nth-child(2),
  .simulation-summary > div:nth-child(2),
  .step-metrics > div:nth-child(2) { border-right: 0; }
  .result-grid > div:nth-child(-n+2),
  .check-strip > div:nth-child(-n+2),
  .simulation-summary > div:nth-child(-n+2),
  .step-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stage-rationale { grid-template-columns: 1fr; }
  .stage-rationale > div { grid-template-columns: 54px minmax(0, 1fr); padding-right: 0; }
  .stage-rationale > div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .case-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-source-grid > a { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .case-source-grid > a:nth-child(2n) { border-right: 0; }
  .case-source-grid > a:nth-last-child(-n+2) { border-bottom: 0; }
  .intent-item { grid-template-columns: 1fr; gap: 7px; }
  .intent-row { grid-template-columns: 70px minmax(0, 1fr); }
  .checker-token-note { grid-template-columns: auto minmax(0, 1fr); }
  .checker-token-note .repair-state { grid-column: 2; justify-self: start; }
  .adapter-audit { grid-template-columns: 1fr; }
  .adapter-audit > div:first-child { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--line); }
  .adapter-checks { grid-template-columns: 1fr; }
  .adapter-checks > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .adapter-checks > div:last-child { border-bottom: 0; }
  .baseline-evidence { grid-template-columns: 1fr; }
  .baseline-scenarios { grid-template-columns: 1fr; }
  .baseline-scenarios > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .baseline-scenarios > div:last-child { border-bottom: 0; }
  .stimulus-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stimulus-chain > i { display: none; }
  .coverage-panel { grid-template-columns: 1fr; }
  .coverage-score { min-height: 68px; border-right: 0; border-bottom: 1px solid var(--line); }
  .industrial-flow > div { grid-template-columns: 24px minmax(0, 1fr); padding: 7px 0; }
  .industrial-flow b { grid-column: 2; text-align: left; }
  .simulation-toolbar { align-items: flex-start; flex-direction: column; }
  .stimulus-row { grid-template-columns: 22px minmax(0, 1fr); }
  .stimulus-row > div { grid-column: 2; }
  .waveform-scroll { min-height: 350px; }
  .waveform-scroll svg { min-width: 760px; }
  .command-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .command-heading small { text-align: left; }
  .command-timeline li { grid-template-columns: 19px minmax(0, 1fr); }
  .command-timeline code { grid-column: 2; }
  .command-timeline small { grid-column: 2; grid-row: 3; }
  .composer-area { padding: 9px 10px 7px; }
  .composer-counter { display: none; }
  .composer-footnote { font-size: 8px; }
  .attachment-tray { max-width: 100%; }
  .attachment-chip { max-width: calc(100vw - 48px); }
}

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