@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #0b101b;
  --panel: #111725;
  --line: rgba(178, 194, 222, 0.12);
  --muted: #8190a9;
  --text: #e8edf5;
  --mint: #8ce9c0;
  --violet: #b4a2ff;
  --amber: #ffce83;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled,
select:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
a {
  color: var(--mint);
  text-decoration: none;
}
button {
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  filter: brightness(1.1);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
.topbar {
  height: 72px;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #101622;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid #548e89;
  border-radius: 10px;
  background: linear-gradient(145deg, #284741, #132331);
  color: #a8eed1;
  font-size: 26px;
}
.brand small {
  display: inline-block;
  margin-left: 17px;
  padding-left: 17px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.top-right {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.top-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}
.connection {
  display: flex;
  gap: 7px;
  align-items: center;
}
.connection i,
.live-chip i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px #83ebbc70;
}
.connection.offline i {
  background: var(--amber);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 378px;
  min-height: calc(100vh - 72px);
}
.office-panel {
  height: calc(100vh - 72px);
  min-height: 640px;
  position: sticky;
  top: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #1d2a3b, #0c121f 75%);
}
.office-canvas {
  position: absolute;
  inset: 0 0 110px;
}
.office-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.office-heading {
  position: absolute;
  top: 32px;
  left: 34px;
  pointer-events: none;
  text-shadow: 0 2px 14px #05080d;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 600;
  color: #8ea4bd;
}
.office-heading h1 {
  font-size: 28px;
  letter-spacing: 1px;
  margin: 10px 0 9px;
  font-weight: 600;
}
.office-heading p {
  font-size: 11px;
  color: #a3b2c6;
  margin: 0;
}
.scene-actions {
  position: absolute;
  right: 24px;
  top: 30px;
  display: flex;
  gap: 7px;
}
.icon-button {
  border: 1px solid #ffffff22;
  background: #121c2bd9;
  color: #cbd5e3;
  border-radius: 8px;
  height: 33px;
  min-width: 35px;
  padding: 0 10px;
  font-size: 11px;
}
.office-bottom {
  position: absolute;
  bottom: 120px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #7d90a8;
  pointer-events: none;
}
.live-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c4dbd4;
  background: #121e2cdd;
  border: 1px solid #8ce9c021;
  border-radius: 20px;
  padding: 8px 12px;
  letter-spacing: 0.4px;
}
.stage-strip {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stage-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 12px;
  text-align: left;
  background: #172131e8;
  border: 1px solid #ffffff0c;
  border-radius: 10px;
  color: #8b9ab0;
  min-width: 0;
}
.stage-card .step-icon {
  font-size: 17px;
  color: #8b9ab0;
  width: 23px;
  flex: none;
}
.stage-card strong {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  font-weight: 500;
  color: #bcc9da;
}
.stage-card small {
  display: block;
  font-size: 9px;
  margin-top: 5px;
  color: #71839d;
}
.stage-card.running {
  border-color: #8ce9c060;
  background: #203630e8;
  box-shadow: 0 0 20px #8ce9c00c;
}
.stage-card.running .step-icon,
.stage-card.running strong {
  color: var(--mint);
}
.stage-card.done .step-icon {
  color: var(--mint);
}
.stage-card.selected:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--mint);
}
.control-panel {
  background: var(--panel);
  padding: 27px 25px 22px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-heading h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 7px 0 0;
  letter-spacing: 0.5px;
}
.status-tag {
  font-size: 10px;
  border: 1px solid #ffffff18;
  border-radius: 5px;
  padding: 5px 8px;
  color: #98a8be;
}
.status-tag.running {
  color: var(--mint);
  border-color: #8ce9c035;
}
.status-tag.awaiting_approval {
  color: var(--amber);
  border-color: #ffce8335;
}
.status-tag.failed {
  color: #ffa69e;
  border-color: #ffa69e35;
}
.run-form {
  margin-top: 25px;
}
label {
  display: block;
  color: #96a7bf;
  font-size: 10px;
  margin: 0 0 8px;
}
select,
input {
  width: 100%;
  height: 38px;
  border: 1px solid #ffffff17;
  background: #0e1421;
  color: #d8e0ed;
  border-radius: 7px;
  padding: 0 10px;
  min-width: 0;
}
select {
  padding-right: 20px;
  font-size: 11px;
}
.field-hint {
  margin: 8px 0 17px;
  color: #6f829e;
  font-size: 9px;
  line-height: 1.6;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 12px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--mint);
  border: 1px solid var(--mint);
  color: #14382d;
  font-weight: 600;
  border-radius: 7px;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 11px;
}
.run-form > .primary {
  width: 100%;
  margin-top: 17px;
  justify-content: space-between;
}
.run-form > .primary span:last-child {
  font-size: 18px;
}
.secondary {
  background: #1c2637;
  border: 1px solid #ffffff15;
  color: #bbcadc;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 10px;
}
.approval-box {
  margin-top: 22px;
  padding: 17px;
  border: 1px solid #ffce8335;
  background: linear-gradient(130deg, #3e342427, #1a1c2a);
  border-radius: 9px;
}
.approval-box .eyebrow {
  color: var(--amber);
  font-size: 9px;
}
.approval-box h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 10px 0;
}
.approval-box p {
  font-size: 11px;
  line-height: 1.9;
  color: #bcc2ce;
}
.approval-actions {
  display: flex;
  gap: 7px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.approval-actions .primary {
  flex: 1;
  font-size: 10px;
}
.approval-actions .secondary {
  flex: 1;
}
.error-banner {
  background: #522a293b;
  color: #ffb4a9;
  border: 1px solid #ff999925;
  border-radius: 7px;
  font-size: 11px;
  padding: 11px;
  line-height: 1.7;
  margin-top: 16px;
  overflow-wrap: anywhere;
}
.retry {
  width: 100%;
  margin-top: 12px;
  color: var(--amber);
}
.handoff-section {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
}
.section-title > span {
  font-size: 9px;
  color: #7386a1;
}
.role-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.role-tab {
  border: 1px solid transparent;
  background: #1b2434;
  color: #8193ad;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 9px;
}
.role-tab.active {
  background: #273d3977;
  border-color: #8ce9c035;
  color: var(--mint);
}
.role-detail {
  font-size: 11px;
  line-height: 1.9;
}
.role-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.role-header h4 {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}
.stage-state {
  font-size: 9px;
  color: #8093ad;
}
.role-summary {
  color: #a7b6c9;
  font-size: 11px;
  margin: 8px 0 12px;
}
.brief {
  padding: 12px 13px;
  border-left: 2px solid #8ce9c06b;
  background: #192a2b77;
  border-radius: 0 6px 6px 0;
  color: #c4d4cf;
  font-size: 11px;
  line-height: 1.9;
}
.brief-label {
  display: block;
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #7cac9b;
  margin-bottom: 5px;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 13px 0;
}
.metric {
  padding: 10px;
  background: #172132;
  border-radius: 7px;
  min-width: 0;
}
.metric span {
  display: block;
  color: #7f94b0;
  font-size: 9px;
}
.metric strong {
  display: block;
  margin-top: 4px;
  color: #d8e5f3;
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.metric.compact strong {
  font-size: 11px;
}
.detail-json {
  margin-top: 10px;
  color: #8194ad;
  font-size: 10px;
}
.detail-json summary {
  cursor: pointer;
}
.detail-json pre {
  max-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 9px;
  color: #aebdd0;
  padding: 10px;
  background: #0d1420;
  border-radius: 6px;
}
.empty-state {
  padding: 24px 12px 18px;
  text-align: center;
  color: #778da9;
}
.empty-state > span {
  display: block;
  color: #6c9b91;
  font-size: 28px;
}
.empty-state h3 {
  font-size: 12px;
  color: #b4c2d4;
  font-weight: 500;
  margin: 8px;
}
.empty-state p {
  font-size: 10px;
  line-height: 1.9;
  margin: 7px 0;
}
.activity-section {
  margin-top: 25px;
}
.activity {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 210px;
  overflow-y: auto;
}
.activity li {
  position: relative;
  margin-left: 3px;
  padding: 0 0 14px 16px;
  border-left: 1px solid #ffffff12;
  font-size: 10px;
  line-height: 1.6;
  color: #7f91aa;
}
.activity li:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 5px;
  width: 5px;
  height: 5px;
  background: #657d98;
  border-radius: 50%;
}
.activity li:first-child:before {
  background: var(--mint);
  box-shadow: 0 0 8px #8ce9c050;
}
.activity li strong {
  display: block;
  color: #bccbdc;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 3px;
}
.activity li.quiet {
  border: 0;
  padding-left: 0;
  color: #637b98;
}
.activity li.quiet:before {
  display: none;
}
.evidence {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  font-size: 10px;
  color: #8d9eb7;
  line-height: 1.8;
}
.evidence > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  color: #9eafc5;
}
.evidence > summary span {
  color: #7b92ad;
}
.evidence p {
  font-size: 10px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.evidence ul {
  padding-left: 16px;
  font-size: 10px;
}
.evidence a {
  display: inline-block;
  margin: 4px 0;
  font-size: 10px;
}
.history-row {
  margin-top: 22px;
}
.history-row select {
  font-size: 10px;
  height: 32px;
}
.scene-loading {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  color: #7991ad;
  font-size: 12px;
}
.loader {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #ffffff20;
  border-top-color: var(--mint);
  animation: spin 1s linear infinite;
}
.scene-loading.failed {
  padding: 30px;
  text-align: center;
  line-height: 1.9;
  color: #9db1ca;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  background: #263e36;
  border: 1px solid #8ce9c040;
  border-radius: 9px;
  color: #c9eee0;
  font-size: 12px;
  z-index: 50;
  max-width: 90vw;
  box-shadow: 0 8px 40px #0006;
}
[hidden] {
  display: none !important;
}
.office-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #0c121f;
}
.office-panel:fullscreen .office-canvas {
  bottom: 0;
}
.office-panel:fullscreen .stage-strip {
  bottom: 24px;
}
.office-panel:fullscreen .office-bottom {
  bottom: 120px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 420px;
  }
  .control-panel {
    padding: 30px;
  }
  .office-heading {
    top: 38px;
    left: 42px;
  }
  .office-heading h1 {
    font-size: 34px;
  }
}
@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  .control-panel {
    padding: 22px 18px;
  }
  .office-heading {
    left: 22px;
  }
  .office-heading h1 {
    font-size: 23px;
  }
  .office-heading p {
    font-size: 10px;
    max-width: 290px;
    line-height: 1.7;
  }
  .stage-strip {
    left: 16px;
    right: 16px;
    gap: 5px;
  }
  .stage-card {
    padding: 12px 8px;
    gap: 5px;
  }
  .stage-card .step-icon {
    width: 16px;
    font-size: 14px;
  }
  .stage-card strong {
    font-size: 10px;
  }
  .stage-card small {
    font-size: 8px;
  }
  .office-bottom {
    left: 18px;
    right: 18px;
  }
  .office-bottom > span {
    max-width: 140px;
    text-align: right;
    line-height: 1.6;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 62px;
    padding: 0 18px;
  }
  .brand {
    font-size: 15px;
  }
  .brand small {
    display: none;
  }
  .top-right {
    gap: 10px;
  }
  .dataset-tag,
  .top-divider {
    display: none;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .office-panel {
    position: relative;
    top: auto;
    width: 100%;
    height: 66vh;
    min-height: 500px;
  }
  .office-canvas {
    bottom: 100px;
  }
  .office-heading {
    top: 22px;
    left: 20px;
  }
  .office-heading h1 {
    font-size: 23px;
  }
  .office-heading .eyebrow {
    font-size: 8px;
  }
  .office-heading p {
    max-width: 270px;
    font-size: 9px;
  }
  .scene-actions {
    top: 119px;
    right: 14px;
  }
  .office-bottom {
    bottom: 107px;
    font-size: 8px;
  }
  .office-bottom > span {
    max-width: 140px;
  }
  .stage-strip {
    bottom: 18px;
    left: 14px;
    right: 14px;
  }
  .stage-card {
    display: block;
    padding: 10px 7px;
  }
  .stage-card .step-icon {
    font-size: 13px;
    display: inline-block;
    margin-bottom: 5px;
  }
  .stage-card strong {
    font-size: 9px;
  }
  .stage-card small {
    font-size: 8px;
  }
  .control-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 25px 22px 30px;
  }
  .role-tabs {
    gap: 7px;
  }
  .role-tab {
    font-size: 11px;
    padding: 8px 12px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .activity {
    max-height: 250px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.role-chat-button,
.history-handoff {
  border: 0;
  background: transparent;
  color: #b4a2ff;
  padding: 0;
  font-size: 10px;
  cursor: pointer;
}
.role-chat-button {
  margin-left: auto;
  margin-right: 10px;
}
.history-handoff {
  display: block;
  margin-top: 6px;
}
.interaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}
.interaction-layer > section,
.interaction-layer > button {
  pointer-events: auto;
}
.window-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: none;
}
.window-actions button {
  border: 0;
  background: transparent;
  color: #9297ac;
  font-size: 21px;
  line-height: 1;
  padding: 4px;
}
.window-actions button[title] {
  font-size: 10px;
  border: 1px solid #ffffff12;
  border-radius: 5px;
  padding: 6px 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1080px) {
  .scene-actions {
    gap: 4px;
    right: 15px;
  }
  .scene-actions .icon-button {
    font-size: 10px;
    padding: 0 8px;
  }
  .office-heading h1 {
    font-size: 22px;
  }
}
@media (max-width: 760px) {
  .scene-actions {
    top: 112px;
    right: 14px;
  }
  .scene-actions .icon-button {
    height: 30px;
    font-size: 9px;
    padding: 0 8px;
  }
  .role-chat-button {
    font-size: 9px;
  }
}
.office-heading h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1.45;
  margin-top: 8px;
  margin-bottom: 7px;
}
