:root {
  --shell-bg: #0b121b;
  --shell-panel: #101923;
  --shell-line: #293541;
  --shell-ink: #e3edf1;
  --shell-muted: #9eafbd;
  --signal: #79e8cf;
}
.topbar {
  height: 56px;
  padding: 0 24px;
  background: #101720;
  border-bottom: 1px solid var(--shell-line);
  gap: 18px;
  justify-content: flex-start;
}
.brand {
  font-size: 16px;
  gap: 10px;
}
.brand-mark {
  height: 28px;
  width: 28px;
  border-radius: 7px;
  font-size: 20px;
}
.workspace-path {
  color: #536474;
  font-size: 15px;
}
.workspace-path b {
  font-size: 13px;
  color: #b7c5d0;
  font-weight: 500;
  margin-left: 12px;
}
.top-right {
  margin-left: auto;
  gap: 20px;
  font-size: 12px;
}
.connection {
  color: #a8c4b9;
}
.workspace {
  grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 408px);
  min-height: calc(100dvh - 56px);
}
.office-panel {
  height: calc(100dvh - 56px);
  min-height: 500px;
}
.office-canvas {
  inset: 0 0 110px;
}
.office-heading {
  top: 24px;
  left: 24px;
}
.office-heading h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.3px;
}
.office-heading p {
  font-size: 12px;
  margin: 6px 0;
  color: #a2b5c4;
}
.scene-actions {
  top: 23px;
  right: 22px;
  display: flex;
  gap: 1px;
  padding: 3px;
  border: 1px solid #697f9255;
  border-radius: 9px;
  background: #101c29ec;
}
.scene-actions .icon-button {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  color: #c5d3dd;
  min-height: 29px;
}
.scene-actions .icon-button:hover,
.scene-actions .icon-button[aria-pressed="true"] {
  background: #283849;
  color: white;
}
.scene-actions #open-dashboard {
  color: var(--signal);
  border-right: 1px solid #3a4b57;
  border-radius: 3px 0 0 3px;
}
.office-bottom {
  bottom: 124px;
  left: auto;
  right: 20px;
}
.live-chip {
  padding: 5px 10px;
}
.flow-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 110px;
  padding: 14px 22px;
  background: #101923;
  border-top: 1px solid var(--shell-line);
  z-index: 5;
}
.flow-dock header,
.task-caption,
.task-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flow-dock h2,
.control-panel h3,
.task-dialog h2 {
  margin: 0;
}
.flow-dock h2 {
  font-size: 13px;
  font-weight: 600;
  color: #d7e5ed;
}
#stage-count,
.task-caption,
.task-facts span {
  font-size: 12px;
  color: var(--shell-muted);
}
.flow-dock .stage-strip {
  position: static;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  background: none;
  padding: 0;
}
.flow-dock .stage-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #a7b9c6;
  min-height: 47px;
  padding: 5px 8px;
  text-align: left;
  overflow: visible;
}
.flow-dock .stage-card:not(:last-child):after {
  content: "";
  height: 1px;
  position: absolute;
  right: -6px;
  top: 50%;
  width: 20%;
  background: var(--shell-line);
}
.flow-dock .stage-card.selected {
  background: #1c3438;
  color: #b8fae9;
}
.flow-dock .stage-card.selected:before {
  display: none;
}
.flow-dock .step-icon {
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid #435361;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a7b5c1;
  font:
    500 12px ui-monospace,
    monospace;
}
.flow-dock .done .step-icon,
.flow-dock .selected .step-icon {
  color: var(--signal);
  border-color: #68b6a7;
  background: #17312f;
}
.flow-dock .awaiting_approval .step-icon {
  color: #efc376;
  border-color: #a6864e;
}
.flow-dock .stage-card strong {
  font-size: 14px;
  line-height: 1.4;
  color: inherit;
}
.flow-dock .stage-card small {
  font-size: 11px;
  color: #9dabb8;
  line-height: 1.5;
}
.control-panel {
  background: var(--shell-panel);
  padding: 23px 22px 26px;
  border-left: 1px solid var(--shell-line);
  height: calc(100dvh - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #374457 transparent;
}
.panel-heading {
  align-items: center;
  margin: 0 0 20px;
}
.panel-heading h2 {
  font-size: 21px;
  margin: 0;
  letter-spacing: 0.2px;
}
.new-task {
  border: 1px solid #5c9d90;
  color: #adf2df;
  background: #1a322f;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 550;
}
.task-identity {
  border: 1px solid #395356;
  border-radius: 10px;
  padding: 17px 17px 15px;
  background: linear-gradient(110deg, #193134, #15252c 75%);
  box-shadow: inset 2px 0 #79e8cf;
}
.task-identity h3 {
  font-size: 21px;
  color: #f1f6f5;
  margin: 7px 0 16px;
}
.task-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #98d9cf27;
  padding-top: 12px;
}
.task-facts div {
  display: grid;
  gap: 5px;
}
.task-facts strong {
  font-size: 15px;
  font-weight: 550;
  color: #d7eae7;
}
.status-tag {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid #68828273;
  border-radius: 20px;
  color: #b8cecf;
}
.status-tag.completed {
  color: #94e4c8;
  background: #203e37;
}
.control-panel .handoff-section {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}
.section-title h3 {
  font-size: 15px;
  letter-spacing: 0.3px;
}
.role-chat-button {
  margin-left: auto;
  color: #92d9d0;
  font-size: 12px;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 0 12px;
}
.result-header h4 {
  margin: 0;
  color: #dae7ef;
  font-size: 16px;
}
.result-header span {
  font-size: 12px;
  color: #9aabb8;
}
.role-detail {
  padding: 0;
  margin: 0;
  min-height: 0;
}
.control-panel .metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--shell-line);
  margin: 0;
}
.control-panel .metric {
  border: 0;
  border-radius: 0;
  min-height: 69px;
  padding: 10px 13px;
  background: #17222e;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.control-panel .metric span {
  font-size: 12px;
  color: #9faebb;
}
.control-panel .metric strong {
  margin: 0;
  font-size: 19px;
  color: #e5eff3;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.result-notes,
.log-fold,
.control-panel .evidence {
  padding: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--shell-line);
}
.result-notes {
  margin-top: 9px;
}
.result-notes summary,
.log-fold summary,
.control-panel .evidence summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 15px 1px;
  list-style: none;
  font-size: 13px;
  color: #c0ccd6;
  cursor: pointer;
}
.result-notes summary:after,
.log-fold summary:after,
.control-panel .evidence summary:after {
  content: "⌄";
  color: #91a4b1;
}
.log-fold summary span {
  margin-left: auto;
  color: #8b9aa7;
  font-size: 12px;
}
.result-notes p,
.empty-copy {
  color: #a1b2bd;
  font-size: 13px;
  line-height: 1.65;
}
.result-notes .detail-json {
  max-width: 100%;
}
.control-panel .history-row {
  margin: 20px 0 0;
}
.history-row label,
.task-dialog label {
  font-size: 12px;
}
.history-row select,
.task-dialog select,
.task-dialog input {
  font-size: 13px;
  background: #121d28;
  border-color: #33434e;
}
.task-dialog {
  width: min(400px, calc(100% - 36px));
  border: 1px solid #49616c;
  padding: 23px;
  border-radius: 12px;
  background: #121e29;
  color: var(--shell-ink);
  box-shadow: 0 20px 80px #030a14b0;
}
.task-dialog::backdrop {
  background: #030912a8;
}
.task-dialog h2 {
  font-size: 19px;
}
.task-dialog header button {
  border: 0;
  background: transparent;
  color: #9eb1bd;
  font-size: 24px;
}
.task-dialog .field-hint {
  font-size: 12px;
}
.task-dialog #form-error {
  color: #ffb6a5;
}
.approval-box {
  margin: 14px 0 0;
}
.approval-box p {
  font-size: 13px;
}
.approval-actions button,
.retry,
.primary {
  font-size: 13px;
}
.control-panel details[open] > summary:after {
  transform: rotate(180deg);
}
@media (max-width: 1100px) {
  .stage-card:not(:last-child):after {
    display: none;
  }
  .control-panel {
    padding: 19px 16px;
  }
  .scene-actions {
    top: 19px;
    right: 14px;
  }
  .office-heading {
    top: 20px;
    left: 16px;
  }
  .office-heading h1 {
    font-size: 19px;
  }
  .flow-dock {
    padding: 13px 12px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 49px;
    padding: 0 13px;
    gap: 9px;
  }
  .brand {
    font-size: 14px;
    gap: 7px;
  }
  .workspace-path b {
    font-size: 12px;
    margin-left: 4px;
  }
  .top-right {
    font-size: 11px;
  }
  .office-panel {
    height: 64dvh;
    min-height: 410px;
  }
  .office-canvas {
    bottom: 88px;
  }
  .flow-dock {
    height: 88px;
    padding: 8px;
  }
  .flow-dock h2 {
    font-size: 12px;
  }
  .flow-dock .stage-strip {
    gap: 2px;
    margin-top: 4px;
  }
  .flow-dock .stage-card {
    gap: 4px;
    padding: 4px 2px;
    justify-content: center;
  }
  .flow-dock .step-icon {
    width: 17px;
    height: 17px;
    font-size: 9px;
  }
  .flow-dock .stage-card strong {
    font-size: 12px;
  }
  .flow-dock .stage-card small {
    font-size: 10px;
  }
  .office-heading {
    top: 13px;
    left: 12px;
  }
  .office-heading p {
    font-size: 11px;
  }
  .scene-actions {
    top: 64px;
    right: 10px;
  }
  .office-bottom {
    bottom: 96px;
    right: 12px;
  }
  .control-panel {
    height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--shell-line);
    padding: 21px 17px 28px;
  }
  .control-panel .panel-heading {
    margin-bottom: 14px;
  }
}
.flow-dock .stage-card.selected:after {
  display: none;
}
.office-panel:fullscreen .flow-dock .stage-strip {
  bottom: auto;
}
.office-panel:fullscreen .office-canvas {
  bottom: 110px;
}
.office-panel {
  --group-bottom: 121px;
}
@media (max-width: 760px) {
  .office-panel {
    --group-bottom: 96px;
  }
}

#office-role-card { position:absolute;z-index:8;left:0;top:0;width:min(252px,80%);pointer-events:none;box-sizing:border-box;padding:14px 15px 12px;border:1px solid #536771;border-radius:12px;background:linear-gradient(135deg,#192830f7,#111b26fa);color:#eff5f6;box-shadow:0 12px 34px #06101966;font-size:13px;line-height:1.5; }
#office-role-card[hidden] { display:none; }
#office-role-card header {display:flex;align-items:center;gap:8px;}
#office-role-card header i {width:8px;height:8px;border-radius:50%;background:var(--role-accent);}
#office-role-card header strong {font-size:15px;}
#office-role-card header span {margin-left:auto;font-size:11px;border:1px solid #586975;border-radius:10px;padding:1px 7px;color:#d0dade;}
#office-role-card:is([data-state=working],[data-state=meeting]) header span {color:#9af1d8;border-color:#416d62;}
#office-role-card:is([data-state=awaiting_approval],[data-state=failed]) header span {color:#f2c882;border-color:#826740;}
#office-role-card p {margin:9px 0 10px;color:#bccbd2;}
#office-role-card footer {display:flex;align-items:baseline;gap:10px;border-top:1px solid #40505c;padding-top:8px;}
#office-role-card footer small {color:#92a4aa;white-space:nowrap;}
#office-role-card footer b {font-weight:500;font-size:12px;}
