:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --blue: #0071e3;
  --blue-dark: #005bb5;
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff3b30;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.11);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(0, 113, 227, 0.16), transparent 34rem),
    radial-gradient(circle at 82% 8%, rgba(52, 199, 89, 0.12), transparent 28rem),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 54%, #eef1f5 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  background: rgba(245, 245, 247, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(28px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 26px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #1c7df2, #0a4fb8);
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(0, 113, 227, 0.28);
  font-weight: 800;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.brand-block h1,
.topbar h2,
.panel h3,
.agent-modal h3 {
  margin-bottom: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 23px;
  font-weight: 760;
}

.eyebrow,
.section-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 26px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

.leader-brief {
  padding: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.08);
}

.leader-brief p:last-child,
.topbar-copy,
.panel-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 154px;
  padding: 30px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
}

.topbar h2 {
  font-size: clamp(34px, 4.2vw, 64px);
  font-weight: 780;
  line-height: 1.02;
}

.topbar-copy {
  max-width: 720px;
  margin-top: 12px;
  font-size: 17px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
  min-width: 360px;
}

.status-strip div {
  min-height: 92px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.status-strip span {
  display: block;
  font-size: 34px;
  font-weight: 760;
  line-height: 1;
}

.status-strip small {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.panel h3 {
  font-size: 22px;
  font-weight: 740;
}

.agent-modal h4 {
  margin-bottom: 0;
}

.command-form,
.skill-form,
.agent-edit-form,
.skill-import-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input[type="range"] {
  min-height: auto;
  padding: 0;
  accent-color: var(--blue);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: white;
  border-color: rgba(0, 113, 227, 0.72);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}

.form-grid,
.two-column,
.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.primary-button,
.secondary-button,
.ghost-button,
.segment,
.mini-button,
.close-button,
.danger-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 680;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
}

.compact-button {
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.primary-button {
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.24);
}

.secondary-button {
  color: white;
  background: #1d1d1f;
}

.ghost-button,
.mini-button {
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.danger-button {
  padding: 0 12px;
  color: var(--red);
  background: rgba(255, 59, 48, 0.09);
  border-color: rgba(255, 59, 48, 0.18);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.segment:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 999px;
}

.artifact-tabs {
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.segment {
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.segment.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.flow-list,
.agent-grid,
.skill-list,
.artifact-list,
.routing-board {
  display: grid;
  gap: 14px;
}

.flow-card,
.agent-card,
.skill-card,
.artifact-card,
.review-card {
  padding: 17px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.flow-card,
.agent-card,
.skill-card,
.artifact-card,
.review-card {
  display: grid;
  gap: 12px;
}

.flow-meta,
.agent-meta,
.artifact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.11);
  border: 1px solid rgba(118, 118, 128, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.pill.high {
  color: var(--red);
  background: rgba(255, 59, 48, 0.1);
}

.pill.running {
  color: var(--blue-dark);
  background: rgba(0, 113, 227, 0.1);
}

.pill.review {
  color: #a15c00;
  background: rgba(255, 159, 10, 0.14);
}

.pill.done {
  color: #187a30;
  background: rgba(52, 199, 89, 0.14);
}

.route-line {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.route-step {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 10px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.09);
  border: 1px solid rgba(118, 118, 128, 0.1);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}

.route-step.active {
  color: white;
  background: linear-gradient(145deg, var(--blue), #4aa3ff);
}

.route-status-tag {
  justify-self: start;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  font-size: 10px;
  line-height: 14px;
}

.route-step.queued .route-status-tag {
  color: var(--muted);
  background: #fff;
}

.route-step.paused {
  color: #8a3707;
  background: #fcebdc;
  border-color: #f4bf8f;
}

.route-step.paused .route-status-tag {
  background: rgba(255, 255, 255, 0.68);
}

.routing-page {
  overflow: hidden;
}

.run-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.settings-panel {
  scroll-margin-top: 24px;
}

.settings-form {
  display: grid;
  max-width: 760px;
  gap: 14px;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #616161;
  background: #f0f0f0;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.connection-badge.connected {
  color: #0e700e;
  background: #dff6dd;
  border-color: #9fd89f;
}

.security-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-status {
  min-height: 20px;
  margin: 0;
}

.routing-board {
  display: grid;
  grid-auto-columns: minmax(250px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}

.routing-lane {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 440px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  scroll-snap-align: start;
}

.routing-lane:not(:last-child)::after {
  position: absolute;
  top: 34px;
  right: -11px;
  z-index: 2;
  width: 22px;
  height: 22px;
  color: white;
  background: var(--blue);
  border: 4px solid #f5f7fb;
  border-radius: 999px;
  content: ">";
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
}

.routing-lane header {
  min-height: 128px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.lane-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--blue-dark);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 780;
}

.routing-lane h4,
.route-task h4 {
  margin-bottom: 0;
}

.routing-lane header p,
.route-task p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lane-task-list {
  display: grid;
  gap: 10px;
}

.route-task {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.route-task.current {
  border-color: rgba(0, 113, 227, 0.34);
  box-shadow: 0 16px 34px rgba(0, 113, 227, 0.13);
}

.route-task.fresh {
  outline: 3px solid rgba(0, 113, 227, 0.2);
  animation: pulseTask 1.2s ease-out 2;
}

.route-task.passed {
  opacity: 0.72;
  background: rgba(255, 255, 255, 0.58);
}

.route-task .mini-button {
  justify-self: start;
}

.empty-lane {
  min-height: 88px;
  padding: 16px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.08);
  border: 1px dashed rgba(118, 118, 128, 0.26);
  border-radius: 18px;
  font-size: 13px;
}

@keyframes pulseTask {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0, 113, 227, 0);
  }

  45% {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(0, 113, 227, 0.2);
  }

  100% {
    transform: translateY(0);
    box-shadow: 0 16px 34px rgba(0, 113, 227, 0.13);
  }
}

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

.agent-office-panel {
  overflow: hidden;
}

.agent-roster {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 16px;
  overflow-y: auto;
  background: rgba(250, 250, 250, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  animation: rosterEnter 160ms cubic-bezier(0.1, 0.9, 0.2, 1) both;
}

.agent-roster[hidden] {
  display: none;
}

@keyframes rosterEnter {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.agent-roster-toggle.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.agent-roster-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.agent-roster-toggle span {
  font-size: 12px;
  font-weight: 650;
}

.agent-roster-heading,
.agent-roster-row,
.agent-roster-meta,
.agent-create-actions {
  display: flex;
  align-items: center;
}

.agent-roster-heading,
.agent-roster-row {
  justify-content: space-between;
  gap: 16px;
}

.agent-roster-heading h4 {
  margin-top: 2px;
  font-size: 16px;
}

.agent-roster-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-add-button {
  width: 100%;
}

.agent-roster-list {
  display: grid;
  gap: 8px;
}

.agent-roster-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.agent-roster-main {
  display: grid;
  min-width: 0;
}

.agent-visibility-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

.agent-visibility-toggle input {
  flex: 0 0 auto;
}

.agent-roster-main strong,
.agent-roster-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-roster-main span {
  color: var(--muted);
  font-size: 12px;
}

.agent-roster-meta,
.agent-create-actions {
  flex: 0 0 auto;
  gap: 6px;
}

.agent-roster-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-create-form {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

#toggleAgentForm[hidden],
.agent-detail-tabs [hidden],
.agent-create-form[hidden] {
  display: none;
}

.agent-create-form .form-status {
  grid-column: 1 / -1;
  margin: 0;
}

.agent-office-shell {
  position: relative;
  min-height: 640px;
  overflow: auto;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(118, 118, 128, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(118, 118, 128, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.92), transparent 32%),
    #f7f7f8;
  background-size:
    72px 72px,
    72px 72px,
    auto,
    auto;
  border: 1px solid var(--line);
  border-radius: 26px;
}

.empty-board {
  grid-column: 1 / -1;
  align-self: center;
  max-width: 420px;
  margin: auto;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  text-align: center;
}

.office-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 44px 34px;
  min-width: 860px;
  min-height: 580px;
  padding: 18px 6px 36px;
}

.office-desk-slot {
  position: relative;
  min-height: 232px;
}

.office-desk {
  position: relative;
  display: block;
  width: 100%;
  min-height: 214px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.desk-label {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: max-content;
  max-width: 170px;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  text-align: center;
}

.desk-surface {
  position: absolute;
  top: 70px;
  left: 50%;
  width: 176px;
  height: 76px;
  transform: translateX(-50%) perspective(240px) rotateX(6deg);
  background: linear-gradient(180deg, #ffffff, #eceef1);
  border: 1px solid rgba(210, 210, 215, 0.72);
  border-radius: 8px;
  box-shadow: 0 24px 38px rgba(0, 0, 0, 0.13);
}

.desk-surface::before,
.desk-surface::after {
  position: absolute;
  bottom: -54px;
  width: 10px;
  height: 58px;
  background: linear-gradient(180deg, #e8e8ed, #cfd2d8);
  border-radius: 999px;
  content: "";
}

.desk-surface::before {
  left: 22px;
}

.desk-surface::after {
  right: 22px;
}

.desk-screen {
  position: absolute;
  top: 38px;
  left: 50%;
  z-index: 2;
  width: 78px;
  height: 48px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #2c2c2e, #0f1012);
  border: 4px solid #1d1d1f;
  border-radius: 5px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.desk-screen::after {
  position: absolute;
  right: 18px;
  bottom: -28px;
  width: 30px;
  height: 24px;
  background: linear-gradient(180deg, #dadde3, #f7f7f8);
  clip-path: polygon(36% 0, 64% 0, 76% 100%, 24% 100%);
  content: "";
}

.desk-chair {
  position: absolute;
  top: 116px;
  left: 50%;
  z-index: 2;
  width: 72px;
  height: 78px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f7f7f8, #dfe2e7);
  border-radius: 12px 12px 32px 32px;
  box-shadow: inset 0 -12px 18px rgba(0, 0, 0, 0.06);
}

.desk-chair::after {
  position: absolute;
  left: 50%;
  bottom: -32px;
  width: 52px;
  height: 34px;
  transform: translateX(-50%);
  border-bottom: 4px solid #c9cbd1;
  border-left: 4px solid #c9cbd1;
  border-right: 4px solid #c9cbd1;
  border-radius: 0 0 34px 34px;
  content: "";
}

.desk-shadow {
  position: absolute;
  top: 142px;
  left: 50%;
  width: 210px;
  height: 72px;
  transform: translateX(-50%) skewX(-12deg);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.15), transparent 68%);
  filter: blur(5px);
}

.desk-progress {
  position: absolute;
  right: 26px;
  bottom: 20px;
  z-index: 3;
  width: 88px;
  height: 8px;
  overflow: hidden;
  background: rgba(118, 118, 128, 0.18);
  border-radius: 999px;
}

.desk-progress::after {
  display: block;
  width: var(--progress);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #30d158);
  border-radius: inherit;
  content: "";
}

.desk-status {
  position: absolute;
  bottom: 9px;
  left: 24px;
  z-index: 3;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.desk-status.running {
  color: #1f8f46;
}

.desk-status.review {
  color: var(--blue-dark);
}

.office-desk:hover .desk-surface,
.office-desk-slot.active .desk-surface {
  border-color: rgba(0, 113, 227, 0.42);
  box-shadow: 0 26px 46px rgba(0, 113, 227, 0.16);
}

.agent-popover {
  position: absolute;
  top: 32px;
  left: 50%;
  z-index: 20;
  display: grid;
  gap: 14px;
  width: min(380px, calc(100vw - 80px));
  padding: 18px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(210, 210, 215, 0.86);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px);
}

.slot-4 .agent-popover,
.slot-8 .agent-popover {
  right: 0;
  left: auto;
  transform: none;
}

.slot-1 .agent-popover,
.slot-5 .agent-popover {
  left: 0;
  transform: none;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.popover-header h4 {
  margin-bottom: 4px;
  font-size: 18px;
}

.popover-header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.agent-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.agent-card header > div {
  min-width: 0;
}

.agent-card header > .pill {
  flex: 0 0 auto;
}

.agent-card h4,
.flow-card h4,
.artifact-card h4,
.skill-card h4,
.review-card h4 {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 730;
}

.role-tag {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  background: rgba(118, 118, 128, 0.14);
  border-radius: 999px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #64d2ff);
  border-radius: inherit;
}

.todo-list,
.editor-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.todo-list li,
.editor-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.45;
}

.todo-list input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.todo-list .todo-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.todo-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 120ms ease;
}

.todo-list li:hover .todo-actions,
.workspace-item:hover .todo-actions,
.todo-actions:focus-within {
  opacity: 1;
}

.todo-action-button.icon-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.todo-action-button.icon-button svg {
  width: 15px;
  height: 15px;
}

@media (hover: none) {
  .todo-actions {
    opacity: 1;
  }
}

label.editor-row-main {
  display: flex;
  flex: 1;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
}

.editor-row-main input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--blue);
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.command-actions,
.artifact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artifact-card p,
.skill-card p,
.review-card p,
.flow-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.skill-source {
  color: var(--blue);
  font-size: 13px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.skill-source:hover {
  text-decoration: underline;
}

.panel-note {
  margin: 12px 0 14px;
  font-size: 13px;
}

.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(30px);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.artifact-modal[open] {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: min(88vh, 920px);
  overflow: hidden;
}

.artifact-modal .modal-body {
  min-height: 0;
  padding-right: 10px;
  overflow-y: scroll;
  scrollbar-color: #8a8a84 #ededeb;
  scrollbar-gutter: stable;
}

.artifact-modal .modal-body::-webkit-scrollbar {
  width: 10px;
}

.artifact-modal .modal-body::-webkit-scrollbar-track {
  background: #ededeb;
  border-radius: 5px;
}

.artifact-modal .modal-body::-webkit-scrollbar-thumb {
  background: #8a8a84;
  border: 2px solid #ededeb;
  border-radius: 5px;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.12);
}

.modal-body,
.editor-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.modal-body p {
  margin-bottom: 0;
  padding: 14px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.09);
  border-radius: 16px;
  line-height: 1.6;
}

.modal-body h2,
.modal-body h3 {
  margin: 6px 0 0;
  color: var(--ink);
}

.modal-body ul {
  margin: 0;
  padding: 14px 14px 14px 30px;
  color: var(--muted);
  background: rgba(118, 118, 128, 0.09);
  border-radius: 16px;
  line-height: 1.6;
}

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

.artifact-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
  line-height: 1.45;
}

.artifact-table th,
.artifact-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

.artifact-table th {
  color: var(--ink);
  background: rgba(118, 118, 128, 0.08);
  font-weight: 760;
}

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

.wireframe-preview {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #1d1d1f;
  background: #f5f5f7;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.editor-row {
  justify-content: space-between;
  padding: 12px;
  background: rgba(118, 118, 128, 0.08);
  border-radius: 15px;
}

.editor-row-main {
  min-width: 0;
}

.editor-row-main strong {
  display: block;
  color: var(--ink);
}

.editor-row-main span,
.form-status {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.form-status.success {
  color: #187a30;
}

.form-status.error {
  color: var(--red);
}

@media (max-width: 1180px) {
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .office-stage {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip,
  .form-grid,
  .two-column,
  .flow-grid,
  .agent-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .route-line {
    grid-template-columns: 1fr;
  }

  .routing-board {
    grid-auto-columns: minmax(235px, 86vw);
  }

  .agent-office-shell {
    min-height: 520px;
    padding: 16px;
  }

  .office-stage {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    min-width: 540px;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-strip div {
    min-height: 78px;
    padding: 12px;
  }

  .panel,
  .modal {
    padding: 18px;
    border-radius: 22px;
  }

  .segmented,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .segmented {
    display: grid;
  }

  .office-stage {
    min-width: 420px;
  }

  .agent-popover {
    width: min(330px, calc(100vw - 54px));
  }
}

/* Fluent Design refresh */
:root {
  --bg: #f3f3f3;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink: #1a1a1a;
  --muted: #616161;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --blue: #0f6cbd;
  --blue-dark: #115ea3;
  --green: #107c10;
  --orange: #bc4b09;
  --red: #c50f1f;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  font-family: "Segoe UI Variable", "Segoe UI", Aptos, sans-serif;
}

body {
  background:
    linear-gradient(135deg, rgba(15, 108, 189, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(16, 124, 16, 0.035), transparent 28%),
    #f3f3f3;
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

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

.sidebar {
  padding: 20px 12px;
  background: rgba(248, 248, 248, 0.78);
  border-right-color: rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(30px) saturate(1.25);
}

.brand-block {
  gap: 12px;
  min-height: 60px;
  padding: 4px 8px 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: #0f6cbd;
  border-radius: 8px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 650;
}

.brand-block h1 {
  font-size: 18px;
  font-weight: 600;
}

.eyebrow,
.section-label {
  margin-bottom: 4px;
  color: #707070;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

.nav-list {
  gap: 3px;
  margin: 8px 0 20px;
}

.nav-item {
  position: relative;
  min-height: 40px;
  padding: 0 12px 0 16px;
  color: #424242;
  border-radius: 4px;
  font-size: 14px;
}

.nav-item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  background: transparent;
  border-radius: 2px;
  content: "";
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.035);
}

.nav-item.active {
  color: #242424;
  background: rgba(0, 0, 0, 0.055);
  font-weight: 600;
}

.nav-item.active::before {
  background: var(--blue);
}

.leader-brief {
  margin: 0 4px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.workspace {
  gap: 16px;
  max-width: 1800px;
  width: 100%;
  padding: 24px 28px 40px;
}

.topbar {
  min-height: 132px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.25);
}

.topbar h2 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.15;
}

.topbar-copy {
  max-width: 680px;
  margin-top: 8px;
  font-size: 14px;
}

.status-strip {
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  min-width: 312px;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.status-strip div {
  min-height: 76px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 0;
}

.status-strip span {
  font-size: 28px;
  font-weight: 600;
}

.panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.2);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel h3 {
  font-size: 20px;
  font-weight: 600;
}

label {
  gap: 6px;
  color: #424242;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  min-height: 34px;
  padding: 7px 10px;
  color: #242424;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d1d1d1;
  border-bottom-color: #8a8a8a;
  border-radius: 4px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b3b3b3;
  border-bottom-color: #616161;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: #d1d1d1;
  border-bottom: 2px solid var(--blue);
  box-shadow: none;
}

.form-grid,
.two-column,
.flow-grid {
  gap: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.segment,
.mini-button,
.close-button,
.danger-button {
  min-height: 32px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  transition: background 100ms ease, border-color 100ms ease, box-shadow 100ms ease;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  padding: 0 16px;
}

.compact-button {
  min-height: 32px;
  padding: 0 12px;
}

.primary-button {
  background: var(--blue);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  color: #242424;
  background: #fff;
  border-color: #d1d1d1;
}

.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover {
  background: #f5f5f5;
}

.ghost-button,
.mini-button {
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.74);
  border-color: #d1d1d1;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.segment:hover,
.danger-button:hover {
  transform: none;
}

.danger-button {
  color: var(--red);
  background: #fff;
  border-color: #d1d1d1;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}

.segmented {
  gap: 2px;
  padding: 3px;
  background: #ebebeb;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.segment {
  padding: 0 12px;
  border-radius: 4px;
}

.segment.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.flow-card,
.agent-card,
.skill-card,
.artifact-card,
.review-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--line-strong);
  border-radius: 6px;
}

.flow-card:hover,
.skill-card:hover,
.artifact-card:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.2);
}

.pill {
  min-height: 22px;
  padding: 0 8px;
  background: #f0f0f0;
  border: 0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.pill.high {
  color: #a4262c;
  background: #fde7e9;
}

.pill.running {
  color: #0f548c;
  background: #e5f1fb;
}

.pill.review {
  color: #8a3707;
  background: #fcebdc;
}

.pill.done {
  color: #0e700e;
  background: #dff6dd;
}

.route-step {
  border-radius: 4px;
}

.route-step.active {
  background: var(--blue);
}

.run-status {
  padding: 10px 12px;
  color: #0f548c;
  background: #eff6fc;
  border-color: #b4d6fa;
  border-radius: 4px;
}

.routing-board {
  grid-auto-columns: minmax(244px, 1fr);
  gap: 10px;
}

.routing-lane {
  min-height: 420px;
  padding: 14px;
  background: rgba(250, 250, 250, 0.74);
  border-color: var(--line-strong);
  border-radius: 6px;
}

.routing-lane:not(:last-child)::after {
  top: 28px;
  right: -9px;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1px solid #c7c7c7;
  border-radius: 50%;
  color: var(--blue);
  content: "›";
}

.routing-lane header {
  min-height: 116px;
}

.lane-number {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: #0f548c;
  background: #e5f1fb;
  border-radius: 4px;
  font-weight: 600;
}

.route-task {
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.route-task.current {
  border-color: #62abf5;
  box-shadow: inset 3px 0 0 var(--blue), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.route-task.passed {
  opacity: 0.68;
}

.empty-lane {
  border-radius: 4px;
}

.agent-office-shell {
  min-height: 600px;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    rgba(245, 245, 245, 0.72);
  background-size: 40px 40px;
  border-color: var(--line-strong);
  border-radius: 6px;
}

.office-stage {
  gap: 32px 24px;
  min-height: 550px;
}

.desk-label {
  font-weight: 600;
}

.desk-surface {
  background: linear-gradient(180deg, #fff, #ededed);
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.11);
}

.desk-screen {
  background: linear-gradient(180deg, #163a59, #0c1f30);
  border-color: #292929;
  border-radius: 3px;
}

.desk-chair {
  background: linear-gradient(180deg, #f5f5f5, #d6d6d6);
  border-radius: 6px 6px 24px 24px;
}

.desk-progress,
.progress-bar {
  height: 4px;
  border-radius: 2px;
}

.desk-progress::after,
.progress-bar span {
  background: var(--blue);
}

.desk-status {
  border-radius: 3px;
  font-weight: 600;
}

.agent-popover {
  border-color: rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(30px) saturate(1.2);
}

.modal {
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.28);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

.close-button {
  top: 12px;
  right: 12px;
  width: 32px;
  min-height: 32px;
  background: transparent;
}

.close-button:hover {
  background: #e8e8e8;
}

.modal-body p,
.modal-body ul,
.editor-row {
  background: #f5f5f5;
  border-radius: 4px;
}

.artifact-table-wrap,
.wireframe-preview {
  border-radius: 4px;
}

.artifact-table th {
  background: #f5f5f5;
  font-weight: 600;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
  }

  .nav-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 4px 0 12px;
    padding-bottom: 3px;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .nav-item::before {
    top: auto;
    right: 10px;
    bottom: 0;
    left: 10px;
    width: auto;
    height: 3px;
  }

  .leader-brief {
    display: none;
  }
}

@media (max-width: 560px) {
  .workspace {
    gap: 12px;
    padding: 12px;
  }

  .topbar,
  .panel,
  .modal {
    padding: 16px;
    border-radius: 6px;
  }

  .topbar h2 {
    font-size: 28px;
  }

  .status-strip {
    min-width: 0;
  }

  .status-strip div {
    min-height: 66px;
    padding: 10px;
  }

  .status-strip span {
    font-size: 22px;
  }
}

/* Fluent 2 application shell */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #242424;
  --muted: #616161;
  --line: #e0e0e0;
  --line-strong: #c7c7c7;
  --blue: #0f6cbd;
  --blue-dark: #115ea3;
  --green: #107c10;
  --orange: #bc4b09;
  --red: #c50f1f;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 0 2px rgba(0, 0, 0, 0.12);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 4px;
  font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
}

html {
  background: var(--bg);
}

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

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

.sidebar {
  z-index: 10;
  padding: 16px 12px;
  background: #fafafa;
  border-right: 1px solid var(--line);
  backdrop-filter: none;
}

.brand-block {
  min-height: 56px;
  padding: 4px 8px 16px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--blue);
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
}

.brand-block h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.eyebrow,
.section-label {
  color: #707070;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.nav-list {
  gap: 2px;
  margin: 4px 0 20px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 16px;
  color: #424242;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.nav-item:hover {
  color: #242424;
  background: #f0f0f0;
}

.nav-item.active {
  color: #242424;
  background: #ebebeb;
  font-weight: 600;
}

.nav-item.active::before {
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--blue);
}

.settings-trigger {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 4px 4px;
}

.leader-brief {
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: none;
}

.workspace {
  align-content: start;
  gap: 16px;
  max-width: none;
  min-width: 0;
  padding: 24px 32px 40px;
}

.topbar {
  min-height: 112px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.topbar h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 36px;
}

.topbar-copy {
  margin-top: 4px;
  font-size: 14px;
  line-height: 20px;
}

.status-strip {
  min-width: 300px;
  background: var(--line);
  border-color: var(--line);
}

.status-strip div {
  min-height: 68px;
  background: #fff;
}

.status-strip span {
  font-size: 24px;
  line-height: 32px;
}

.page-view {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.page-view[hidden] {
  display: none;
}


.panel {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.panel h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.panel-heading {
  margin-bottom: 16px;
}

.command-panel .command-form,
#skills .skill-form {
  max-width: 880px;
}

.skill-agent-selector {
  max-width: 420px;
  margin-bottom: 10px;
}

#skills > .panel-note {
  margin-bottom: 16px;
}

.skill-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 880px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.skill-action-bar .section-label {
  margin-right: auto;
}

.skill-action-icon.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.skill-action-icon.icon-button:hover,
.skill-action-icon.icon-button.active {
  color: var(--blue);
  background: #eef6ff;
  border-color: #78b7f5;
}

.skill-action-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.local-skill-import {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: 16px 24px;
  max-width: 880px;
  margin-top: 12px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
}

.local-skill-import[hidden] {
  display: none;
}

.skill-editor-card {
  display: grid;
  gap: 14px;
  max-width: 880px;
  margin-top: 12px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
}

.skill-editor-card[hidden] {
  display: none;
}

.skill-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.skill-editor-heading h4 {
  margin-top: 2px;
  font-size: 16px;
}

.local-skill-import h4 {
  margin: 2px 0 4px;
  font-size: 16px;
}

.local-skill-import p {
  color: var(--muted);
}

.local-skill-import code {
  color: var(--ink);
  font-size: 0.9em;
}

.local-skill-controls {
  display: grid;
  gap: 10px;
}

.local-skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-skill-import > .form-status {
  grid-column: 1 / -1;
  margin: 0;
}

#skills .skill-list,
#outputs .artifact-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.skill-form-actions,
.skill-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.skill-prompt-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 4px;
}

.skill-prompt-preview strong {
  font-size: 12px;
}

.skill-prompt-preview p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
}

#outputs .artifact-tabs {
  margin-bottom: 16px;
}

.flow-card,
.agent-card,
.skill-card,
.artifact-card,
.review-card,
.route-task {
  background: #fff;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.flow-card:hover,
.skill-card:hover,
.artifact-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.agent-office-shell {
  background: #fafafa;
  border-color: var(--line);
  border-radius: 8px;
}

.routing-lane {
  background: #fafafa;
  border-color: var(--line);
  border-radius: 8px;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button,
.danger-button,
.segment {
  min-height: 32px;
  border-radius: 4px;
  font-weight: 600;
}

.primary-button {
  background: var(--blue);
}

.secondary-button,
.ghost-button,
.mini-button {
  color: #242424;
  background: #fff;
  border-color: #d1d1d1;
}

.segmented {
  background: #f0f0f0;
  border-radius: 6px;
}

.segment.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

input,
select,
textarea {
  min-height: 32px;
  background: #fff;
  border-color: #d1d1d1;
  border-bottom-color: #8a8a8a;
  border-radius: 4px;
}

.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), 0 2px 4px rgba(0, 0, 0, 0.12);
  backdrop-filter: none;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: none;
}

.settings-modal {
  width: min(620px, calc(100vw - 32px));
  padding: 24px;
}

.settings-heading {
  padding-right: 32px;
}

.settings-form {
  max-width: none;
}

.settings-actions {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .page-view.active {
    animation: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px 8px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 0 12px;
  }

  .settings-trigger {
    margin: 0;
    border: 0;
    border-radius: 4px;
  }

  .nav-item.active::before {
    top: auto;
    right: 10px;
    bottom: 0;
    left: 10px;
    width: auto;
    height: 3px;
  }

  .workspace {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 12px;
  }

  .topbar,
  .panel,
  .settings-modal {
    padding: 16px;
  }

  .topbar h2 {
    font-size: 24px;
    line-height: 32px;
  }

  .settings-modal .form-grid {
    grid-template-columns: 1fr;
  }

  #skills .skill-list,
  #outputs .artifact-list {
    grid-template-columns: 1fr;
  }

  .local-skill-import {
    grid-template-columns: 1fr;
  }

  .agent-roster-list,
  .agent-create-form {
    grid-template-columns: 1fr;
  }

  .agent-roster-row {
    align-items: flex-start;
  }

  .agent-roster-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.icon-button,
.icon-button.danger-button {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.icon-button.danger-button {
  color: var(--red);
}

.icon-button:hover,
.icon-button.danger-button:hover {
  background: #f0f0f0;
  border-color: transparent;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-agents {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line);
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

.sidebar-section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.sidebar-agent-count {
  min-width: 22px;
  padding: 2px 7px;
  color: var(--muted);
  background: #f0f0f0;
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
}

.sidebar-agent-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 4px;
}

.sidebar-agent-row:hover {
  background: #f0f0f0;
}

.sidebar-agent-main,
.sidebar-agent-actions button {
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.sidebar-agent-main {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px;
  text-align: left;
}

.agent-presence {
  width: 8px;
  height: 8px;
  background: #a19f9d;
  border-radius: 50%;
}

.agent-presence.running {
  background: var(--green);
}

.agent-presence.review {
  background: var(--orange);
}

.agent-presence.done {
  background: var(--blue);
}

.sidebar-agent-copy {
  display: grid;
  min-width: 0;
}

.sidebar-agent-copy strong,
.sidebar-agent-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-agent-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.sidebar-agent-copy small {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-agent-actions {
  display: flex;
  padding-right: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.sidebar-agent-row:hover .sidebar-agent-actions,
.sidebar-agent-row:focus-within .sidebar-agent-actions {
  opacity: 1;
}

.sidebar-agent-actions button {
  display: grid;
  width: 28px;
  min-height: 28px;
  padding: 5px;
  place-items: center;
  border-radius: 4px;
}

.sidebar-agent-actions button:hover {
  background: #e5e5e5;
}

.sidebar-agent-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.agent-workspace-modal {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  min-height: min(540px, calc(100dvh - 32px));
  padding: 24px;
  overflow: hidden;
}

.agent-workspace-modal[open] {
  display: grid;
}

.agent-workspace-role {
  max-width: 640px;
  margin: 4px 36px 18px 0;
  color: var(--muted);
  line-height: 1.5;
}

.agent-workspace-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: #f0f0f0;
  border-radius: 6px;
}

.workspace-tab {
  min-height: 34px;
  padding: 6px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
}

.workspace-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.agent-workspace-panel,
.agent-action-form {
  display: grid;
  gap: 14px;
}

.agent-workspace-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.agent-workspace-panel[hidden] {
  display: none;
}

.agent-action-form {
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.agent-action-form .primary-button {
  justify-self: start;
}

.workspace-item-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.workspace-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.workspace-item label {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
  font-size: 14px;
}

.workspace-item label span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workspace-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
}

.workflow-content {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.workflow-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workflow-skill {
  padding: 3px 8px;
  color: #443997;
  background: var(--blue-soft);
  border: 1px solid #d5d0f3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}

.workflow-run-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Function tabs and run feedback span both columns beside the Figma input and action. */
.workflow-run-form[data-component-mode] > :not(label):not(button) {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-run-form[data-component-mode] > .sa-functions { margin-bottom: 0; }

@media (max-width: 640px) {
  #workflowDetailContent:has([data-component-mode]) .workflow-detail-stats > span { flex: 1; min-width: 0; }
}

.workflow-run-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workflow-run-form label span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.workflow-run-form input {
  width: 100%;
  min-width: 0;
}

.workflow-run-form .primary-button {
  white-space: nowrap;
}

.workflow-steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.workflow-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-steps li {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.workflow-step-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-steps small {
  color: var(--muted);
}

.string-assistant-form {
  grid-template-columns: 1fr;
}

.string-assistant-operation {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 12px 16px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.string-assistant-operation legend {
  padding: 0 6px;
  font-weight: 600;
}

.string-assistant-operation input,
.string-assistant-operation select {
  max-width: 100%;
}

.string-assistant-operation button {
  justify-self: start;
}

.string-assistant-preview-scroll {
  max-height: 420px;
  overflow: auto;
}

.string-assistant-preview table {
  width: 100%;
  border-collapse: collapse;
}

.string-assistant-preview th,
.string-assistant-preview td {
  padding: 8px;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workflow-file-button,
.workflow-download {
  display: inline-flex !important;
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.workflow-file-button span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

.workflow-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workflow-file-button.disabled {
  pointer-events: none;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .workflow-run-form {
    grid-template-columns: 1fr;
  }

  .workflow-run-form .primary-button {
    justify-self: start;
  }

  .workflow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-actions > * {
    width: 100%;
  }
}

.workspace-empty {
  padding: 22px;
  color: var(--muted);
  background: #fafafa;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  text-align: center;
}

.agent-conversation {
  display: flex;
  max-height: 360px;
  min-height: 280px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.message-bubble {
  max-width: 82%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message-bubble.user {
  align-self: flex-end;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.message-bubble p {
  margin: 3px 0 4px;
  line-height: 1.45;
}

.message-bubble time {
  display: block;
  color: inherit;
  font-size: 10px;
  opacity: 0.72;
}

.agent-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.agent-message-composer { position: relative; min-width: 0; }
.agent-message-composer textarea { display: block; width: 100%; min-height: 48px; padding: 12px 14px; resize: vertical; }
.agent-skill-picker {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e1);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(30, 30, 28, .12);
}
.agent-skill-picker[hidden], .agent-selected-skill[hidden] { display: none; }
.agent-skill-picker-heading { padding: 8px 10px 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
.agent-skill-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.agent-skill-option:hover, .agent-skill-option.active, .agent-skill-option:focus-visible { background: var(--bg, #f0f0ee); outline: none; }
.agent-skill-option-icon { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; color: var(--blue, #6658cf); font-size: 17px; }
.agent-skill-option-copy { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.agent-skill-option-copy strong { font-size: 12px; font-weight: 600; }
.agent-skill-option-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.agent-skill-picker-empty { padding: 16px 12px; color: var(--muted); font-size: 12px; }
.agent-selected-skill { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; color: var(--blue, #6658cf); font-size: 11px; }
.agent-selected-skill button { padding: 0 4px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.message-skill-tag { display: inline-block; margin-top: 5px; padding: 3px 7px; color: var(--blue, #6658cf); background: var(--bg, #f0f0ee); border-radius: 999px; font-size: 10px; }

@media (max-width: 900px) {
  .sidebar {
    overflow: visible;
  }

  .sidebar-agents {
    flex: none;
    border-top: 0;
  }

  .sidebar-agent-list {
    display: flex;
    overflow-x: auto;
  }

  .sidebar-agent-row {
    flex: 0 0 210px;
    background: #f5f5f5;
  }

  .sidebar-agent-actions {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .agent-workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tab {
    flex: 0 0 auto;
  }

  .agent-message-form {
    grid-template-columns: 1fr;
  }
}

.nav-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.settings-trigger {
  display: grid;
  width: 40px;
  min-height: 40px;
  margin-top: auto;
  padding: 0;
  place-items: center;
  border-top: 0;
  border-radius: 4px;
}

.settings-trigger svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.agent-page-actions {
  align-items: center;
}

.agent-page-create-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 820px;
  margin-bottom: 18px;
}

.agent-page-create-form .agent-create-actions {
  grid-column: 1 / -1;
}

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

.agent-card {
  align-content: start;
  min-width: 0;
}

.agent-card header {
  align-items: flex-start;
}

.agent-card .todo-list {
  min-height: 76px;
}

.compact-empty {
  width: 100%;
  padding: 12px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
  }

  .settings-trigger {
    flex: 0 0 40px;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .agent-grid,
  .agent-page-create-form {
    grid-template-columns: 1fr;
  }
}

.agent-manager-modal {
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.agent-manager-modal > .close-button {
  top: 22px;
  right: 22px;
  z-index: 4;
}

.agent-manager-header {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--line);
}

.agent-manager-header h3 {
  margin: 0;
  font-size: 26px;
  line-height: 34px;
}

.agent-manager-header p:last-child {
  margin: 6px 48px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.agent-manager-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100% - 112px);
  min-height: 0;
}

.agent-manager-sidebar {
  min-height: 0;
  padding: 22px 18px;
  overflow-y: auto;
  background: #fafafa;
  border-right: 1px solid var(--line);
}

.agent-manager-group-label {
  margin: 0 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.agent-manager-group-label:not(:first-child) {
  margin-top: 24px;
}

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

.agent-manager-new,
.agent-manager-item {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
}

.agent-manager-new:hover,
.agent-manager-item:hover {
  background: #f4f4f4;
}

.agent-manager-new.active,
.agent-manager-item.active {
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.agent-manager-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #0f548c;
  background: #dceeff;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
}

.agent-manager-avatar.review {
  color: #854a0e;
  background: #fce8d0;
}

.agent-manager-avatar.done {
  color: #0b6a0b;
  background: #dff6dd;
}

.agent-manager-new strong,
.agent-manager-new small,
.agent-manager-item strong,
.agent-manager-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-manager-new strong,
.agent-manager-item strong {
  font-size: 14px;
}

.agent-manager-new small,
.agent-manager-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.agent-manager-form {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.agent-manager-scroll {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 0;
  padding: 28px 32px;
  overflow-y: auto;
}

.agent-manager-scroll label > span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.agent-manager-scroll label em {
  color: var(--red);
  font-style: normal;
}

.agent-manager-scroll output {
  float: right;
  color: var(--muted);
  font-weight: 500;
}

.agent-manager-scroll textarea {
  min-height: 88px;
}

.agent-capability-section {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.agent-capability-section h4 {
  margin: 0;
  font-size: 16px;
}

.agent-capability-section > div > p {
  margin: 4px 0 0;
  color: var(--muted);
}

.agent-capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-capability-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.agent-capability-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--blue);
  background: #eaf3fc;
  border-radius: 8px;
}

.agent-capability-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.agent-capability-card strong,
.agent-capability-card small {
  display: block;
}

.agent-capability-card small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.agent-manager-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 32px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.agent-manager-footer button {
  min-width: 110px;
}

@media (max-width: 820px) {
  .agent-manager-modal {
    height: calc(100vh - 16px);
  }

  .agent-manager-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .agent-manager-sidebar {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .agent-manager-group-label {
    display: none;
  }

  .agent-manager-list {
    display: flex;
    gap: 8px;
  }

  .agent-manager-new,
  .agent-manager-item {
    width: 210px;
    flex: 0 0 210px;
  }

  .agent-capability-grid {
    grid-template-columns: 1fr;
  }
}

/* Codex-inspired theme ---------------------------------------------------- */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #20201f;
  --muted: #6f6f6b;
  --line: #e5e5e1;
  --line-strong: #d4d4ce;
  --blue: #675bcb;
  --blue-dark: #574bb7;
  --blue-soft: #eeecfb;
  --control-track: #f0f0ee;
  --control-selected-ink: #352f70;
  --green: #267a43;
  --orange: #a86514;
  --red: #b44848;
  --shadow: 0 1px 2px rgba(30, 30, 28, 0.05), 0 10px 30px rgba(30, 30, 28, 0.045);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  scrollbar-color: #c8c8c2 transparent;
  scrollbar-width: thin;
}

::selection {
  color: #241f4a;
  background: #dcd8f7;
}

body {
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(103, 91, 203, 0.2);
  outline-offset: 2px;
}

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

.sidebar {
  width: auto;
  min-height: 100vh;
  padding: 14px 10px 12px;
  color: #3d3d3a;
  background: #f0f0ed;
  border-right: 1px solid #dfdfda;
}

.brand-block {
  gap: 10px;
  min-height: 52px;
  padding: 7px 8px 15px;
}

.brand-block h1 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-block p {
  margin-top: 2px;
  color: #81817c;
  font-size: 11px;
}

.brand-mark {
  width: 32px;
  min-width: 32px;
  height: 32px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 9px;
  box-shadow: none;
}

.nav-list {
  gap: 3px;
  margin-top: 4px;
}

.nav-item {
  min-height: 38px;
  padding: 0 12px;
  color: #5d5d59;
  font-size: 13px;
  font-weight: 520;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-item::before {
  display: none;
}

.nav-item:hover {
  color: #31312f;
  background: rgba(255, 255, 255, 0.62);
}

.nav-item.active {
  color: #352f70;
  background: #fff;
  border-color: #e5e4df;
  box-shadow: 0 1px 2px rgba(31, 31, 29, 0.06);
}

.settings-trigger {
  width: 38px;
  height: 38px;
  min-height: 38px;
  margin-top: auto;
  color: #686863;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
}

.settings-trigger:hover,
.settings-trigger.active {
  color: var(--blue);
  background: #fff;
  border-color: #e1e1dc;
}

.workspace {
  width: 100%;
  max-width: 1600px;
  padding: 22px 28px 48px;
  gap: 14px;
}

.topbar {
  min-height: 70px;
  padding: 4px 2px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.topbar h2 {
  margin: 2px 0 5px;
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.subtitle {
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-strip {
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  background: var(--line);
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}

.status-strip > div {
  min-width: 84px;
  min-height: 54px;
  padding: 9px 12px;
  background: #fff;
  border: 0;
}

.status-strip > div:first-child {
  border-radius: 9px 0 0 9px;
}

.status-strip > div:last-child {
  border-radius: 0 9px 9px 0;
}

.status-strip span {
  color: #85857f;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-strip strong {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 650;
}

.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-heading {
  gap: 12px;
  margin-bottom: 17px;
}

.panel-heading h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value,
.overview-value {
  color: var(--ink);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.mini-button,
.segment,
.workspace-tab,
.workflow-add,
.workflow-edit,
.workflow-delete {
  min-height: 34px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 620;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button,
.mini-button,
.workflow-add,
.workflow-edit {
  color: #4b4b47;
  background: #fff;
  border-color: var(--line-strong);
}

.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.workflow-add:hover,
.workflow-edit:hover {
  color: #372f7b;
  background: var(--blue-soft);
  border-color: #c9c3ee;
}

.danger-button,
.workflow-delete {
  color: #a73d3d;
  background: #fff;
  border-color: #e3c8c8;
}

.danger-button:hover,
.workflow-delete:hover {
  background: #fff3f3;
  border-color: #dcaeae;
}

.icon-button {
  color: #676762;
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
}

.icon-button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.agent-add-icon {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  color: var(--blue);
  background: var(--blue-soft);
  border-color: transparent;
  border-radius: 8px;
}

.agent-add-icon:hover,
.agent-add-icon.active {
  color: #fff;
  background: var(--blue);
}

.segment-control {
  gap: 2px;
  padding: 3px;
  background: #f0f0ed;
  border: 1px solid #e4e4df;
  border-radius: 10px;
}

.segment {
  color: #72726d;
  background: transparent;
  border: 0;
}

.segment.active {
  color: #332c73;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 3px rgba(31, 31, 29, 0.1);
}

.agent-grid,
.skill-grid,
.artifact-grid {
  gap: 12px;
}

.agent-card,
.skill-card,
.artifact-card,
.overview-card,
.activity-item,
.workflow-item,
.chat-panel,
.task-panel {
  background: #fdfdfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.agent-card,
.skill-card,
.artifact-card {
  padding: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.agent-card:hover,
.skill-card:hover,
.artifact-card:hover {
  border-color: #c9c3ee;
  box-shadow: 0 8px 24px rgba(56, 48, 117, 0.08);
  transform: translateY(-2px);
}

.agent-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.agent-avatar,
.manager-agent-avatar,
.workspace-agent-avatar,
.activity-avatar {
  color: #453b96;
  background: var(--blue-soft);
  border-color: #ddd8f7;
}

.agent-card h4,
.skill-card h4,
.artifact-card h4 {
  color: var(--ink);
  font-weight: 650;
}

.agent-role,
.skill-description,
.artifact-description,
.workflow-item p {
  color: var(--muted);
}

.status-pill,
.tag,
.skill-count,
.route-count,
.task-status {
  color: #5f5f5a;
  background: #f1f1ee;
  border-color: #e1e1dc;
  border-radius: 999px;
}

.status-pill.active,
.status-pill.online,
.task-status.done {
  color: #25623a;
  background: #edf7f0;
  border-color: #cee7d5;
}

.status-pill.busy,
.task-status.running {
  color: #443997;
  background: var(--blue-soft);
  border-color: #d5d0f3;
}

.progress-bar {
  height: 5px;
  overflow: hidden;
  background: #ecece8;
  border-radius: 999px;
}

.progress-bar span {
  background: var(--blue);
  border-radius: inherit;
}

.agent-actions,
.artifact-actions,
.skill-actions {
  padding-top: 12px;
  border-top: 1px solid #eeeeea;
}

input,
select,
textarea,
.task-input {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 31, 29, 0.025);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bdbdb6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(103, 91, 203, 0.12);
  outline: none;
}

label,
.field-label {
  color: #474743;
  font-size: 12px;
  font-weight: 620;
}

.routing-board {
  gap: 10px;
}

.routing-lane {
  padding: 13px;
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-width: 0;
  overflow: hidden;
}

.routing-lane header,
.lane-task-list {
  min-width: 0;
}

.routing-lane header h4,
.routing-lane header p {
  overflow-wrap: anywhere;
}

.route-task {
  background: #fff;
  border: 1px solid #e2e2dd;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 31, 29, 0.035);
  height: 200px;
  min-width: 0;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: start;
}

.route-task h4 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.route-task p {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

.route-task .flow-meta {
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
}

.route-task .pill {
  flex-shrink: 0;
}

.route-task .command-actions {
  flex-wrap: nowrap;
}

.route-task.current {
  border-color: #c9c3ee;
  box-shadow: inset 3px 0 0 var(--blue);
}

.run-status,
.flow-node.active,
.flow-edge.active {
  color: #403690;
  background: var(--blue-soft);
  border-color: #d4cff2;
}

.modal {
  overflow: hidden;
  background: #fff;
  border: 1px solid #deded8;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(27, 26, 24, 0.2);
}

.modal::backdrop {
  background: rgba(31, 30, 28, 0.34);
  backdrop-filter: blur(3px);
}

.modal-header,
.modal-footer {
  background: #fff;
  border-color: var(--line);
}

.modal-close {
  color: #686863;
  background: #f4f4f1;
  border: 1px solid transparent;
  border-radius: 8px;
}

.modal-close:hover {
  color: var(--ink);
  background: #ebebe7;
}

.agent-manager-modal {
  border-radius: 16px;
}

.agent-manager-layout {
  background: #fff;
}

.agent-manager-list {
  background: #f6f6f3;
  border-right-color: var(--line);
}

.agent-manager-list-item {
  color: #4f4f4b;
  background: transparent;
  border-color: transparent;
  border-radius: 9px;
  box-shadow: none;
}

.agent-manager-list-item:hover {
  background: #fff;
  border-color: #e6e6e1;
}

.agent-manager-list-item.active {
  color: #342c76;
  background: var(--blue-soft);
  border-color: #c9c3ee;
  box-shadow: none;
}

.agent-manager-form,
.agent-manager-scroll {
  background: #fff;
}

.agent-capability-card {
  background: #fafaf8;
  border-color: var(--line);
  border-radius: 10px;
}

.agent-capability-card.selected {
  background: var(--blue-soft);
  border-color: #c5beed;
  box-shadow: inset 0 0 0 1px #c5beed;
}

.workspace-tabs {
  gap: 3px;
  padding: 3px;
  background: #f0f0ed;
  border: 1px solid #e4e4df;
  border-radius: 10px;
}

.workspace-tab {
  color: #6a6a65;
  background: transparent;
  border: 0;
}

.workspace-tab.active {
  color: #352e77;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 31, 29, 0.1);
}

.chat-message.agent {
  background: #f1f1ee;
  border-color: #e3e3de;
}

.chat-message.user {
  color: #312a6d;
  background: var(--blue-soft);
  border-color: #d3cef2;
}

.toast {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  width: min(390px, calc(100vw - 32px));
  padding: 14px 14px 14px 16px;
  color: #fff;
  background: #292927;
  border: 1px solid #3b3b38;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(28, 28, 26, 0.2);
  animation: toast-in 180ms ease-out;
}

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  pointer-events: none;
}

.toast-region .toast {
  pointer-events: auto;
}

.toast-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.toast-content strong {
  font-size: 14px;
}

.toast-content span {
  overflow: hidden;
  color: #d6d6d2;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.toast-link,
.toast-close {
  color: #fff;
  background: transparent;
  border: 0;
}

.toast-link {
  padding: 7px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
}

.toast-link:hover,
.toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.toast-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 4px;
  font-size: 18px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid #dfdfda;
  }

  .brand-block {
    min-height: 42px;
    padding: 2px 4px 8px;
  }

  .nav-list {
    gap: 4px;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .settings-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
  }

  .workspace {
    padding: 18px 18px 36px;
  }
}

@media (max-width: 600px) {
  .workspace {
    padding: 14px 12px 28px;
  }

  .topbar {
    gap: 14px;
    padding-bottom: 14px;
  }

  .status-strip {
    width: 100%;
  }

  .status-strip > div {
    flex: 1;
    min-width: 0;
  }

  .panel {
    padding: 15px;
    border-radius: 12px;
  }

  .agent-grid,
  .skill-grid,
  .artifact-grid {
    grid-template-columns: 1fr;
  }
}

/* Agent Board home ------------------------------------------------------- */
.agent-board-panel {
  padding: 18px;
  overflow: visible;
}

.agent-board-heading {
  position: relative;
  align-items: center;
  padding: 2px 2px 0;
}

.board-agent-menu {
  position: relative;
  z-index: 45;
  margin-left: auto;
}

.board-agent-list-trigger {
  color: #625b55;
  background: #f5f5f2;
  border: 1px solid #deded8;
}

.board-agent-list-trigger:hover,
.board-agent-list-trigger.active {
  color: #4a409c;
  background: #eeecfb;
  border-color: #c9c3ee;
}

.board-agent-list-trigger svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.board-agent-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(286px, calc(100vw - 48px));
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dcdcd6;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(31, 30, 28, 0.18);
  backdrop-filter: blur(18px);
}

.board-agent-popover[hidden] {
  display: none;
}

.board-agent-popover-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
}

.board-agent-popover-header > div {
  display: grid;
  gap: 2px;
}

.board-agent-popover-header strong {
  font-size: 12px;
}

.board-agent-popover-header span {
  color: var(--muted);
  font-size: 10px;
}

.local-save-indicator {
  padding: 3px 6px;
  color: #28643c !important;
  background: #edf7f0;
  border-radius: 999px;
  font-size: 9px !important;
  font-weight: 650;
  white-space: nowrap;
}

.board-agent-list {
  display: grid;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.board-agent-option {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
  color: #3f3f3b;
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.board-agent-option:hover {
  background: #f5f5f2;
}

.board-agent-option.is-hidden {
  color: #898983;
}

.board-agent-option-dot {
  width: 7px;
  height: 7px;
  background: #8d8d87;
  border-radius: 50%;
}

.board-agent-option-dot.running {
  background: #675bcb;
}

.board-agent-option-dot.review {
  background: #b66a18;
}

.board-agent-option-dot.done {
  background: #267a43;
}

.board-agent-option-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-agent-option-state {
  padding: 3px 6px;
  color: #50469d;
  background: #eeecfb;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 650;
}

.board-agent-option.is-hidden .board-agent-option-state {
  color: #777771;
  background: #efefec;
}

.board-agent-show-all {
  width: calc(100% - 12px);
  min-height: 32px;
  margin: 0 6px 6px;
  color: #51479f;
  background: #f7f6fd;
  border: 1px solid #ddd8f5;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 650;
}

.board-agent-show-all:hover {
  background: #eeecfb;
  border-color: #c9c3ee;
}

.board-agent-show-all[hidden] {
  display: none;
}

.agent-office-shell {
  position: relative;
  min-height: 590px;
  overflow: auto;
  padding: 22px;
  background-color: #f5f5f2;
  background-image:
    linear-gradient(rgba(103, 91, 203, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 91, 203, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.95), transparent 52%);
  background-size: 32px 32px, 32px 32px, auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.office-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 28px 12px;
  min-width: 880px;
  min-height: 530px;
  padding: 34px 2px 12px;
}

.office-desk-slot {
  position: relative;
  min-height: 230px;
}

.office-desk {
  position: relative;
  display: block;
  width: 100%;
  min-height: 230px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.desk-label {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 4;
  display: grid;
  gap: 0;
  width: calc(100% - 14px);
  min-height: 20px;
  transform: translateX(-50%);
  text-align: center;
}

.desk-label strong {
  overflow: hidden;
  color: #292927;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-ip {
  position: absolute;
  top: 31px;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 12px rgba(36, 31, 76, 0.13));
  transition: transform 180ms ease, filter 180ms ease;
  pointer-events: none;
}

.desk-ip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.desk-surface {
  position: absolute;
  top: 145px;
  left: 50%;
  z-index: 2;
  width: 148px;
  height: 45px;
  transform: translateX(-50%) perspective(220px) rotateX(7deg);
  background: #ffffff;
  border: 1px solid #d9d9d3;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(39, 39, 36, 0.09);
}

.desk-surface::before,
.desk-surface::after {
  position: absolute;
  bottom: -31px;
  width: 7px;
  height: 33px;
  background: #cfcfc9;
  border-radius: 0 0 4px 4px;
  content: "";
}

.desk-surface::before {
  left: 16px;
}

.desk-surface::after {
  right: 16px;
}

.desk-screen,
.desk-chair {
  display: none;
}

.desk-shadow {
  position: absolute;
  top: 181px;
  left: 50%;
  z-index: 1;
  width: 158px;
  height: 28px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(42, 42, 39, 0.14), transparent 69%);
  filter: blur(5px);
}

.desk-status {
  position: absolute;
  bottom: 31px;
  left: 50%;
  z-index: 4;
  padding: 3px 7px;
  transform: translateX(-50%);
  color: #655f58;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #deded8;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.desk-status.running {
  color: #443997;
  background: #eeecfb;
  border-color: #d4cff2;
}

.desk-status.review {
  color: #8b5313;
  background: #fff4e9;
  border-color: #efd8bb;
}

.office-desk:hover .desk-ip,
.office-desk-slot.active .desk-ip {
  transform: translateX(-50%) translateY(-5px) scale(1.04);
  filter: drop-shadow(0 16px 15px rgba(58, 48, 132, 0.2));
}

.office-desk:hover .desk-surface,
.office-desk-slot.active .desk-surface {
  border-color: #bdb5ea;
  box-shadow: 0 12px 24px rgba(74, 64, 151, 0.13);
}

.agent-popover {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 30;
  display: grid;
  gap: 13px;
  width: min(350px, calc(100vw - 72px));
  padding: 16px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dcdcd6;
  border-radius: 12px;
  box-shadow: 0 20px 55px rgba(31, 30, 28, 0.2);
  backdrop-filter: blur(18px);
}

.slot-1 .agent-popover,
.slot-6 .agent-popover {
  left: 0;
  transform: none;
}

.slot-5 .agent-popover,
.slot-10 .agent-popover {
  right: 0;
  left: auto;
  transform: none;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.popover-header h4 {
  margin: 2px 0 4px;
  font-size: 16px;
}

.popover-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.desk-popover-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.desk-popover-metrics span {
  display: grid;
  gap: 2px;
  padding: 9px 8px;
  color: var(--muted);
  background: #fafaf8;
  font-size: 9px;
  text-align: center;
}

.desk-popover-metrics strong {
  color: var(--ink);
  font-size: 12px;
}

.desk-task-preview {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  color: #555550;
  font-size: 11px;
  line-height: 1.4;
  list-style: none;
}

.desk-task-preview li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 5px;
}

.desk-task-preview li.done {
  color: #85857f;
}

.desk-task-preview li span {
  color: #675bcb;
  font-weight: 700;
}

.agent-popover .agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 11px;
}

.agent-popover {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.agent-popover > *,
.popover-header > div,
.desk-task-preview li {
  min-width: 0;
  max-width: 100%;
}

.popover-header p,
.desk-task-preview li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.desk-task-preview li {
  grid-template-columns: 14px minmax(0, 1fr);
}

.desk-task-preview li:only-child:not(:has(span)) {
  display: block;
}

@media (max-width: 1180px) {
  .office-stage {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    min-width: 720px;
  }

  .slot-5 .agent-popover,
  .slot-10 .agent-popover {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .slot-4 .agent-popover,
  .slot-8 .agent-popover {
    right: 0;
    left: auto;
    transform: none;
  }
}

@media (max-width: 760px) {
  .agent-office-shell {
    min-height: 520px;
    padding: 18px 12px;
  }

  .office-stage {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
    gap: 22px 8px;
    min-width: 390px;
    padding-top: 38px;
  }

  .slot-4 .agent-popover,
  .slot-8 .agent-popover {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .office-desk-slot:nth-child(even) .agent-popover {
    right: 0;
    left: auto;
    transform: none;
  }

  .office-desk-slot:nth-child(odd) .agent-popover {
    right: auto;
    left: 0;
    transform: none;
  }
}

@media (max-width: 560px) {
  .agent-manager-header,
  .agent-manager-scroll,
  .agent-manager-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .agent-manager-scroll .form-grid {
    grid-template-columns: 1fr;
  }
}

.agent-list-title-row,
.agent-manager-list-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}

.agent-list-title-row h3,
.agent-manager-list-heading .agent-manager-group-label {
  margin: 0;
}

.agent-add-icon {
  display: grid;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  color: var(--blue);
  background: #eaf3fc;
  border: 1px solid transparent;
  border-radius: 6px;
}

.agent-add-icon:hover,
.agent-add-icon.active {
  color: #fff;
  background: var(--blue);
}

.agent-add-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.agent-manager-list-heading {
  justify-content: space-between;
  margin: 0 8px 10px;
}

.agent-manager-list-heading .agent-add-icon {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
}

@media (max-width: 820px) {
  .agent-manager-list-heading {
    flex: 0 0 auto;
    margin: 0;
  }

  .agent-manager-list-heading .agent-manager-group-label {
    display: none;
  }
}

/* Optical alignment for icon-only controls ------------------------------ */
button.icon-button,
button.agent-add-icon,
button.settings-trigger {
  display: inline-grid;
  box-sizing: border-box;
  padding: 0 !important;
  place-items: center;
  line-height: 0;
  text-align: center;
  vertical-align: middle;
}

button.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  aspect-ratio: 1;
}

button.icon-button svg,
button.agent-add-icon svg,
button.settings-trigger svg {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  transform: none;
}

button.icon-button svg {
  width: 18px;
  height: 18px;
}

/* Settings and Figma-inspired dark appearance --------------------------- */
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.settings-tab {
  flex: 1;
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
}

.settings-tab:hover,
.settings-tab.active {
  color: var(--ink);
  background: var(--surface-strong);
}

.settings-tab-panel[hidden] {
  display: none;
}

.settings-section-heading {
  margin-bottom: 20px;
}

.settings-section-heading h4 {
  margin-bottom: 5px;
  font-size: 16px;
}

.settings-section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-api-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.figma-connection {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.modal.settings-modal {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.topbar {
  min-height: 0;
  justify-content: flex-end;
}

.form-status:empty,
.run-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

.figma-authorization-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-size: 13px;
  text-decoration: underline;
}

.figma-authorization-link[hidden] {
  display: none;
}

.figma-callback-form {
  margin-top: 16px;
}

.figma-callback-form[hidden] {
  display: none;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-option {
  display: grid;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 11px;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.theme-option:hover,
.theme-option[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.theme-option-preview {
  display: grid;
  grid-template-columns: 28% 1fr;
  gap: 9px;
  height: 72px;
  padding: 10px;
  border-radius: 7px;
}

.theme-option-preview span {
  border-radius: 4px;
}

.theme-preview-dark {
  background: #070707;
  border: 1px solid #303030;
}

.theme-preview-dark span:first-child { background: #171717; }
.theme-preview-dark span:last-child { background: #242424; }
.theme-preview-light { background: #f8f8f6; border: 1px solid #deded9; }
.theme-preview-light span:first-child { background: #e9e9e5; }
.theme-preview-light span:last-child { background: #fff; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080808;
  --surface: #151515;
  --surface-strong: #1e1e1e;
  --ink: #f2f2f2;
  --muted: #aaa9ad;
  --line: #2e2e2e;
  --line-strong: #414141;
  --blue: #8e83f9;
  --blue-dark: #a99fff;
  --blue-soft: #272341;
  --control-track: var(--surface);
  --control-selected-ink: var(--ink);
  --green: #75c58c;
  --orange: #e9b573;
  --red: #f28b8b;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] * {
  scrollbar-color: #424242 transparent;
}

:root[data-theme="dark"] ::selection {
  color: #fff;
  background: #5546c4;
}

:root[data-theme="dark"] body {
  background: radial-gradient(circle at 76% 0%, rgba(49, 35, 132, 0.18), transparent 36rem), var(--bg);
}

:root[data-theme="dark"] .sidebar {
  color: var(--ink);
  background: linear-gradient(180deg, #141414, #101010);
  border-color: #252525;
}

:root[data-theme="dark"] .brand-block p,
:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .settings-trigger {
  color: #aaa9ad;
}

:root[data-theme="dark"] .brand-mark {
  color: #f6f5ff;
  background: linear-gradient(145deg, #887bff, #4635c0);
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .settings-trigger:hover {
  color: #f2f2f2;
  background: #242424;
  border-color: #303030;
}

:root[data-theme="dark"] .nav-item.active {
  box-shadow: inset 3px 0 0 #8e83f9;
}

:root[data-theme="dark"] .topbar {
  border-color: var(--line);
}

:root[data-theme="dark"] .status-strip,
:root[data-theme="dark"] .status-strip > div,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .modal {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .status-strip span,
:root[data-theme="dark"] .status-strip small,
:root[data-theme="dark"] .section-label,
:root[data-theme="dark"] .panel-note {
  color: var(--muted);
}

:root[data-theme="dark"] .primary-button {
  color: #100d24;
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .mini-button,
:root[data-theme="dark"] .workflow-add,
:root[data-theme="dark"] .workflow-edit,
:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .workflow-delete,
:root[data-theme="dark"] .board-agent-list-trigger,
:root[data-theme="dark"] .modal-close,
:root[data-theme="dark"] .close-button {
  color: var(--ink);
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .secondary-button:hover,
:root[data-theme="dark"] .ghost-button:hover,
:root[data-theme="dark"] .mini-button:hover,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .board-agent-list-trigger:hover,
:root[data-theme="dark"] .board-agent-list-trigger.active {
  color: #cec8ff;
  background: var(--blue-soft);
  border-color: #5a518f;
}

:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .workflow-delete {
  color: #f4a2a2;
}

:root[data-theme="dark"] .segment-control,
:root[data-theme="dark"] .segmented,
:root[data-theme="dark"] .workspace-tabs {
  background: #101010;
  border-color: var(--line);
}

:root[data-theme="dark"] .segment,
:root[data-theme="dark"] .workspace-tab {
  color: var(--muted);
}

:root[data-theme="dark"] .segment.active,
:root[data-theme="dark"] .workspace-tab.active {
  color: var(--ink);
  background: #303030;
}

:root[data-theme="dark"] .agent-card,
:root[data-theme="dark"] .flow-card,
:root[data-theme="dark"] .review-card,
:root[data-theme="dark"] .skill-card,
:root[data-theme="dark"] .artifact-card,
:root[data-theme="dark"] .overview-card,
:root[data-theme="dark"] .activity-item,
:root[data-theme="dark"] .workflow-item,
:root[data-theme="dark"] .chat-panel,
:root[data-theme="dark"] .task-panel,
:root[data-theme="dark"] .routing-lane,
:root[data-theme="dark"] .route-task,
:root[data-theme="dark"] .agent-capability-card {
  color: var(--ink);
  background: #1c1c1c;
  border-color: var(--line);
}

:root[data-theme="dark"] .agent-card:hover,
:root[data-theme="dark"] .flow-card:hover,
:root[data-theme="dark"] .skill-card:hover,
:root[data-theme="dark"] .artifact-card:hover,
:root[data-theme="dark"] .route-task.current {
  border-color: #685cc2;
}

:root[data-theme="dark"] .agent-avatar,
:root[data-theme="dark"] .manager-agent-avatar,
:root[data-theme="dark"] .workspace-agent-avatar,
:root[data-theme="dark"] .activity-avatar,
:root[data-theme="dark"] .agent-add-icon {
  color: #c7c0ff;
  background: var(--blue-soft);
  border-color: #484072;
}

:root[data-theme="dark"] .status-pill,
:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .tag,
:root[data-theme="dark"] .skill-count,
:root[data-theme="dark"] .route-count,
:root[data-theme="dark"] .task-status,
:root[data-theme="dark"] .desk-status {
  color: #d4d4d4;
  background: #292929;
  border-color: #3a3a3a;
}

:root[data-theme="dark"] .pill.high {
  color: #ffaaaa;
  background: #422628;
}

:root[data-theme="dark"] .pill.running {
  color: #c9c2ff;
  background: #2d274c;
}

:root[data-theme="dark"] .pill.review {
  color: #f1c18a;
  background: #3e2d1e;
}

:root[data-theme="dark"] .pill.done {
  color: #a6e3b8;
  background: #1d3525;
}

:root[data-theme="dark"] .workflow-skill {
  color: #d6d0ff;
  border-color: #5a518f;
}

:root[data-theme="dark"] .status-pill.active,
:root[data-theme="dark"] .status-pill.online,
:root[data-theme="dark"] .task-status.done,
:root[data-theme="dark"] .local-save-indicator {
  color: #a6e3b8 !important;
  background: #1d3525;
  border-color: #31533a;
}

:root[data-theme="dark"] .status-pill.busy,
:root[data-theme="dark"] .task-status.running,
:root[data-theme="dark"] .desk-status.running {
  color: #d2cbff;
  background: #2b254b;
  border-color: #514782;
}

:root[data-theme="dark"] .desk-status.review {
  color: #f0c48d;
  background: #3c2d1e;
  border-color: #67472c;
}

:root[data-theme="dark"] .progress-bar,
:root[data-theme="dark"] .desk-popover-metrics {
  background: #303030;
}

:root[data-theme="dark"] .agent-actions,
:root[data-theme="dark"] .artifact-actions,
:root[data-theme="dark"] .skill-actions {
  border-color: var(--line);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .task-input {
  color: var(--ink);
  background: #202020;
  border-color: #424242;
  box-shadow: none;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #858585;
}

:root[data-theme="dark"] input:hover,
:root[data-theme="dark"] select:hover,
:root[data-theme="dark"] textarea:hover {
  border-color: #656565;
}

:root[data-theme="dark"] label,
:root[data-theme="dark"] .field-label {
  color: #d0d0d0;
}

:root[data-theme="dark"] .run-status,
:root[data-theme="dark"] .flow-node.active,
:root[data-theme="dark"] .flow-edge.active,
:root[data-theme="dark"] .chat-message.user {
  color: #d4ceff;
  background: var(--blue-soft);
  border-color: #4d437c;
}

:root[data-theme="dark"] .modal-header,
:root[data-theme="dark"] .modal-footer,
:root[data-theme="dark"] .agent-manager-layout,
:root[data-theme="dark"] .agent-manager-form,
:root[data-theme="dark"] .agent-manager-scroll {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .agent-manager-list,
:root[data-theme="dark"] .chat-message.agent {
  background: #1b1b1b;
  border-color: var(--line);
}

:root[data-theme="dark"] .agent-manager-list-item {
  color: #d0d0d0;
}

:root[data-theme="dark"] .agent-manager-list-item:hover,
:root[data-theme="dark"] .agent-manager-list-item.active,
:root[data-theme="dark"] .agent-capability-card.selected {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: #574c8c;
}

:root[data-theme="dark"] .board-agent-popover,
:root[data-theme="dark"] .agent-popover,
:root[data-theme="dark"] .agent-roster {
  color: var(--ink);
  background: #202020;
  border-color: #3b3b3b;
}

:root[data-theme="dark"] .board-agent-option {
  color: #e0e0e0;
}

:root[data-theme="dark"] .board-agent-option:hover,
:root[data-theme="dark"] .desk-popover-metrics span {
  background: #303030;
}

:root[data-theme="dark"] .board-agent-option.is-hidden,
:root[data-theme="dark"] .desk-task-preview li.done {
  color: #999;
}

:root[data-theme="dark"] .board-agent-option-state,
:root[data-theme="dark"] .board-agent-show-all {
  color: #d0caff;
  background: var(--blue-soft);
  border-color: #514782;
}

:root[data-theme="dark"] .agent-office-shell {
  background-color: #101012;
  background-image:
    linear-gradient(rgba(142, 131, 249, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 131, 249, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 5%, rgba(64, 49, 158, 0.17), transparent 52%);
  border-color: var(--line);
}

:root[data-theme="dark"] .desk-label strong {
  color: #f2f2f2;
}

:root[data-theme="dark"] .desk-surface {
  background: #26242e;
  border-color: #494354;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .desk-surface::before,
:root[data-theme="dark"] .desk-surface::after {
  background: #48434f;
}

:root[data-theme="dark"] .desk-task-preview {
  color: #d0d0d0;
}

:root[data-theme="dark"] .connection-badge {
  color: #c8c8c8;
  background: #292929;
  border-color: #454545;
}

:root[data-theme="dark"] .connection-badge.connected {
  color: #a6e3b8;
  background: #1d3525;
  border-color: #31533a;
}

:root[data-theme="dark"] .route-task.passed {
  background: #1c1c1c;
}

:root[data-theme="dark"] .route-step.queued .route-status-tag,
:root[data-theme="dark"] .route-step.paused .route-status-tag {
  color: var(--muted);
  background: #353535;
}

:root[data-theme="dark"] .route-step.paused {
  color: #efc08b;
  background: #3b2c20;
  border-color: #664631;
}

:root[data-theme="dark"] .lane-number {
  color: #c8c0ff;
  background: var(--blue-soft);
}

:root[data-theme="dark"] .routing-lane:not(:last-child)::after {
  color: #c8c0ff;
  background: #292929;
  border-color: #454545;
}

:root[data-theme="dark"] .skill-action-icon.icon-button {
  color: var(--ink);
  background: #252525;
  border-color: #454545;
}

@media (max-width: 600px) {
  .settings-api-heading {
    flex-direction: column;
  }
}

/* Draft 419:14518: shared shell and presentation, with existing actions retained. */
:root {
  --shadow: 0 14px 36px rgba(30, 30, 28, 0.06);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { font-size: 13px; }
.app-shell { grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 18px 12px 16px; }
.brand-block { padding: 2px 8px 18px; min-height: 48px; }
.brand-mark { width: 28px; min-width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.brand-block h1 { font-size: 13px; font-weight: 700; }
.nav-list { display: flex; flex: 1; flex-direction: column; gap: 12px; margin: 12px 0 0; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 10px; font-size: 13px; }
.nav-item img { flex: 0 0 auto; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.nav-item.active { border-color: transparent; box-shadow: none; }
.settings-trigger { width: 100%; justify-content: flex-start; margin-top: auto; height: 32px; }
.workspace { display: flex; flex-direction: column; gap: 24px; max-width: none; padding: 28px 40px 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 4px 0 6px; border: 0; }
.topbar h2 { margin: 0; font-size: 30px; font-weight: 700; line-height: 36px; letter-spacing: -.6px; }
.status-strip { display: flex; gap: 20px; min-width: 0; background: none; padding: 0; border-radius: 0; }
.status-strip[hidden] { display: none; }
.status-strip > div { display: flex; align-items: baseline; gap: 5px; min-height: 0; min-width: 0; padding: 0; border: 0; background: transparent; }
.status-strip span { font-size: 15px; line-height: 20px; }
.status-strip small { font-size: 11px; }
.section-tabs { display: flex; gap: 4px; align-items: center; min-height: 36px; }
.section-tabs[hidden] { display: none; }
.section-tabs .nav-item { font-size: 12px; }
.tab-spacer { flex: 1; }
.page-view { gap: 24px; }
.panel { padding: 22px 24px 24px; border: 0; border-radius: 14px; box-shadow: var(--shadow); background: var(--surface); backdrop-filter: none; }
.panel-heading { align-items: center; margin-bottom: 18px; gap: 12px; }
.panel h3 { font-size: 16px; line-height: 22px; font-weight: 600; }
.primary-button, .secondary-button, .ghost-button, .mini-button { min-height: 34px; border-radius: 8px; font-size: 12px; padding: 8px 14px; box-shadow: none; }
.primary-button { background: var(--blue); border-color: var(--blue); color: #fff; }
.secondary-button, .ghost-button { background: #f0f0ee; border-color: transparent; color: var(--ink); }
input, select, textarea { border-radius: 8px; font-size: 12px; padding: 8px 11px; }
input:not([type="checkbox"]), select { min-height: 32px; }
label, .field-label { font-size: 12px; font-weight: 500; }
.segmented { border-radius: 8px; padding: 4px; background: #f0f0ee; }
.segment { font-size: 12px; padding: 8px 12px; border-radius: 6px; }
.pill, .tag, .status-pill { border-radius: 4px; font-size: 11px; font-weight: 500; }
.workspace-create-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 16px; align-items: stretch; }
.command-form { gap: 24px; }
.command-form textarea { min-height: 180px; }
.command-form > .primary-button { justify-self: end; }
#resetDemo { font-size: 11px; padding: 6px 8px; }
/* New Task · Figma 458:155434; native form controls retain their behavior. */
#command-center.command-panel { width: 100%; min-width: 0; padding: 22px 24px 24px; border-radius: 14px; }
.command-panel .panel-heading { flex-direction: row; justify-content: space-between; text-align: left; margin-bottom: 14px; }
.command-panel h3, .command-panel .command-section h4 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.2px; }
.command-panel .command-form { max-width: none; gap: 24px; }
.command-panel label { min-width: 0; gap: 6px; color: var(--ink); font-size: 12px; line-height: 16px; font-weight: 600; }
.command-panel input[type="text"], .command-panel select, .command-panel textarea { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 16px; padding: 7px 10px; }
.command-panel select { appearance: none; padding-right: 30px; background-image: url("assets/figma-ui/new-task-chevron.svg"); background-repeat: no-repeat; background-position: right 10px center; }
.command-panel input[type="text"], .command-panel select { min-height: 32px; }
.command-panel textarea { min-height: 76px; resize: vertical; }
:root[data-theme="dark"] .command-panel :is(textarea, .command-link-field) { border-color: var(--line-strong); }
.command-panel .command-section { display: grid; gap: 8px; }
.command-panel .command-section h4 { margin-bottom: 6px; }
.command-panel .command-link-field { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); }
.command-panel .command-link-field input { flex: 1; width: 100%; min-height: 20px; border: 0; border-radius: 0; padding: 0; background: transparent; font-size: 14px; font-weight: 400; box-shadow: none; }
.command-panel .command-link-field:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.command-panel .command-link-field input:focus { outline: none; }
.command-link-field > img { flex: 0 0 auto; }
.command-dropzone { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 16px; border: 1px dashed var(--muted); border-radius: 8px; background: var(--surface-strong); }
.command-dropzone.dragging { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.command-dropzone > img { flex: 0 0 auto; }
.command-dropzone > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.command-dropzone strong { font-size: 13px; line-height: 18px; font-weight: 700; }
.command-dropzone small { color: var(--muted); font-size: 11.67px; line-height: 14px; }
.command-dropzone .secondary-button { margin-left: auto; font-size: 12px; padding: 8px 12px; }
.command-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.command-attachments:empty { display: none; }
.command-attachment { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 30px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 16px; background: var(--surface-strong); }
.command-attachment > img { flex: 0 0 auto; }
.command-attachment > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.command-attachment small { color: var(--muted); white-space: nowrap; font-size: 11.67px; }
.command-attachment button { display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; background: none; }
.command-panel .command-output-section { gap: 12px; }
.command-panel .command-toggle { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; line-height: 20px; font-weight: 400; }
.command-toggle input { appearance: none; width: 30px; height: 18px; min-height: 18px; flex: 0 0 auto; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--muted); cursor: pointer; }
.command-toggle input:checked { background: url("assets/figma-ui/new-task-toggle.svg") center no-repeat; }
.command-toggle input::after { content: ""; display: block; width: 12px; height: 12px; margin: 3px; border-radius: 50%; background: white; transition: transform 120ms; }
.command-toggle input:checked::after { opacity: 0; }
.command-output { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.command-output[hidden] { display: none; }
.command-output .command-link-field, .command-output .command-dropzone { min-height: 56px; }
.command-folder-field { min-width: 0; padding: 10px 12px; }
.command-folder-field .secondary-button { min-height: 32px; }
.command-folder-field strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-panel .form-grid { grid-template-columns: 140px 160px; gap: 12px; }
.command-panel .command-actions { display: flex; justify-content: flex-end; gap: 12px; justify-self: end; }
.command-panel .form-grid, .command-panel .command-actions { grid-row: 5; grid-column: 1; align-self: end; }
.command-panel .command-actions .secondary-button, .command-panel .command-actions .primary-button { min-height: 34px; padding: 8px 16px; font-size: 12px; }
.command-panel .command-draft-entry { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--track, #e0e0e0); color: var(--ink); font-size: 12px; font-weight: 600; }
.command-draft-entry img { width: 16px; height: 16px; }
.workspace-team-panel { width: min(100%, 900px); }
:root[data-theme="dark"] .command-panel img[src*="new-task-"] { filter: brightness(0) invert(.8); }
:root[data-theme="dark"] .command-panel select { background-image: url("assets/figma-ui/new-task-chevron.svg"); }
@media (max-width: 1300px) {
  .command-panel .command-actions { grid-row: 6; }
}
@media (max-width: 650px) {
  #command-center.command-panel { padding: 22px 18px; }
  .command-panel .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-output { grid-template-columns: 1fr; }
  .command-dropzone { flex-wrap: wrap; }
  .command-dropzone > div { flex-basis: calc(100% - 40px); }
  .command-dropzone .secondary-button { margin-left: auto; }
  .command-panel .command-actions { justify-self: stretch; }
  .command-panel .command-actions > button { flex: 1; }
}
.workspace-team-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--ink); text-align: left; background: none; border: 0; border-radius: 6px; }
.workspace-team-row:hover { background: var(--bg); }
.workspace-team-row strong { display: block; font-size: 13px; font-weight: 600; }
.workspace-team-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.agent-list-avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; padding: 4px; border-radius: 8px; background: #29263d; }
.agent-list-avatar img { width: 100%; height: 100%; object-fit: contain; }
.workspace-team-panel > .secondary-button { margin-top: 20px; }
.attention-row { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 8px; }
.task-attention-row { position: relative; }
.task-attention-link { color: inherit; text-decoration: none; }
.task-attention-link::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.task-attention-link:focus-visible::after { outline: 2px solid var(--blue); }
.task-attention-row .secondary-button { position: relative; }
:root .workspace .task-detail-content .task-failure {
  --failure-tint: rgba(255, 218, 186, .54);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid #f4bf8f;
  border-radius: 14px;
  background: linear-gradient(var(--failure-tint), var(--failure-tint)), var(--module-glass);
  box-shadow: none;
}
:root[data-theme="dark"] .workspace .task-detail-content .task-failure {
  --failure-tint: rgba(113, 62, 26, .32);
  border-color: #90613e;
}
.task-failure-icon { margin-top: 2px; }
:root[data-theme="dark"] .task-failure-icon { filter: brightness(1.9); }
.task-failure > div { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.task-detail-content .task-failure h3 { margin: 0; font-size: 16px; line-height: 28px; font-weight: 600; }
.task-failure p { margin: 0; white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
.task-failure small { color: var(--muted); font-size: 12px; }
.task-failure-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; }
.task-failure-actions :is(button, a) { max-width: 100%; min-height: 34px; height: auto; white-space: normal; }
.task-detail-page .task-failure-actions a.secondary-button { margin: 0; background: var(--surface-strong); }
.task-detail-content [data-failed-stage]:focus { outline: 2px solid var(--orange); outline-offset: -2px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .workspace .task-detail-content .task-failure { background: linear-gradient(var(--failure-tint), var(--failure-tint)), var(--surface-strong); }
}
.attention-row + .attention-row { margin-top: 8px; }
.attention-row > div { flex: 1; min-width: 0; }
.attention-row strong { font-size: 13px; }
.attention-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.attention-icon { display: grid; place-items: center; color: var(--orange); background: #fff1e5; width: 32px; height: 32px; border-radius: 8px; }
.attention-icon svg { width: 18px; height: 18px; }
.workspace-empty { margin: 0; padding: 20px 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; }
.workspace-task-dashboard { display: grid; gap: 24px; min-width: 0; }
.task-dashboard-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
.task-dashboard-panel { min-width: 0; }
.task-dashboard-panel h3 { font-size: 18px; font-weight: 650; }
.task-dashboard-heading { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.task-dashboard-heading .task-filters { display: inline-flex; flex-wrap: wrap; gap: 2px; width: auto; border: 1px solid var(--line); }
.task-filters .segment { min-height: 32px; }
.task-filters .segment.active { color: var(--blue); }
.task-table-scroll { overflow-x: auto; }
.task-dashboard-table { width: 100%; min-width: 700px; table-layout: fixed; border-collapse: collapse; text-align: left; }
.task-dashboard-table :is(th, td) { padding: 13px 12px 13px 0; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.task-dashboard-table thead th { padding-top: 0; padding-bottom: 10px; }
.task-dashboard-table tbody tr { border-bottom: 1px solid var(--line); }
.task-dashboard-table tbody td:last-child { text-align: right; }
.task-row-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink); text-align: left; }
a.task-row-button { text-decoration: none; }
.task-row-button:hover strong { color: var(--blue); text-decoration: underline; }
.task-row-button strong, .task-utility-list strong { display: block; font-weight: 650; overflow-wrap: anywhere; }
.task-dashboard-table .task-row-button strong { font-size: 14px; }
.task-row-button small, .task-utility-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.task-dashboard-status { display: inline-block; border-radius: 4px; padding: 5px 8px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; }
.task-dashboard-status.running { color: #0b538e; background: #e2effa; }
.task-dashboard-status.paused, .task-dashboard-status.waiting { color: #93400e; background: #fae9d9; }
.task-dashboard-status.completed { color: #146824; background: #dcf4de; }
.task-dashboard-status.failed { color: #a8252e; background: #fce6e8; }
.task-current, .task-progress { display: flex; align-items: center; gap: 8px; }
.task-current .agent-list-avatar { flex-basis: 25px; width: 25px; height: 25px; padding: 3px; }
.task-progress { color: var(--ink); }
.task-progress progress { appearance: none; width: min(100%, 100px); min-width: 0; height: 5px; border: 0; border-radius: 4px; background: var(--line); color: var(--blue); accent-color: var(--blue); }
.task-progress progress::-webkit-progress-bar { border-radius: 4px; background: var(--line); }
.task-progress progress::-webkit-progress-value { border-radius: 4px; background: var(--blue); }
.task-progress progress::-moz-progress-bar { border-radius: 4px; background: var(--blue); }
.task-finished-list, .task-utility-list { margin: 0; padding: 0; list-style: none; }
.task-finished-list > li, .task-utility-list > li { border-top: 1px solid var(--line); }
.task-finished-list .task-row-button, .task-utility-list > li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; font-size: 12px; }
.task-result-icon, .task-utility-icon svg { display: block; width: 17px; height: 17px; }
.task-utility-icon svg { fill: none; stroke: var(--muted); stroke-width: 2; }
.task-dashboard-table .task-dashboard-empty, .task-finished-list .task-dashboard-empty { padding: 18px 0; text-align: left; color: var(--muted); font-size: 12px; }
@media (max-width: 850px) { .task-dashboard-bottom { grid-template-columns: minmax(0, 1fr); } }
.task-detail-page { display: grid; gap: 24px; min-width: 0; }
.task-detail-heading h2 { margin: 5px 0 4px; color: var(--ink); font-size: 30px; line-height: 1.2; overflow-wrap: anywhere; }
.task-detail-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.task-detail-heading a { display: inline-block; text-decoration: none; }
#workspaceTaskHistory .agent-back-link img { width: 12px; height: 12px; vertical-align: middle; transform: rotate(180deg); }
[data-workspace-task-history] { display: inline-flex; align-items: center; text-decoration: none; }
.task-history-panel .panel-heading { align-items: start; }
.task-history-panel .panel-heading h3 { font-size: 17px; }
.task-history-controls { display: grid; grid-template-columns: minmax(210px, 1.9fr) repeat(3, minmax(120px, 1fr)) minmax(135px, 1.25fr); gap: 12px; margin-bottom: 16px; }
.task-history-controls label { display: grid; gap: 6px; min-width: 0; }
.task-history-controls :is(input[type="search"], select) { width: 100%; min-width: 0; }
.task-history-controls .task-history-subtasks { display: flex; align-items: center; justify-content: end; align-self: end; min-height: 32px; white-space: nowrap; }
.task-history-subtasks input { appearance: none; position: relative; flex: 0 0 30px; width: 30px; height: 18px; min-height: 0; padding: 0; margin: 0; border: 1px solid var(--muted); border-radius: 999px; background: var(--muted); cursor: pointer; }
.task-history-subtasks input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: white; }
.task-history-subtasks input:checked { border-color: var(--blue); background: var(--blue); }
.task-history-subtasks input:checked::before { left: 14px; }
.task-history-table :is(th, td):first-child { padding-left: 16px; }
.task-history-table :is(th, td):last-child { padding-right: 16px; }
.task-history-table td .task-current { min-height: 24px; }
.task-history-table details { margin-top: 5px; }
.task-history-table summary { width: fit-content; cursor: pointer; }
.task-history-table details ul { margin: 5px 0 0 5px; padding-left: 12px; border-left: 1px solid var(--line); list-style: none; }
.task-history-table details li + li { margin-top: 4px; }
.task-history-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .task-history-controls { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .task-history-controls .task-history-subtasks { justify-content: start; }
}
.task-detail-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(90px, 190px) auto auto auto auto; align-items: center; gap: 18px; padding: 14px 20px; font-size: 13px; }
.task-detail-page small, .task-detail-page dt { color: var(--muted); font-size: 12px; font-weight: 400; }
.task-detail-banner small, .task-detail-list li small, .task-execution-list li small, .task-swimlane-step small { display: block; margin-top: 3px; }
.task-detail-current { min-width: 0; overflow-wrap: anywhere; }
.task-detail-banner .task-progress { font-size: 12px; }
.task-detail-banner .task-progress progress, .task-now .task-progress progress { flex: 1; width: auto; }
.task-detail-banner .task-detail-actions { grid-column: -2; }
.task-detail-actions { position: relative; }
.task-detail-actions summary { cursor: pointer; display: grid; place-items: center; width: 32px; height: 34px; border-radius: 8px; list-style: none; font-weight: 700; letter-spacing: 1px; }
.task-detail-actions summary::-webkit-details-marker { display: none; }
.task-detail-actions summary:hover { background: var(--bg); }
.task-detail-actions > div { position: absolute; z-index: 2; inset: 100% 0 auto auto; display: grid; gap: 4px; width: max-content; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.task-detail-tabs a { border-radius: 8px; padding: 9px 12px; color: var(--muted); font-size: 12px; text-decoration: none; }
.task-detail-tabs a.active { background: var(--surface); color: var(--blue); box-shadow: 0 1px 4px #0001; font-weight: 600; }
.task-detail-content, .task-detail-columns > div, .task-detail-columns > aside { display: grid; align-content: start; gap: 14px; min-width: 0; }
.task-detail-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.task-detail-content .panel { padding: 24px; }
.task-detail-content h3 { font-size: 17px; line-height: 22px; margin: 0 0 14px; }
.task-brief { font-size: 13px; }
.task-brief p { margin: 5px 0 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.task-attachment, .task-handoff-output { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 12px; overflow-wrap: anywhere; }
.task-detail-page svg { display: block; width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.task-detail-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.task-detail-facts > div { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.task-detail-page dd { margin: 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.task-summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-summary-facts dt { grid-row: 2; }
.task-summary-facts dd { font-size: 17px; }
.task-stage-facts { margin: 0; }
.task-stage-facts > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-stage-facts dd { text-align: right; }
.task-stage-facts .task-progress { justify-content: flex-end; }
.task-detail-list, .task-execution-list { margin: 0; padding: 0; list-style: none; }
.task-detail-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 12px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.task-detail-list li > span:nth-child(2), .task-execution-list li > span:nth-child(3) { flex: 1; min-width: 0; }
.task-detail-agents li { border: 0; padding: 7px; font-size: 14px; }
.task-detail-agents .agent-list-avatar { flex-basis: 36px; }
.task-detail-list:not(.task-detail-agents) .agent-list-avatar { flex-basis: 28px; width: 28px; height: 28px; }
.task-stage-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--muted); }
.task-stage-dot.running { background: var(--blue); }
.task-stage-dot.completed { background: #228144; }
.task-stage-dot.failed { background: #a8252e; }
.task-now { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.task-now li { border: 0; padding: 12px 16px; }
.task-now li strong { font-size: 16px; }
.task-now .task-progress { flex: 0 1 150px; }
.task-detail-page a.secondary-button { display: inline-flex; align-items: center; margin-top: 8px; text-decoration: none; }
.task-detail-empty { color: var(--muted); font-size: 13px; }
.task-execution-list li { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; overflow-wrap: anywhere; }
.task-execution-list li + li { margin-top: -1px; }
.task-execution-list li.current { position: relative; border-color: var(--blue); }
.task-execution-list .agent-list-avatar { flex-basis: 32px; width: 32px; height: 32px; }
.task-stage-marker { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 700; }
.task-stage-marker:has(img) { background: #dcf4de; }
.task-stage-marker img { width: 16px; height: 16px; }
.current .task-stage-marker { color: var(--blue); }
.task-routing-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.task-routing-mode { display: flex; width: auto; align-items: center; padding: 3px; }
.task-routing-mode span { padding: 8px 12px; color: var(--blue); background: var(--surface); border-radius: 6px; font-size: 12px; font-weight: 600; }
.task-swimlane-scroll { overflow-x: auto; }
.task-swimlane { width: 100%; min-width: 900px; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: 12px; }
.task-swimlane :is(th, td) { border-bottom: 1px solid var(--line); padding: 10px 5px; }
.task-swimlane thead th { color: var(--muted); font-size: 11px; font-weight: 400; }
.task-swimlane th:first-child { width: 17%; }
.task-swimlane tbody th > span { display: flex; align-items: center; gap: 8px; }
.task-swimlane .agent-list-avatar { flex-basis: 26px; width: 26px; height: 26px; padding: 3px; }
.task-swimlane-step { position: relative; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; overflow-wrap: anywhere; }
.task-swimlane-step.running { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.task-swimlane-step.pending { border-style: dashed; }
.task-swimlane-step:is(.down, .across)::after { content: ""; position: absolute; z-index: 1; top: 50%; left: 100%; width: 16px; border-top: 1px solid var(--blue); pointer-events: none; }
.task-swimlane-step.down::after { height: 34px; border-right: 1px solid var(--blue); border-radius: 0 8px 0 0; }
.task-swimlane-step:is(.pending, .running):is(.down, .across)::after { border-color: var(--muted); border-style: dashed; border-left: 0; border-bottom: 0; }
.task-handoff-avatars { display: inline-flex; align-items: center; gap: 4px; }
.task-handoff-list li .task-handoff-output { display: inline-flex; max-width: 36%; }
.task-handoff-list a.task-handoff-output { color: var(--blue); }
.task-handoff-list a.task-handoff-output:hover { background: var(--blue-soft); border-color: var(--blue); text-decoration: underline; }
.task-handoff-list a.task-handoff-output:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.task-activity-list small { flex: 0 0 66px; }
@media (max-width: 950px) {
  .task-detail-banner { display: flex; flex-wrap: wrap; }
  .task-detail-current { flex: 1 1 150px; }
  .task-detail-banner .task-progress { flex: 1 1 90px; }
  .task-detail-content .panel { padding: 18px; }
  .task-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 730px) {
  .task-detail-columns { grid-template-columns: minmax(0, 1fr); }
  .task-detail-heading h2 { font-size: 25px; }
  .task-handoff-list li { flex-wrap: wrap; }
}
.agent-list-details summary { color: var(--muted); cursor: pointer; font-size: 12px; padding: 8px 0; }
.command-actions { margin-top: 8px; }
.agent-office-shell { min-height: 470px; padding: 20px; border-radius: 8px; background-image: linear-gradient(rgba(103,91,203,.055) 1px, transparent 1px), linear-gradient(90deg,rgba(103,91,203,.055) 1px,transparent 1px); background-size: 32px 32px; }
.office-stage { min-height: 410px; min-width: 780px; padding: 8px 0; grid-template-columns: repeat(5,minmax(140px,1fr)); gap: 24px 8px; }
.office-desk-slot, .office-desk { min-height: 190px; }
.desk-ip { width: 96px; height: 96px; top: 24px; filter: none; }
.desk-surface { top: 120px; width: 148px; height: 26px; box-shadow: none; transform: translateX(-50%); }
.desk-surface::before, .desk-surface::after { height: 22px; bottom: -22px; width: 6px; }
.desk-shadow { display: none; }
.desk-status { top: 124px; bottom: auto; padding: 2px 7px; font-weight: 500; }
.office-desk-slot.active { outline: 2px solid var(--blue); border-radius: 10px; }
.agent-grid { display: flex; flex-direction: column; gap: 0; }
.agent-card { display: grid; grid-template-columns: minmax(240px,1.4fr) minmax(180px,1fr) auto; gap: 14px; align-items: center; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.agent-card:last-child { border-bottom: 0; }
.agent-card:hover { transform: none; box-shadow: none; background: transparent; }
.agent-card header { display: flex; gap: 12px; align-items: center; margin: 0; }
.agent-card header > div { flex: 1; min-width: 0; }
.agent-card h4 { font-size: 13px; margin: 0 0 4px; }
.agent-card .role-tag { font-size: 11px; line-height: 1.5; margin: 0; }
.agent-card .agent-actions { border: 0; padding: 0; margin: 0; gap: 6px; }
.agent-card .agent-actions button { font-size: 11px; padding: 6px 8px; }
.agent-card .agent-actions .primary-button { color: var(--ink); background: #f0f0ee; border-color: transparent; }
.agent-list-details[open] { grid-row: 2; grid-column: 1 / -1; }
.agent-list-details[open] + .agent-actions { grid-row: 1; grid-column: 3; }
.workflow-library { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.workflow-library-card { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.workflow-library-card > .pill { align-self: flex-start; }
.workflow-library-card h4 { margin: 16px 0 10px; font-size: 15px; }
.workflow-library-card p { font-size: 12px; line-height: 1.65; color: var(--muted); }
.workflow-library-card footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; margin-top: auto; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.artifact-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.artifact-card, .skill-card { box-shadow: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.artifact-card h4, .skill-card h4 { font-size: 14px; }
.artifact-card p, .skill-card p { font-size: 13px; line-height: 1.65; }
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #0003; }
.modal::backdrop { background: rgba(25,24,32,.35); backdrop-filter: blur(2px); }
.modal h3 { font-size: 22px; }
.settings-modal { width: min(920px,calc(100vw - 48px)); padding: 28px 32px; }
.agent-workspace-modal { width: min(1060px,calc(100vw - 48px)); }
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .brand-mark { background: var(--blue); }
:root[data-theme="dark"] .status-strip, :root[data-theme="dark"] .status-strip > div { background: transparent; }
:root[data-theme="dark"] .nav-item img { filter: brightness(0) invert(.8); }
:root[data-theme="dark"] .secondary-button, :root[data-theme="dark"] .ghost-button, :root[data-theme="dark"] .agent-card .agent-actions .primary-button { background: var(--surface-strong); color: var(--ink); }
:root[data-theme="dark"] .workflow-library-card { background: var(--surface); }
:root[data-theme="dark"] .agent-card { background: transparent; box-shadow: none; }
@media (max-width: 1200px) {
  .workspace { padding: 24px; }
  .agent-card { grid-template-columns: minmax(240px,1fr) auto; }
  .agent-list-details { grid-row: 2; grid-column: 1 / -1; }
  .agent-list-details[open] + .agent-actions { grid-column: 2; }
  .workflow-library { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 180px minmax(0,1fr); }
  .workspace-create-grid { grid-template-columns: 1fr; }
  #workspaceTeam { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 12px; }
  .artifact-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .status-strip { gap: 10px; }
}
@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { position: relative; min-height: 0; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-block { padding-bottom: 8px; }
  .nav-list { flex-direction: row; gap: 4px; overflow-x: auto; margin: 0; }
  .nav-list .nav-item { flex: 0 0 auto; font-size: 12px; gap: 6px; padding: 0 8px; }
  .settings-trigger { width: auto; margin-top: 0; }
  .workspace { padding: 20px 16px 40px; gap: 18px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar h2 { font-size: 26px; }
  .panel { padding: 18px 16px; }
  .workspace-create-grid, .workflow-library, .artifact-list { grid-template-columns: 1fr; }
  .agent-card { display: flex; align-items: stretch; flex-direction: column; gap: 6px; }
  #workspaceTeam { grid-template-columns: 1fr; }
  .attention-row { flex-wrap: wrap; }
  .attention-row > div { flex-basis: calc(100% - 50px); }
  .agent-office-shell { padding: 12px; }
  .settings-modal, .agent-workspace-modal { width: calc(100vw - 24px); padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Keep horizontally scrollable boards contained inside the responsive shell. */
.workspace, .panel, .agent-office-shell { min-width: 0; }
.agent-office-shell { max-width: 100%; }
.section-tabs .nav-item { width: auto; flex: 0 0 auto; }
#teamViews { min-height: 42px; }
#teamViews:not([data-view="skills"]) #toggleSkillEditor,
#teamViews[data-view="skills"] .team-agent-view-switch { display: none; }
@media (max-width: 480px) {
  #teamViews { flex-wrap: wrap; }
}
#teamViews .team-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--module-glass-edge);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--module-glass-sheen), transparent 65%), var(--module-glass);
  box-shadow: inset 0 1px 0 var(--module-glass-sheen);
  -webkit-backdrop-filter: blur(28px) saturate(115%);
  backdrop-filter: blur(28px) saturate(115%);
}
#teamViews .team-view-switch .nav-item {
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
#teamViews .team-view-switch .nav-item::before { display: none; }
#teamViews .team-view-switch .nav-item:hover { background: rgba(255, 255, 255, .24); color: var(--ink); }
#teamViews .team-view-switch .nav-item.active { background: rgba(255, 255, 255, .76); color: var(--ink); }
#teamViews .team-view-switch .nav-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-theme="dark"] #teamViews .team-view-switch .nav-item:hover { background: rgba(255, 255, 255, .07); }
:root[data-theme="dark"] #teamViews .team-view-switch .nav-item.active { background: rgba(255, 255, 255, .12); }
#teamViews #toggleSkillEditor { white-space: nowrap; }

.skills-catalog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#skills .skills-catalog-heading h3 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.skill-type-filters { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); background: var(--bg); }
.skill-type-filters .segment { min-height: 34px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.skill-type-filters .segment.active { color: var(--blue-ink, #332c73); background: var(--surface); box-shadow: 0 1px 3px #1f1f1d1a; }
.skills-catalog-filters { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 200px); gap: 12px; margin-bottom: 16px; }
.skills-catalog-filters label { gap: 6px; line-height: 16px; font-weight: 600; }
.skills-catalog-filters :is(input, select) { width: 100%; height: 32px; padding: 6px 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.skills-catalog-filters select {
  appearance: none;
  padding-right: 30px;
  background: var(--surface) url("assets/figma-ui/skills-select-chevron.svg") right 10px center / 16px 16px no-repeat;
}
.skill-table-scroll { overflow-x: auto; }
.skill-table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: collapse; text-align: left; }
.skill-type-col { width: 11%; }
.skill-agent-col { width: 19.8%; }
.skill-source-col { width: 20.7%; }
.skill-date-col { width: 102px; }
.skill-table th, .skill-table td { padding: 11px 16px 11px 0; vertical-align: middle; }
.skill-table th:last-child, .skill-table td:last-child { padding-right: 0; }
.skill-table thead th { padding-top: 0; padding-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 14px; }
.skill-table tbody tr { border-top: 1px solid var(--line); }
.skill-table tbody tr[data-skill-row] { cursor: pointer; }
.skill-table tbody tr[data-skill-row]:hover, .skill-table tbody tr[data-skill-row]:focus-within { background: var(--bg); }
.skill-row-title { display: block; border: 0; padding: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; line-height: 18px; text-align: left; }
.skill-row-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-height: 28px; overflow: hidden; overflow-wrap: anywhere; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 14px; }
.skill-row-agents, .skill-avatar-group { display: flex; align-items: center; gap: 8px; }
.skill-avatar-group { gap: 0; }
.skill-avatar-group .agent-list-avatar { flex: 0 0 24px; width: 24px; height: 24px; padding: 2px; border: 0; }
.skill-avatar-group button.agent-list-avatar + button { margin-left: -6px; }
.skill-avatar-group button.agent-list-avatar:focus-visible { z-index: 1; }
.skill-type-pill { min-height: 22px; padding: 3px 8px; border: 0; font-weight: 600; }
.skill-type-pill.custom { color: #555650; background: #eeeeec; }
.skill-type-pill.recommended { color: #0a4e87; background: #e2eff9; }
.skill-type-pill.imported { color: #5143af; background: #eceafa; }
.skill-author-tag.pill { min-height: 22px; padding: 3px 8px; border: 0; color: #5143af; background: #eceafa; font-weight: 600; }
.skill-uploader-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 22px; }
.skill-uploader-form label { flex: 1 1 200px; max-width: 300px; }
.skill-uploader-form .form-status { flex-basis: 100%; margin: 0; }
.skill-row-source, .skill-row-updated, .skills-catalog-footer p { color: var(--muted); font-size: 12px; line-height: 14px; }
.skill-row-source { overflow-wrap: anywhere; }
.skill-row-source a { color: var(--blue); }
.skill-row-updated { display: flex; align-items: center; justify-content: space-between; }
.skill-table .skill-empty { padding: 24px 0; color: var(--muted); }
.skills-catalog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.skills-catalog-footer p { margin: 0; }
.skills-catalog-footer button { flex: none; }
.skill-modal { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 26px 24px 24px; overflow: auto; }
.skill-modal .skill-editor-heading h3 { margin: 4px 0 22px; font-size: 16px; }
.skill-modal .close-button { top: 20px; right: 24px; background: none; font-size: 19px; }
.skill-modal .skill-form { gap: 14px; }
.skill-modal fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.skill-modal legend, .skill-modal label { color: var(--ink); font-size: 12px; font-weight: 500; }
.skill-modal legend { margin-bottom: 6px; padding: 0; }
.skill-modal label { gap: 6px; }
.skill-modal :is(input[type="text"], input[type="url"], textarea, select) {
  width: 100%;
  min-width: 0;
  background-color: var(--surface);
  border-color: var(--line-strong);
}
.skill-modal textarea { min-height: 32px; resize: vertical; }
.skill-modal #skillPrompt { min-height: 76px; }
.skill-source-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); background: var(--bg); }
.skill-source-tabs .segment { min-height: 34px; color: var(--muted); white-space: nowrap; }
.skill-source-tabs .segment.active { background: var(--surface); color: var(--blue); box-shadow: 0 1px 3px #1f1f1d1a; }
.skill-source-fields { display: grid; gap: 8px; }
.skill-source-fields[hidden] { display: none; }
.skill-source-fields[data-skill-source-panel="github"] { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.skill-source-fields[data-skill-source-panel="github"]:has(button[hidden]) { grid-template-columns: 1fr; }
.skill-modal .skill-browse-file { display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); }
.skill-source-fields:has(#localSkillSelect option:checked:not([value=""])) .skill-browse-file { display: none; }
.skill-modal .skill-browse-file input { min-height: 0; padding: 0; border: 0; }
.skill-modal .form-status { margin: 0; padding: 0; font-size: 12px; }
.skill-agent-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 10px; }
.skill-agent-choices label { position: relative; display: grid; justify-items: center; cursor: pointer; }
.skill-agent-choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.skill-agent-choices .agent-list-avatar { width: 46px; height: 46px; padding: 5px; border-radius: 10px; opacity: .32; }
.skill-agent-choices input:checked + span { opacity: 1; }
.skill-agent-choices input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.skill-agent-choices label:has(input:disabled) { cursor: default; }
.skill-modal .skill-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.skill-modal .skill-form-actions small { flex: 1 1 180px; color: var(--muted); }
.skill-modal .skill-form-actions small:empty { display: none; }
:root[data-theme="dark"] #teamViews[data-view="skills"] .nav-item.active,
:root[data-theme="dark"] .skill-type-filters .segment.active,
:root[data-theme="dark"] .skill-row-source a { color: var(--ink); }
:root[data-theme="dark"] .skill-row-updated img { filter: brightness(0) invert(.8); }
@media (forced-colors: active) {
  .skills-catalog-filters select { appearance: auto; background-image: none; }
}
@media (max-width: 650px) {
  .skills-catalog-heading { flex-direction: column; }
  .skill-type-filters .segment { padding-inline: 7px; }
  .skills-catalog-filters { grid-template-columns: minmax(0, 1fr); }
}

.nav-list .settings-trigger { display: flex; flex-direction: row; justify-content: flex-start; }
.attention-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
:root[data-theme="dark"] .workspace-empty {
  background: var(--surface-strong);
  color: var(--muted);
  border-color: var(--line);
}

/* Agent list, creation, and detail pages */
.agent-office-panel { padding: 24px; background: var(--surface-strong); }
.agent-office-panel .panel-heading { margin-bottom: 14px; }
.agent-office-panel .panel-heading h3 { font-size: 18px; font-weight: 700; }
.agent-page-actions { align-items: center; }
.agent-list-filters { gap: 2px; padding: 3px; }
.agent-list-filters .segment { min-height: 32px; padding: 6px 11px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.agent-list-filters .segment.active { color: #31276b; background: #fff; box-shadow: 0 1px 4px #0001; }
#toggleAgentForm { min-height: 34px; padding: 7px 15px; border-color: #6858cb; background: #6858cb; color: #fff; white-space: nowrap; }
.agent-office-panel .agent-grid { display: block; }
.agent-table-scroll { overflow-x: auto; }
.agent-table { width: 100%; min-width: 830px; border-collapse: collapse; table-layout: fixed; }
.agent-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; }
.agent-table th:nth-child(1) { width: 33%; }
.agent-table th:nth-child(2) { width: 11%; }
.agent-table th:nth-child(3) { width: 24%; }
.agent-table th:nth-child(4), .agent-table th:nth-child(5) { width: 7%; }
.agent-table th:nth-child(6) { width: 13%; }
.agent-table th:nth-child(7) { width: 5%; }
.agent-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; vertical-align: middle; }
.agent-table tbody tr:last-child td { border-bottom: 0; }
.agent-table tbody tr { cursor: pointer; }
.agent-table tbody tr:hover, .agent-table tbody tr:focus-visible { background: #f7f6fb; outline: none; }
.agent-table-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agent-table-identity > span:last-child { min-width: 0; }
.agent-table-identity strong, .agent-table-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-table-identity strong { font-weight: 700; }
.agent-table-identity small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.agent-table .agent-list-avatar { flex: 0 0 38px; width: 38px; height: 38px; }
.agent-working-on { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-table-status { display: inline-block; padding: 5px 8px; border-radius: 4px; color: #676765; background: #efefed; font-size: 11px; font-weight: 600; white-space: nowrap; }
.agent-table-status.working { color: #17629a; background: #e4f2fc; }
.agent-table-status.needs-input { color: #b5333f; background: #fce8ea; }
.agent-table-status.completed { color: #24784b; background: #e6f5e8; }
.agent-row-arrow { color: var(--muted) !important; font-size: 24px !important; text-align: right; }
.agent-table-empty { padding: 24px !important; color: var(--muted) !important; text-align: center; }
.agent-create-page, .agent-detail-page { display: grid; align-content: start; gap: 16px; }
.topbar[hidden] { display: none; }
.agent-back-link { justify-self: start; padding: 0; border: 0; background: none; color: #6858cb; font-size: 13px; font-weight: 600; }
.agent-create-page > h3, .agent-detail-page > h3 { margin: 0 0 12px; font-size: 30px; line-height: 1.2; }
.agent-create-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 14px; align-items: start; }
.agent-create-form { display: grid; gap: 18px; max-width: none; padding: 24px; }
.agent-create-intro h4 { margin: 0 0 6px; font-size: 18px; }
.agent-create-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.agent-create-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agent-create-form label { color: var(--ink); font-size: 13px; font-weight: 600; }
.agent-create-form textarea { min-height: 76px; }
.agent-create-status { display: grid; gap: 8px; font-size: 12px; }
.agent-create-status p { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.agent-starting-skills { display: grid; }
.agent-starting-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; }
.agent-starting-skills > label { display: flex; align-items: center; gap: 10px; min-height: 56px; border-top: 1px solid var(--line); }
.agent-starting-skills > label input { flex: 0 0 16px; width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: #6858cb; }
.agent-starting-skills > label > span { display: grid; gap: 2px; flex: 1; }
.agent-starting-skills > label small { color: var(--muted); font-size: 11px; font-weight: 400; }
.agent-starting-skills > label em { padding: 5px 7px; border-radius: 4px; background: #e4f2fc; color: #17629a; font-size: 10px; font-style: normal; }
.agent-create-route { display: grid; gap: 4px; font-size: 12px; }
.agent-create-route p { margin: 0; color: var(--muted); }
.agent-create-form footer { display: flex; justify-content: flex-start; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.agent-create-preview { padding: 24px; background: var(--surface-strong); }
.agent-create-preview h4 { margin: 0 0 18px; font-size: 17px; }
.agent-create-preview > div { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.agent-preview-avatar { display: grid; flex: 0 0 52px; width: 52px; height: 52px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 26px; }
.agent-create-preview > div > span:last-child { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.agent-create-preview small { color: var(--muted); font-size: 11px; }
.agent-create-form .primary-button, .agent-detail-hero .primary-button, .agent-detail-list .primary-button { border-color: #6858cb; background: #6858cb; color: #fff; }
.agent-detail-hero { display: flex; align-items: center; gap: 14px; padding: 18px; }
.agent-detail-hero > .agent-list-avatar { flex: 0 0 52px; width: 52px; height: 52px; }
.agent-detail-hero-copy { flex: 1; min-width: 0; }
.agent-detail-hero-copy p { margin: 0 0 8px; font-size: 13px; }
.agent-detail-hero-copy small { display: block; margin-top: 8px; color: var(--muted); }
.agent-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.agent-detail-badges > span:not(.agent-table-status) { padding: 5px 7px; border-radius: 4px; background: #f0f0ee; color: var(--muted); font-size: 11px; }
:root[data-theme="dark"] .agent-detail-hero .primary-button { border-color: var(--blue); background: var(--blue); color: var(--bg); }
:root[data-theme="dark"] .agent-detail-page .agent-table-status { background: var(--control-track); color: var(--muted); }
:root[data-theme="dark"] .agent-detail-page .agent-table-status.working { background: #183145; color: #9dd4ff; }
:root[data-theme="dark"] .agent-detail-page .agent-table-status.needs-input { background: #41242a; color: #ffb3bb; }
:root[data-theme="dark"] .agent-detail-page .agent-table-status.completed { background: #1d3628; color: #a2dfb5; }
.agent-detail-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-detail-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-detail-tabs button { padding: 9px 12px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12px; }
.agent-detail-tabs button.active { background: #fff; color: #342976; box-shadow: 0 1px 4px #0001; }
.agent-overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.agent-overview-main, .agent-overview-side { display: grid; gap: 14px; min-width: 0; }
.agent-overview-grid .panel, .agent-detail-list { padding: 20px; border-radius: 10px; background: var(--surface-strong); }
.agent-overview-grid h4, .agent-detail-list h4 { margin: 0 0 15px; font-size: 15px; }
.agent-overview-role p { margin-bottom: 18px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.agent-overview-role h5 { margin: 0 0 8px; font-size: 12px; }
.agent-capability-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-capability-tags span { padding: 5px 8px; border-radius: 4px; background: #f2f2f0; color: var(--muted); font-size: 11px; }
.agent-overview-stats > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.agent-overview-stats > div > span { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.agent-overview-stats strong { font-size: 17px; }
.agent-overview-stats small, .agent-overview-now small, .agent-overview-artifacts small { color: var(--muted); font-size: 11px; }
.agent-overview-now > div { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.agent-overview-now > div > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.agent-overview-now strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-overview-grid .agent-overview-artifacts { padding: 22px 24px 24px; border-radius: 14px; }
.agent-overview-artifacts h4 { margin: 0 0 14px; font-size: 17px; line-height: 22px; letter-spacing: -.2px; }
.agent-recent-artifact { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.agent-recent-artifact > img { display: block; flex: 0 0 18px; width: 18px; height: 18px; }
.agent-recent-artifact > span { display: grid; gap: 2px; flex: 1; min-width: 0; letter-spacing: -.14px; }
.agent-recent-artifact strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 16px; }
.agent-overview-artifacts .agent-recent-artifact small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.67px; line-height: 14px; }
.agent-recent-artifact:hover strong { color: var(--blue); }
.agent-recent-artifact:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
:root[data-theme="dark"] .agent-recent-artifact > img { filter: brightness(0) invert(.67); }
.agent-detail-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.agent-detail-task-filters, .workflow-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--control-track);
}
.agent-detail-task-filters button, .workflow-history-filters button { padding: 6px 9px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 11px; }
.agent-detail-task-filters button.active, .workflow-history-filters button[aria-pressed="true"] { background: var(--surface-strong); color: var(--control-selected-ink); }
.agent-detail-task-heading, .agent-detail-task-row { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(80px, .7fr) minmax(150px, 1.5fr) minmax(80px, .7fr) minmax(72px, .6fr) 14px; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.agent-detail-task-heading { color: var(--muted); font-size: 11px; }
.agent-detail-task-row > .task-dashboard-status { justify-self: start; max-width: 100%; padding: 4px 8px; line-height: 14px; }
.agent-detail-task-row > .task-dashboard-status:is(.pending, .queued, .draft, .cancelled) { background: color-mix(in srgb, var(--ink) 9%, var(--surface)); }
.agent-detail-task-row strong { font-weight: 600; }
.agent-detail-task-row > span:first-child { display: grid; gap: 3px; min-width: 0; }
.agent-detail-task-row > span:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-detail-task-row > span:first-child small { color: var(--muted); font-size: 11px; }
.agent-detail-task-row > span:nth-child(3), .agent-detail-task-row > span:nth-child(5) { color: var(--muted); }
.agent-subtask-toggle { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11px; font-weight: 400; }
.agent-subtask-toggle input { width: 26px; min-height: 14px; height: 14px; margin: 0; accent-color: #6858cb; }
.agent-task-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; color: var(--muted); font-size: 11px; }
.agent-detail-card-list { display: grid; gap: 10px; }
.agent-detail-card-list article { display: grid; justify-items: start; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.agent-detail-card-list article p { margin: 0; color: var(--muted); line-height: 1.5; }
.agent-detail-empty { margin: 0; padding: 18px 0; color: var(--muted); }
.agent-detail-config { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 13px; }
.agent-detail-config dt { color: var(--muted); }
.agent-detail-config dd { margin: 0; }
.workflow-library-card { min-height: 320px; padding: 22px; border-color: #e3e3df; border-radius: 10px; }
.workflow-library-card h4 { font-size: 18px; font-weight: 700; }
.workflow-library-card p { font-size: 13px; line-height: 1.6; }
.workflow-library-card footer { min-height: 56px; }
.workflow-library-card footer .primary-button { border-color: #6858cb; background: #6858cb; color: #fff; }
.workflow-owner { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.workflow-owner .agent-list-avatar { flex: 0 0 28px; width: 28px; height: 28px; }
.workflow-owner span:last-child { display: grid; gap: 2px; }
.workflow-owner small { color: var(--muted); font-size: 10px; }
.workflow-owner strong { overflow: hidden; max-width: 160px; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
:root[data-theme="dark"] .agent-table tbody tr:hover, :root[data-theme="dark"] .agent-table tbody tr:focus-visible { background: var(--surface); }
:root[data-theme="dark"] .agent-detail-tabs button.active { background: var(--surface-strong); color: var(--ink); }
:root[data-theme="dark"] .agent-detail-badges > span:not(.agent-table-status), :root[data-theme="dark"] .agent-capability-tags span { background: var(--surface); }
@media (max-width: 1050px) {
  .agent-office-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .agent-page-actions { width: 100%; justify-content: space-between; }
  .agent-detail-hero { align-items: flex-start; flex-wrap: wrap; }
  .agent-detail-hero-actions { width: 100%; justify-content: flex-end; }
  .agent-create-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .agent-list-filters { max-width: 100%; overflow-x: auto; }
  .agent-page-actions { flex-wrap: wrap; }
  .agent-overview-grid { grid-template-columns: 1fr; }
  .agent-create-fields { grid-template-columns: 1fr; }
  .agent-detail-task-heading, .agent-detail-task-row { grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr); }
  .agent-detail-task-heading span:nth-child(n+3), .agent-detail-task-row > span:nth-child(n+3) { display: none; }
}

/* Workflow library and draft editor */
.workflow-library-panel { padding: 24px; background: var(--surface-strong); }
.workflow-library-panel .panel-heading h3 { font-size: 17px; }
.workflow-library-panel .panel-heading .primary-button, .workflow-create-page .primary-button { border-color: #6858cb; background: #6858cb; color: #fff; }
.workflow-library-controls { display: flex; align-items: end; gap: 12px; margin: 20px 0 24px; }
.workflow-library-controls label { min-width: 0; color: var(--ink); font-size: 12px; }
.workflow-library-controls label:first-child { width: 300px; }
.workflow-library-controls label:nth-child(2) { width: 190px; }
.workflow-library-controls input, .workflow-library-controls select { min-height: 34px; }
.workflow-scope { display: grid; gap: 7px; margin-left: auto; color: var(--ink); font-size: 12px; font-weight: 600; }
.workflow-scope .segmented { display: flex; gap: 2px; padding: 3px; }
.workflow-scope .segment { white-space: nowrap; }
.workflow-group-heading { display: flex; align-items: center; gap: 8px; margin: 20px 0 14px; color: var(--muted); font-size: 12px; }
.workflow-group-heading span { padding: 4px 7px; border-radius: 3px; background: #efefed; font-size: 11px; }
.workflow-library { gap: 14px; }
.workflow-library-card { min-height: 190px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; box-shadow: none; }
.workflow-library-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.workflow-library-card h4 svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.workflow-card-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.workflow-card-pills span { padding: 5px 7px; border-radius: 3px; background: #f0f0ee; color: var(--muted); font-size: 11px; font-weight: 600; }
.workflow-card-pills span.built-in { background: #efedff; color: #6858cb; }
:root[data-theme="dark"] .workflow-library-card { border-color: var(--line-strong); }
:root[data-theme="dark"] .workflow-card-pills span,
:root[data-theme="dark"] .workflow-group-heading span {
  background: #2a2932;
  color: #d9d7e2;
}
:root[data-theme="dark"] .workflow-card-pills span.built-in {
  background: #302347;
  color: #d0bcff;
}
.workflow-library-card p { flex: 1; margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.workflow-library-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding-top: 10px; margin-top: auto; font-size: 11px; }
.workflow-library-card footer .secondary-button { flex: 0 0 auto; }
.workflow-card-meta { display: flex; align-items: center; min-width: 0; gap: 7px; color: var(--muted); line-height: 1.3; }
.workflow-avatar-stack { display: flex; flex: 0 0 auto; padding-left: 4px; }
.workflow-avatar { display: grid; width: 24px; height: 24px; margin-left: -4px; padding: 2px; border: 2px solid var(--surface-strong); border-radius: 7px; background: #29263d; }
.workflow-avatar img { width: 100%; height: 100%; object-fit: contain; }
.workflow-create-page, .workflow-detail-page { display: grid; align-content: start; gap: 16px; }
.workflow-create-page > h3, .workflow-detail-page > h3 { margin: 0 0 12px; font-size: 30px; }
.workflow-draft-warning { padding: 13px 16px; border-radius: 8px; background: #fbe9db; color: #9d4816; font-size: 13px; }
.workflow-create-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 14px; align-items: start; }
.workflow-create-form, .workflow-create-side { display: grid; gap: 14px; }
.workflow-create-form .panel, .workflow-create-side .panel { padding: 24px; background: var(--surface-strong); }
.workflow-create-form h4, .workflow-create-side h4, .workflow-detail-page h4 { margin: 0 0 16px; font-size: 17px; }
.workflow-create-form label, #workflowStageEditor label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; }
.workflow-create-form .panel:first-child { display: grid; gap: 16px; }
.workflow-create-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr); gap: 14px; }
.workflow-create-form textarea, #workflowStageEditor textarea { min-height: 76px; }
.workflow-stage-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.workflow-stage-row.selected { border-color: #c9c4f6; background: #f0edff; }
.workflow-stage-row > button:first-child { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.workflow-stage-row > button:first-child > span:first-child { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #f0f0ee; }
.workflow-stage-row.selected > button:first-child > span:first-child { background: #6858cb; color: #fff; }
.workflow-stage-row > button:first-child > span:last-child { display: grid; gap: 3px; min-width: 0; }
.workflow-stage-row strong { font-size: 12px; }
.workflow-stage-row small, .workflow-handoff { color: var(--muted); font-size: 11px; }
.workflow-stage-row > span { color: var(--muted); font-size: 11px; }
.workflow-stage-row > button:last-child { border: 0; background: none; color: var(--muted); font-size: 20px; }
.workflow-handoff { margin: 8px 0 8px 46px; }
.workflow-add-stage-bottom { width: 100%; min-height: 40px; margin-top: 8px; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--muted); }
.workflow-create-form footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.workflow-create-form footer > div { display: flex; gap: 8px; }
#workflowStageEditor { display: grid; gap: 14px; }
#workflowStageAgents > div { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
#workflowStageAgents > div > span:last-child { display: grid; gap: 3px; }
#workflowStageAgents small { color: var(--muted); font-size: 11px; }
.workflow-detail-hero { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface-strong); }
.workflow-detail-hero > div:nth-child(2) { display: grid; gap: 8px; flex: 1; }
.workflow-detail-hero strong { font-size: 17px; }
.workflow-hero-icon { display: grid; flex: 0 0 56px; width: 56px; height: 56px; place-items: center; border-radius: 10px; background: #efedff; color: #6858cb; }
.workflow-hero-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.workflow-detail-stages, .workflow-detail-bottom .panel { padding: 24px; background: var(--surface-strong); }
.workflow-detail-stages > div:last-child { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.workflow-detail-stage { display: grid; align-content: start; gap: 6px; min-height: 118px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.workflow-detail-stage > span { display: flex; align-items: center; gap: 7px; color: #6858cb; }
.workflow-detail-stage .agent-list-avatar { width: 28px; height: 28px; padding: 3px; }
.workflow-detail-stage strong { font-size: 13px; }
.workflow-detail-stage small, .workflow-detail-stage p { margin: 0; color: var(--muted); font-size: 11px; }
.workflow-detail-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; margin-top: 14px; }
.workflow-detail-stats { display: flex; gap: 8px; }
.workflow-detail-stats > span { display: grid; min-width: 120px; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.workflow-detail-stats strong { font-size: 18px; }
.workflow-detail-stats small { color: var(--muted); }

.string-review-page { display: grid; gap: 24px; }
.string-review-page header .agent-back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
.string-review-page header .agent-back-link img { transform: rotate(180deg); }
.string-review-page h3 { margin: 4px 0 6px; font-size: 30px; line-height: 36px; letter-spacing: -.6px; }
.string-review-page .workflow-detail-hero { border: 0; border-radius: 14px; }
.string-review-page .workflow-card-pills span { padding: 4px 8px; line-height: 14px; }
.string-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 32.6%); align-items: start; gap: 14px; }
.string-review-layout.is-active { grid-template-columns: minmax(0, 3fr) minmax(290px, 2fr); }
.string-review-layout > div { display: grid; gap: 14px; }
.string-review-panel { min-width: 0; border: 0; border-radius: 14px; padding: 22px 24px 24px; background: var(--surface-strong); }
.string-review-panel h4 { margin: 0 0 14px; font-size: 17px; line-height: 22px; }
.string-review-panel small, .string-review-note { color: var(--muted); font-size: 11.67px; line-height: 14px; }
.string-review-panel strong, .string-review-panel small { overflow-wrap: anywhere; }
.string-review-form, .string-review-form label { display: grid; gap: 6px; }
.string-review-form label { font-size: 12px; font-weight: 600; }
.string-review-form input { width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font-size: 12px; }
.string-review-link-state { display: flex; align-items: center; gap: 8px; margin: 5px 0 8px; color: var(--muted); font-size: 11.67px; }
.string-review-link-state:empty { display: none; }
.string-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.string-review-form .string-review-actions { margin-top: 8px; }
.string-review-actions button { min-height: 34px; padding: 0 16px; }
.string-review-stages, .string-review-history { list-style: none; margin: 0; padding: 0; }
.string-review-stages li, .string-review-history li { display: grid; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.string-review-stages li { grid-template-columns: 24px minmax(0, 1fr); min-height: 55px; }
.string-review-stages li strong, .string-review-history li strong { display: block; line-height: 18px; }
.string-stage-marker { display: grid; place-items: center; }
.string-review-history li { grid-template-columns: 16px minmax(0, 1fr) auto; }
.string-review-history .string-review-empty { display: block; color: var(--muted); }
.string-review-stages.is-active { display: grid; gap: 8px; }
.string-review-stages.is-active li { grid-template-columns: 28px 32px minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.string-review-stages.is-active li.waiting { border-color: #f2d2ae; }
.string-review-stages.is-active li strong { font-size: 14px; line-height: 20px; }
.string-review-stages.is-active .string-stage-marker { height: 28px; border-radius: 50%; background: #f0f0ee; color: #5d5d59; font-size: 11px; }
.string-review-stages li.completed .string-stage-marker { background: #dff6dd; }
.string-review-stages li.waiting .string-stage-marker { background: #fff1df; }
.string-stage-avatar { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #28243b; }
.string-stage-avatar > span { position: relative; width: 26px; height: 26px; overflow: hidden; }
.string-stage-avatar img { position: absolute; top: 4.95px; left: 2.85px; }
.string-stage-avatar img + img { top: -3.43px; left: -3.43px; mask: url("assets/figma-ui/stage-writer-mask.svg") luminance 6.28px 8.38px / 20.121px 17.425px no-repeat; }
.string-run-status { width: max-content; border-radius: 3px; padding: 4px 8px; background: #f0f0ee; color: #5d5d59; font-size: 11px; font-weight: 600; line-height: 14px; }
.string-run-status.completed { background: #dff6dd; color: #176b21; }
.string-run-status.running { background: #e0effa; color: #17537d; }
.string-run-status.failed { background: #fce7e8; color: #a42029; }
.string-run-status.waiting { background: #fff1df; color: #803806; }
.string-review-count { margin: 0 0 4px; }
.string-review-note { margin: 0 0 12px; }
.string-review-select, .string-review-finding { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.string-review-select { justify-content: space-between; font-size: 12px; font-weight: 600; }
.string-review-select > span { display: inline-flex; align-items: center; gap: 10px; }
.string-review-finding { min-height: 53px; font-size: 12px; }
.string-review-finding small { margin-left: 5px; }
.string-review-copy { display: block; overflow-wrap: anywhere; line-height: 18px; }
.string-review-page input[type="checkbox"] { appearance: none; display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.string-review-page input[type="checkbox"]:checked, .string-review-page input[type="checkbox"]:indeterminate { background: var(--blue); border-color: var(--blue); }
.string-review-page input[type="checkbox"]:checked::after { content: url("assets/figma-ui/review-checkbox.svg"); display: block; height: 11px; line-height: 0; }
.string-review-page input[type="checkbox"]:indeterminate::after { content: ""; width: 8px; height: 2px; background: white; }
@media (max-width: 1020px) {
  .string-review-layout, .string-review-layout.is-active { grid-template-columns: minmax(0, 1fr); }
}
.workflow-run-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.workflow-run-row span { color: var(--muted); }
@media (max-width: 1100px) {
  .workflow-library-controls { flex-wrap: wrap; }
  .workflow-scope { margin-left: 0; }
  .workflow-detail-stages > div:last-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .workflow-create-layout, .workflow-detail-bottom { grid-template-columns: 1fr; }
  .workflow-library-controls label:first-child, .workflow-library-controls label:nth-child(2) { flex: 1 1 180px; width: auto; }
  .workflow-detail-stages > div:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-create-fields { grid-template-columns: 1fr; }
}

.agent-detail-section-head > div:first-child p { margin: -8px 0 12px; color: var(--muted); font-size: 12px; }
.agent-detail-heading-actions { display: flex; gap: 8px; }
.agent-skill-list article { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.agent-detail-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.agent-detail-split > aside { display: grid; gap: 14px; }
.agent-detail-side-card { padding: 20px; background: var(--surface-strong); }
.agent-detail-side-card h4 { margin: 0 0 14px; font-size: 15px; }
.agent-detail-side-card > p { margin: -4px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agent-suggestion { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.agent-suggestion strong { font-size: 12px; }
.agent-suggestion small { grid-column: 1; color: var(--muted); font-size: 11px; }
.agent-suggestion button, .agent-suggestion .pill { grid-column: 2; grid-row: 1 / span 2; }
.agent-suggestion button { padding: 6px 8px; border: 0; border-radius: 6px; background: var(--control-track); color: var(--ink); }
.agent-skill-import { display: grid; justify-items: center; gap: 6px; width: 100%; min-height: 95px; padding: 16px; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--muted); }
.agent-skill-import strong { color: var(--ink); font-size: 11px; }
.agent-skill-import small { font-size: 10px; }
.agent-detail-side-card form { display: grid; gap: 10px; }
.agent-detail-side-card form .primary-button { width: 100%; }
.agent-skill-list article > span:nth-child(2) { flex: 1; min-width: 0; }
.agent-skill-list strong { font-size: 13px; }
.agent-skill-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.agent-skill-list .pill { margin-left: 8px; }
.agent-skill-list article > button { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 18px; }
.agent-skill-list article > button:hover { background: var(--track); }
.agent-skill-list article > button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.agent-skill-list article > button img { display: block; }
:root[data-theme="dark"] .agent-skill-list article > button img { filter: brightness(0) invert(.67); }
.agent-skill-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 18px; }
.agent-workflow-cards { display: grid; gap: 12px; }
.agent-workflow-cards article { padding: 18px; border: 1px solid var(--line); border-radius: 9px; }
.agent-workflow-cards article > div { display: flex; align-items: center; gap: 10px; }
.agent-workflow-cards article > div > strong { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.agent-workflow-cards article > div svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.agent-workflow-cards article > div > button { margin-left: auto; }
.agent-workflow-cards p { margin: 12px 0; color: var(--muted); font-size: 12px; }
.agent-workflow-cards ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.agent-workflow-cards li { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; }
.agent-workflow-cards li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.agent-workflow-cards article > small { color: var(--muted); }
.agent-detail-conversation { max-width: 900px; }
.agent-chat-history { display: grid; gap: 16px; min-height: 220px; padding: 18px 0; }
.agent-chat-history article { display: grid; justify-items: start; gap: 5px; max-width: 80%; }
.agent-chat-history article.user { justify-self: end; }
.agent-chat-history article > span { display: flex; gap: 8px; color: var(--muted); font-size: 11px; }
.agent-chat-history article p { margin: 0; padding: 12px 14px; border-radius: 10px; background: #f0f0ee; line-height: 1.5; }
.agent-chat-history article.user p { background: #efedff; }
#agentDetailMessageForm { display: flex; align-items: end; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
#agentDetailMessageForm .agent-detail-composer { position: relative; min-width: 0; flex: 1; }
#agentDetailMessageForm textarea { display: block; width: 100%; min-height: 54px; }
#agentDetailMessageForm .agent-skill-picker { bottom: calc(100% + 8px); }
.agent-config-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 14px; align-items: start; }
.agent-config-form, .agent-config-preview { padding: 24px; background: var(--surface-strong); }
.agent-config-form { display: grid; gap: 18px; }
.agent-config-form > div:first-child p { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.agent-config-form label { color: var(--ink); }
.agent-config-form textarea { min-height: 90px; }
.agent-config-form footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.agent-config-preview > div { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.agent-config-preview > div > span:last-child { display: grid; justify-items: start; gap: 4px; }
.agent-config-preview small { color: var(--muted); }
:root[data-theme="dark"] .agent-chat-history article p { background: var(--surface); }
@media (max-width: 760px) {
  .agent-detail-split { grid-template-columns: 1fr; }
  .agent-config-layout { grid-template-columns: 1fr; }
  .agent-detail-heading-actions { flex-wrap: wrap; }
  #agentDetailMessageForm { flex-direction: column; align-items: stretch; }
}

/* Library screens */
#outputs.page-view { gap: 16px; }
.library-tabs { display: flex; align-self: flex-start; gap: 2px; padding: 3px; border: 0; background: transparent; }
.library-tabs .segment { min-height: 34px; padding: 8px 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.library-tabs .segment.active { background: var(--surface-strong); color: #332c73; box-shadow: 0 1px 3px #1f1f1d1a; }
.library-content { display: grid; gap: 16px; min-width: 0; }
.library-main-panel { padding: 24px; border-radius: 14px; background: var(--surface-strong); }
.library-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 34px; margin-bottom: 14px; }
.library-panel-head h3, .library-detail-side h3, .library-detail-preview h3, .library-lifecycle h3, .library-issue-form h3 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.library-panel-head > div { display: flex; align-items: center; gap: 8px; }
.library-panel-head .primary-button, .library-issue-form .primary-button { border-color: #6858cb; background: #6858cb; color: #fff; }
.library-view-switch { display: flex; gap: 2px; padding: 3px; }
.library-view-switch .segment { min-height: 29px; padding: 5px 10px; }
.library-filter-row { display: grid; max-width: 876px; grid-template-columns: minmax(190px, 5fr) repeat(3, minmax(120px, 3fr)); gap: 12px; margin-bottom: 22px; }
.library-filter-row label, .library-issue-filters label, .library-issue-form label, .library-composer label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; }
.library-filter-row input, .library-filter-row select, .library-issue-filters input, .library-issue-filters select { width: 100%; min-height: 32px; }
.library-artifact-group + .library-artifact-group { margin-top: 20px; }
.library-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 34px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.library-group-head .secondary-button { min-height: 34px; padding: 7px 12px; }
.library-artifact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.library-artifact-card { display: flex; flex-direction: column; min-width: 0; min-height: 198px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); }
.library-artifact-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.library-artifact-meta .pill { min-height: 22px; padding: 4px 8px; background: #f0f0ee; color: var(--muted); font-size: 11px; }
.library-artifact-meta small { color: var(--muted); font-size: 11px; }
.library-artifact-card h4 { margin: 12px 0 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.library-artifact-card p { display: -webkit-box; overflow: hidden; margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 20px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.library-artifact-card footer { display: flex; align-items: center; gap: 10px; min-width: 0; padding-top: 12px; margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.library-artifact-card footer .agent-list-avatar { flex: 0 0 24px; width: 24px; height: 24px; padding: 2px; border-radius: 8px; }
.library-artifact-card footer > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-artifact-card footer button, .library-artifact-card footer a { display: grid; width: 32px; height: 32px; place-items: center; padding: 3px; border: 0; background: none; color: var(--muted); font-size: 18px; text-decoration: none; }
.library-artifact-card footer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.library-artifact-card footer img { display: block; }
.library-artifact-card footer a[download] { flex: 0 0 32px; border-radius: 6px; }
.library-artifact-card footer a[download]:hover { background: var(--bg); color: var(--ink); }
.library-artifact-group { min-width: 0; }
.library-group-head a.secondary-button { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.library-table-scroll { position: relative; max-width: 100%; overflow-x: auto; }
.library-artifact-table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: collapse; color: var(--ink); font-size: 12px; line-height: 14px; }
.library-artifact-table th, .library-artifact-table td { padding: 11px 16px 11px 0; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.library-artifact-table thead th { padding-block: 0 8px; color: var(--muted); font-weight: 400; }
.library-artifact-table .library-repeat-header th { padding-block: 0; }
.library-artifact-table thead th:nth-child(2) { width: 116px; }
.library-artifact-table thead th:nth-child(3) { width: 216px; }
.library-artifact-table thead th:nth-child(4) { width: 92px; }
.library-artifact-table thead th:last-child { width: 80px; }
.library-artifact-table tr > :last-child { padding-inline-end: 0; }
.library-artifact-table tbody tr { border-top: 1px solid var(--line); }
.library-artifact-table tbody th { font-weight: 400; }
.library-artifact-table strong { display: block; font-size: 13px; line-height: 18px; }
.library-artifact-table small { display: block; margin-top: 2px; color: var(--muted); font-size: inherit; }
.library-artifact-table th small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-artifact-table td:nth-child(4) { color: var(--muted); }
.library-artifact-table .pill { display: inline-block; max-width: 100%; padding: 4px 8px; border: 0; border-radius: 3px; background: var(--bg); color: var(--muted); font-size: 11px; white-space: normal; }
.library-row-agent, .library-row-actions { display: flex; align-items: center; gap: 8px; }
.library-row-agent .agent-list-avatar { width: 24px; height: 24px; flex: 0 0 24px; padding: 2px; }
.library-row-actions { justify-content: end; gap: 10px; flex-wrap: wrap; }
.library-row-actions :is(button, a) { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.library-row-actions :is(button, a):hover { background: var(--bg); }
.library-row-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
:root[data-theme="dark"] .library-row-actions :is(button, a) { background: var(--surface-strong); }
:root[data-theme="dark"] .library-row-actions img { filter: brightness(0) invert(.85); }

.library-load-more { margin-top: 16px; }
.library-empty { padding: 18px 0; margin: 0; color: var(--muted); font-size: 12px; }
.library-experience-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.library-experience-card { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.library-experience-card .pill { justify-self: start; background: #f0f0ee; color: var(--muted); font-size: 10px; }
.library-experience-card h4 { margin: 0; font-size: 15px; }
.library-experience-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.library-experience-card small { color: var(--muted); font-size: 11px; }
.library-tool-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.library-tool-row:hover { background: var(--bg); }
.library-tool-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.library-tool-icon { color: var(--muted); font-size: 17px; }
.library-tool-icon img { display: block; }
.library-tool-row > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 2px; }
.library-tool-row strong { font-size: 13px; }
.library-tool-row small { color: var(--muted); font-size: 12px; }
.library-tool-open { flex: 0 0 auto; color: var(--muted); font-size: 18px; }
.library-tool-extra a { color: #6858cb; }
.library-composer { display: grid; gap: 12px; padding: 14px; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; }
.library-composer > div:last-child { display: flex; justify-content: flex-end; gap: 8px; }
.library-issue-filters { display: grid; grid-template-columns: minmax(220px, 1.7fr) minmax(150px, 1fr) minmax(120px, .7fr) minmax(120px, .8fr); gap: 10px; align-items: end; margin-bottom: 16px; }
.library-issue-filters > div:first-child { display: grid; gap: 6px; font-size: 12px; }
.library-issue-filters .segmented { display: flex; justify-self: start; padding: 3px; }
.library-issue-filters .segment { min-height: 30px; padding: 6px 9px; font-size: 11px; white-space: nowrap; }
.library-issue-table { width: 100%; }
.library-issue-heading, .library-issue-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) minmax(90px, .8fr) 80px minmax(150px, 1.5fr) 54px 14px; gap: 12px; align-items: center; width: 100%; border-bottom: 1px solid var(--line); text-align: left; }
.library-issue-heading { min-height: 28px; color: var(--muted); font-size: 12px; }
.library-issue-row { min-height: 60px; padding: 9px 0; border-top: 0; border-right: 0; border-left: 0; background: none; color: var(--ink); font-size: 13px; cursor: pointer; }
.library-issue-row > span:first-child, .library-issue-row > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.library-issue-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.library-issue-row small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.library-issue-row > span:nth-child(4) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-issue-row > span:last-child { font-size: 18px; text-align: right; }
.library-issue-row:hover { background: #f8f7fc; }
:root[data-theme="dark"] .library-issue-row:hover,
:root[data-theme="dark"] .library-issue-row:focus-visible { background: var(--blue-soft); }
:root[data-theme="dark"] .library-issue-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.library-issue-status { display: inline-block; padding: 5px 7px; border-radius: 3px; font-size: 10px; font-style: normal; font-weight: 600; }
.library-issue-status.open { background: #fbe9db; color: #a04b1c; }
.library-issue-status.resolved { background: #e5f5e5; color: #2e7b36; }
.library-issue-footer { display: flex; align-items: center; justify-content: space-between; min-height: 40px; color: var(--muted); font-size: 10px; }
.library-detail-page { display: grid; align-content: start; gap: 10px; }
.library-tool-detail-page { display: grid; grid-template-rows: auto auto 960px; gap: 8px; }
.library-tool-back { display: inline-flex; align-items: center; justify-self: start; padding: 0; border: 0; background: none; color: #675bcb; font-size: 12px; font-weight: 600; cursor: pointer; }
.library-tool-detail-page h2 { margin: 0 0 10px; color: var(--ink); font-size: 30px; line-height: 36px; letter-spacing: -0.6px; }
.library-tool-frame { display: block; width: 100%; height: 960px; border: 0; border-radius: 14px; background: #f7f7f5; }
.library-3d-viewer-page { grid-template-rows: auto auto auto; }
.library-tool-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.library-3d-viewer-page .library-tool-back { color: var(--blue); }
.library-3d-viewer-frame { height: clamp(710px, 82dvh, 960px); color-scheme: light; }
:root[data-theme="dark"] .library-3d-viewer-frame { color-scheme: dark; }
.library-detail-page > h3 { margin: 0; font-size: 30px; line-height: 36px; }
.library-detail-subtitle { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.library-detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.library-detail-preview, .library-detail-side .panel, .library-issue-form, .library-lifecycle, .library-problem, .library-solutions { padding: 24px; background: var(--surface-strong); }
.library-detail-side { display: grid; gap: 10px; }
.library-detail-side h3 { padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.library-detail-side dl { display: grid; grid-template-columns: 90px 1fr; gap: 12px 8px; margin: 0; font-size: 12px; }
.library-detail-side dt { color: var(--muted); }
.library-detail-side dd { margin: 0; text-align: right; font-weight: 600; }
.library-detail-side dd small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; }
.library-detail-side .panel > p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.library-from-task { display: grid; gap: 5px; margin-top: 16px; }
.library-from-task small { color: var(--muted); }
.library-from-task button { display: flex; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: none; text-align: left; font-size: 11px; }
.library-related-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.library-related-row > span:last-child { display: grid; gap: 3px; }
.library-related-row strong { font-size: 11px; }
.library-related-row small { color: var(--muted); font-size: 10px; }
.library-export-row { display: flex; align-items: center; gap: 8px; }
.library-export-row > span:first-child svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); }
.library-export-row > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.library-export-row strong { font-size: 11px; }
.library-export-row small { color: var(--muted); font-size: 10px; }
.library-export-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.library-preview-body { min-width: 0; min-height: 240px; }
.library-preview-document { font-size: 12px; line-height: 1.6; }
.library-preview-document .wireframe-preview { white-space: pre-wrap; }
.library-workbook { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.library-workbook-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.library-workbook-control select { width: auto; max-width: 100%; }
.library-workbook-count { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.library-workbook-scroll { max-height: min(60vh, 520px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.library-workbook-scroll table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.library-workbook-scroll :is(th, td) { min-width: 96px; max-width: 260px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-workbook-scroll th { position: sticky; top: 0; background: var(--bg); font-weight: 650; }
.library-workbook-scroll tr > :last-child { border-right: 0; }
.library-workbook-scroll tbody tr:last-child td { border-bottom: 0; }
.library-screen-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.library-screen-grid figure { min-width: 0; margin: 0; }
.library-screen-grid pre { overflow: auto; min-height: 130px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; color: #666; background: #fff; font-size: 9px; }
.library-screen-grid figcaption { margin-top: 5px; font-size: 10px; }
.library-issue-form { display: grid; gap: 14px; }
.library-issue-form > h3 { margin-bottom: 2px; }
.library-issue-form input, .library-issue-form select, .library-issue-form textarea { width: 100%; }
.library-form-label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.library-form-label .pill { color: var(--muted); }
.library-form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.library-form-status { display: grid; gap: 6px; font-size: 12px; }
.library-form-status .segmented { display: flex; justify-self: start; }
.library-form-status .segmented label { display: flex; align-items: center; padding: 6px 10px; }
.library-form-status input { width: auto; min-height: 0; margin: 0 5px 0 0; }
.library-form-status small { color: var(--muted); }
.library-solution-field { display: grid; gap: 6px; font-size: 12px; }
.library-solution-field > div { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.library-solution-option { display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.library-solution-option:last-child { border-bottom: 0; }
.library-solution-option > span:first-child { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 5px; background: #efedff; color: #6858cb; }
.library-solution-option svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.library-solution-option > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.library-solution-option strong { font-size: 11px; }
.library-solution-option small { color: var(--muted); font-size: 10px; }
.library-solution-option > button:last-child:not(.secondary-button) { border: 0; background: none; color: var(--muted); font-size: 18px; }
.library-issue-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.library-lifecycle ol { display: grid; gap: 12px; padding: 15px 0 10px 22px; margin: 0; font-size: 11px; }
.library-lifecycle li { padding-left: 4px; }
.library-lifecycle > div { display: flex; align-items: center; gap: 8px; }
#issueDetailContent { display: grid; gap: 14px; }
.library-issue-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-strong); }
.library-issue-banner strong { flex: 1; font-size: 11px; }
.library-issue-more { anchor-name: --issue-actions; display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.library-issue-more img { width: 18px; height: 18px; }
.library-issue-more:hover { background: var(--track); }
.library-issue-menu { position: fixed; position-anchor: --issue-actions; inset: auto; top: anchor(bottom); right: anchor(right); margin: 4px 0 0; box-sizing: border-box; width: min(240px, calc(100vw - 24px)); height: max-content; min-height: 0; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 6px; border: 1px solid #dcdcd6; border-radius: 12px; background: rgba(255,255,255,.98); color: #20201f; box-shadow: 0 20px 55px rgba(31,30,28,.2); }
.library-issue-menu:popover-open { display: grid; grid-template-rows: max-content 1px max-content; align-content: start; gap: 8px; }
.library-issue-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 12px/16px Inter, sans-serif; letter-spacing: -.14px; text-align: left; cursor: pointer; }
.library-issue-menu button:hover, .library-issue-menu button:focus-visible { background: var(--track); }
.library-issue-menu button img { width: 16px; height: 16px; flex-shrink: 0; }
.library-issue-menu hr { width: 100%; height: 1px; margin: 0; border: 0; background: #eeeeea; }
.library-issue-menu [data-delete-issue] { color: #b44848; }
:root[data-theme="dark"] .library-issue-menu { border-color: var(--line); background: var(--surface-strong); color: var(--ink); }
:root[data-theme="dark"] .library-issue-more img, :root[data-theme="dark"] .library-issue-menu [data-edit-issue] img { filter: brightness(0) invert(.8); }
:root[data-theme="dark"] .library-issue-menu hr { background: var(--line); }
.library-problem p { font-size: 12px; line-height: 1.55; }
.library-problem > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.library-problem > div > span { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.library-problem small { color: var(--muted); font-size: 10px; }
.library-problem strong { font-size: 11px; }
.library-detail-layout main { display: grid; gap: 10px; }
.library-solutions .library-panel-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.library-solution-picker { display: grid; gap: 7px; padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
.library-solution-picker > div { display: grid; max-height: 200px; overflow: auto; }
.library-solution-picker > div > button { display: flex; justify-content: space-between; padding: 8px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.library-solution-picker small { color: var(--muted); }
.library-history-row { display: grid; grid-template-columns: 50px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.library-history-row:last-child { border-bottom: 0; }
.library-history-row small { color: var(--muted); }
@media (max-width: 1150px) { .library-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .library-issue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 850px) { .library-artifact-grid, .library-experience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .library-detail-layout { grid-template-columns: 1fr; } .library-issue-table { overflow-x: auto; } .library-issue-heading, .library-issue-row { min-width: 760px; } }
@media (max-width: 600px) { .library-tabs { max-width: 100%; overflow-x: auto; } .library-artifact-grid, .library-experience-grid, .library-filter-row, .library-issue-filters, .library-form-two { grid-template-columns: 1fr; } .library-screen-grid { grid-template-columns: 1fr; } .library-problem > div { grid-template-columns: 1fr; } }

/* Shared dialog appearance from the Figma Popover component. */
:root :is(.modal.modal, .popup-surface.popup-surface) {
  --dialog-surface: #fff;
  --dialog-border: #ebebeb;
  --dialog-text: #1f1f1f;
  --dialog-secondary: #f2f2f2;
  --dialog-secondary-text: #3d3d3d;
  --dialog-primary: #1f1f1f;
  --dialog-primary-text: #f8f8f8;
  border: 1px solid var(--dialog-border);
  border-radius: 8px;
  color: var(--dialog-text);
  background: var(--dialog-surface);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
  backdrop-filter: none;
}

:root[data-theme="dark"] :is(.modal.modal, .popup-surface.popup-surface) {
  --dialog-surface: #1f1f1f;
  --dialog-border: #3d3d3d;
  --dialog-text: #f8f8f8;
  --dialog-secondary: #3d3d3d;
  --dialog-secondary-text: #f8f8f8;
  --dialog-primary: #f2f2f2;
  --dialog-primary-text: #1f1f1f;
}

.modal.modal::backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: none; }
:root .modal.modal { max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 16px; }
:root .modal.agent-manager-modal, :root .modal.message-modal { padding: 0; }
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0 0 16px;
}
:is(.modal, .popup-surface) .modal-heading :is(h3, h4) {
  min-width: 0;
  margin: 0;
  color: var(--dialog-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  overflow-wrap: anywhere;
}
:is(.modal, .popup-surface) .modal-heading .close-button {
  position: static;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.modal-heading .close-button:hover { background: var(--dialog-secondary); }
:root[data-theme="dark"] .modal-heading .close-button img { filter: invert(1); }
.agent-manager-modal[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.agent-manager-modal .agent-manager-layout { height: auto; }
.modal .agent-manager-header { margin: 0; padding: 16px; }
.modal .modal-heading + .agent-workspace-role { margin-top: 0; }

:root :is(.modal, .popup-surface) :is(.primary-button, .secondary-button) {
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
}
:root :is(.modal, .popup-surface) .primary-button { color: var(--dialog-primary-text); background: var(--dialog-primary); }
:root :is(.modal, .popup-surface) .secondary-button { color: var(--dialog-secondary-text); background: var(--dialog-secondary); }
:root :is(.modal, .popup-surface) :is(.primary-button, .secondary-button):hover:not(:disabled) { filter: brightness(.93); }
.modal .modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 32px 0 0;
  border: 0;
  background: var(--dialog-surface);
}
.modal .modal-actions > :is(.primary-button, .secondary-button):not(.danger-button) { flex: 1 1 120px; }
.modal .modal-actions > small { flex: 1 0 100%; }
.modal .modal-actions > [hidden], .message-dialog-body > [hidden] { display: none; }
:root .modal .agent-manager-footer { padding: 16px; }
:root .modal .modal-actions .danger-button { color: var(--danger, #a4262c); }

.message-modal { width: 480px; }
.message-modal .modal-heading { margin: 0; padding: 16px; }
.message-dialog-body { padding: 4px 16px 0; font-size: 13px; line-height: 20px; }
.message-dialog-body p { margin: 0; overflow-wrap: anywhere; }
.message-modal .modal-actions { padding: 32px 16px 16px; }
.popup-surface .modal-heading { align-items: flex-start; margin: 0; }
.popup-surface .board-agent-popover-header { padding: 16px; }
.popup-surface .agent-actions { gap: 8px; }

/* S1–S3: settings live in the workspace, alongside the other page routes. */
.settings-page { flex-direction: column; align-items: stretch; gap: 24px; }
.settings-page .settings-tabs { align-self: flex-start; flex: none; gap: 2px; margin: 0; padding: 3px; border-radius: 6px; background: var(--track, #f0f0f0); }
.settings-page .settings-tab { flex: none; min-height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600; border-radius: 8px; }
.settings-tab[hidden] { display: none; }
.settings-columns { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
.settings-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings-card { min-width: 0; margin: 0; }
.settings-card h4 { margin: 0 0 14px; font-size: 17px; line-height: 22px; letter-spacing: -.2px; }
.settings-card p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.settings-card .settings-section-heading { margin: 0 0 14px; }
.settings-card .settings-section-heading h4 { margin-bottom: 4px; }
.settings-card .settings-section-heading p { margin: 0; }
.settings-page .theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
.settings-page .theme-option { width: 100%; padding: 12px; text-align: left; border-radius: 10px; }
.settings-page .theme-option-preview { height: 72px; }
.settings-notification { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.settings-notification strong, .settings-notification small { display: block; }
.settings-notification strong { font-size: 12px; line-height: 16px; }
.settings-notification small { margin-top: 2px; font-size: 11.67px; color: var(--muted); line-height: 14px; }
.settings-notification input { appearance: none; flex: 0 0 30px; width: 30px; min-height: 18px; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 20px; background: #d4d4ce; cursor: pointer; }
.settings-notification input::before { content: ''; display: block; width: 12px; height: 12px; margin: 3px; border-radius: 50%; background: white; }
.settings-notification input:checked { background: var(--blue); }
.settings-notification input:checked::before { transform: translateX(12px); }
.settings-notification input:disabled { opacity: .5; cursor: default; }
.settings-notification input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.settings-facts { margin: 0; }
.personal-name-value { min-width: 0; }
.personal-name-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.personal-name-controls[hidden] { display: none; }
.personal-name-controls input { width: 13rem; max-width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font: inherit; }
.personal-name-value .form-status:not(:empty) { display: block; margin: 4px 0 0; font-weight: 400; }
@media (max-width: 600px) {
  .personal-name-value:has(form:not([hidden])) { width: 100%; }
  form.personal-name-controls:not([hidden]) { display: grid; grid-template-columns: 1fr auto auto; }
  .personal-name-controls input { grid-column: 1 / -1; width: 100%; }
  #cancelPersonalName { grid-column: 2; }
}
.settings-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.settings-facts dt { color: var(--muted); }
.settings-facts dd { margin: 0; font-weight: 700; text-align: right; }
.settings-page .settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-page label > span { font-size: 12px; }
.settings-page label input:not([type=checkbox]) { width: 100%; min-height: 32px; padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.settings-page .settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; }
.settings-page .figma-connection { border: 0; padding: 22px 24px 24px; }
.settings-note { padding: 10px 12px; margin: 0; }
.settings-warning { margin: 0 0 24px; padding: 12px 16px; border-radius: 8px; background: #fcebdc; color: #9b3b00; font-size: 12px; }
.settings-run-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.settings-run-row > span { flex: 1; }
.settings-run-row strong, .settings-run-row small { display: block; }
.settings-run-row small { color: var(--muted); margin-top: 4px; }
.settings-card .skill-uploader-form { margin: 0; border: 0; padding: 0; }
.settings-page .settings-status:not(:empty) { position: static; padding: 12px; margin: 14px 0 0; border-radius: 8px; background: var(--bg); }
.settings-page .settings-status.success { background: #dff6dd; color: #0e700e; }
.settings-page .settings-status.error { color: var(--red); }
@media (max-width: 1180px) { .settings-columns { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 960px) { .settings-columns { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .settings-field-row { grid-template-columns: 1fr; } .settings-page .settings-tabs { max-width: 100%; overflow-x: auto; } }
.settings-page .settings-tabs { width: max-content; background: var(--track, #f0f0f0); }
.settings-page [hidden] { display: none !important; }

/* S4–S5: personal center shares the settings cards and responsive columns. */
.personal-account-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.personal-account-row p { margin: 0; color: var(--ink); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.personal-account-row button { flex: 0 0 auto; }
.settings-card .personal-preview-note { margin: 12px 0 0; font-size: 11.67px; }
#settingsPanelPersonal .settings-facts dd { overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 600px) {
  .personal-account-row { align-items: flex-start; flex-wrap: wrap; }
}

/* A1–A3 local sign-in flow. */
/* The public home is isolated from workspace styles and shares the Hub session. */
.hub-home-frame { position: fixed; inset: 0; width: 100%; height: 100dvh; border: 0; background: #090b09; z-index: 100; }
.brand-block, .auth-brand-name { text-decoration: none; color: inherit; }
.brand-block:focus-visible, .auth-brand-name:focus-visible { outline: 2px solid var(--accent, #9483ff); outline-offset: 4px; }

.auth-shell { display: grid; grid-template-columns: 560fr 880fr; min-height: 100vh; background: #f7f7f5; color: #20201f; font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
.auth-shell[hidden], .app-shell[hidden], .auth-card[hidden] { display: none; }
.auth-brand { padding: 44px 56px 56px 64px; background: #332b6b; color: white; }
.auth-brand-name { display: flex; align-items: center; justify-content: flex-start; gap: 12px; height: 36px; }
.auth-brand-name > span { display: grid; place-items: center; width: 32px; height: 32px; background: #675bcb; border-radius: 8px; font-size: 12px; font-weight: 600; }
.auth-brand-name strong { width: 200px; font-size: 15px; }
.auth-brand-copy { margin-top: 128px; max-width: 430px; }
.auth-brand-copy > p { margin: 0 0 18px; color: #ede8ff; font-size: 12px; font-weight: 600; }
.auth-brand-copy h1 { margin: 0 0 20px; font-size: 42px; line-height: 1.2; letter-spacing: 0; font-weight: 700; }
.auth-brand-copy > div { color: #ede8ff; font-size: 17px; line-height: 1.2; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; min-width: 0; }
.auth-card { display: flex; flex-direction: column; width: 520px; max-width: 100%; margin: 0; padding: 42px 40px 36px; background: white; border-radius: 16px; }
.auth-card h2 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: 0; }
.auth-description { margin: 10px 0 0; color: #6e6e6b; font-size: 14px; line-height: 1.3; }
.auth-description strong { color: #20201f; font-weight: 500; }
.auth-preview { margin: 10px 0 0; color: #6e6e6b; font-size: 11px; line-height: 1.4; }
.auth-fields { display: flex; flex-direction: column; gap: 24px; margin-top: 28px; }
.auth-fields > label { display: flex; flex-direction: column; gap: 6px; color: #474743; font-size: 12px; line-height: 16px; font-weight: 600; }
.auth-fields input:not([type="checkbox"]), .auth-fields select { width: 100%; min-height: 32px; margin: 0; padding: 7px 10px; border: 1px solid #d4d4ce; border-radius: 8px; background: white; color: #20201f; font-size: 12px; line-height: 16px; font-weight: 600; box-shadow: none; }
.auth-fields select { appearance: none; background: white url("assets/figma-ui/login-chevron.svg") no-repeat right 10px center; background-size: 16px 16px; padding-right: 36px; }
.auth-fields input::placeholder { color: #6f6f6b; opacity: 1; }
.auth-password { display: flex; position: relative; }
.auth-password input { padding-right: 38px !important; }
.auth-password button { position: absolute; right: 1px; top: 1px; bottom: 1px; display: grid; place-items: center; width: 34px; padding: 0; border: 0; border-radius: 7px; background: white; }
.auth-options { display: flex; justify-content: space-between; align-items: center; min-height: 30px; gap: 12px; color: #6e6e6b; font-size: 13px; }
.auth-options label { display: flex; align-items: center; gap: 8px; }
.auth-options input { width: 13px; height: 13px; margin: 0; accent-color: #675bcb; }
.auth-options button { padding: 0; border: 0; color: #675bcb; background: none; font-size: 13px; font-weight: 600; }
.auth-card .auth-continue { width: 100%; min-height: 40px; padding: 8px 16px; color: white; background: #675bcb; border: 1px solid #675bcb; border-radius: 8px; font-size: 12px; font-weight: 600; }
.auth-card .auth-continue:hover { background: #574bb8; }
.auth-status { margin: 0; color: #a52b28; font-size: 12px; line-height: 1.4; }
.auth-status:not(:empty) { margin-top: 12px; }

.auth-success { gap: 32px; }
.auth-success-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #f0edff; color: #675bcb; font-size: 30px; font-weight: 700; }
.auth-shell :is(input, select, button):focus-visible { outline: 2px solid #675bcb; outline-offset: 3px; }
@media (max-width: 1000px) {
  .auth-brand { padding: 36px; }
  .auth-brand-copy h1 { font-size: 34px; }
  .auth-brand-name { justify-content: flex-start; }
  .auth-panel { padding: 28px; }
  .auth-card { padding: 32px 28px; }
}
@media (max-width: 700px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 24px; }
  .auth-brand-copy { margin-top: 28px; max-width: 460px; }
  .auth-brand-copy h1 { font-size: 28px; }
  .auth-brand-copy > div { font-size: 14px; }
  .auth-panel { padding: 24px 16px; }
  .auth-card { padding: 28px 24px; }
  .auth-card h2 { font-size: 26px; }
}

.hub-session { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
.hub-session > span { min-width: 0; overflow-wrap: anywhere; }

/* ColorBends stays below the workspace and never intercepts controls. */
body { isolation: isolate; }
.hub-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #eee8f7;
}
:root[data-theme="dark"] .hub-background { background: #100a23; }
.app-shell { background: transparent; }
.app-shell > .sidebar {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(24px);
}
.app-shell > .workspace {
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}
/* Authentication follows the Figma artwork independently of the workspace canvas. */
.auth-shell { background: #f7f7f5; }
.auth-brand { position: relative; isolation: isolate; overflow: hidden; background: #1a035a; }
.auth-brand-name, .auth-brand-copy { position: relative; z-index: 1; }
.auth-brand-art { position: absolute; z-index: 0; left: 0; top: 0; width: 563px; height: 900px; pointer-events: none; }
.auth-art-overlay { position: absolute; left: 0; top: 0; }
.auth-panel { position: relative; flex-direction: column; background: #f7f7f5; }
.auth-panel > .auth-preview { position: absolute; bottom: 10px; left: 16px; right: 16px; text-align: center; }
.auth-card { flex-shrink: 0; }
.auth-login .auth-fields { gap: 18px; }
.auth-login .auth-options { margin-top: 10px; }
.auth-privacy { margin: 22px 0 12px; color: #6e6e6b; font-size: 12px; line-height: 15px; }
.auth-privacy span { color: #675bcb; }
.auth-create .auth-privacy { margin-bottom: 8px; }
.auth-switch { margin: 20px 0 0; color: #6e6e6b; font-size: 13px; line-height: 16px; }
.auth-create .auth-switch { margin-top: 22px; }
.auth-switch button { margin-left: 8px; padding: 0; border: 0; background: none; color: #675bcb; font-size: inherit; font-weight: 600; }
.auth-card .auth-continue:disabled { opacity: .2; cursor: default; }
.auth-status:not(:empty) { margin-top: 18px; padding: 8px 16px 8px 46px; background: #fcebdc url("assets/figma-ui/auth-auth-alert.svg") no-repeat 16px center; border-radius: 10px; color: #8a3707; font-size: 13px; line-height: 20px; }
.auth-fields .auth-field-error { color: #903909; font-size: 12px; font-weight: 400; line-height: 15px; }
.auth-fields [aria-invalid="true"] { border-color: #903909; }
.auth-fields select { background-image: url("assets/figma-ui/auth-chevron.svg"); }
@media (max-width: 640px) {
  .auth-brand-art { transform: scale(.8); transform-origin: top left; }
  .auth-panel > .auth-preview { position: static; margin-top: 20px; }
}

/* Frosted module surfaces; the page background and shell keep their own styling. */
:is(.workspace, .tw-manage-people, .tw-roster-drawer) {
  --module-glass: rgba(255, 255, 255, 0.66);
  --module-glass-edge: rgba(255, 255, 255, 0.72);
  --module-glass-sheen: rgba(255, 255, 255, 0.18);
  --module-glass-shadow: 0 12px 36px rgba(42, 24, 84, 0.07);
}
:root[data-theme="dark"] :is(.workspace, .tw-manage-people, .tw-roster-drawer) {
  --module-glass: rgba(24, 26, 31, 0.76);
  --module-glass-edge: rgba(255, 255, 255, 0.12);
  --module-glass-sheen: rgba(255, 255, 255, 0.025);
  --module-glass-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
}
:root .workspace :is(.panel, .sharing-basic, .sharing-blocks, .sharing-block-library, .sharing-reader, .library-tabs, .faq-card, .library-3d-viewer-frame) {
  background: linear-gradient(135deg, var(--module-glass-sheen), transparent 65%), var(--module-glass);
  border: 1px solid var(--module-glass-edge);
  box-shadow: inset 0 1px 0 var(--module-glass-sheen), var(--module-glass-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(115%);
  backdrop-filter: blur(28px) saturate(115%);
}
/* Nested panels share the outer pane's blur instead of stacking more filters. */
:root .workspace .panel .panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .workspace :is(.panel, .sharing-basic, .sharing-blocks, .sharing-block-library, .sharing-reader, .library-tabs, .faq-card, .library-3d-viewer-frame) { background: var(--surface-strong); }
}

/* Keep Settings tracks and field labels on the current theme's surfaces. */
:root[data-theme="dark"] .settings-page {
  --track: var(--surface);
  --label-ink: var(--ink);
}

/* API connections follow the Settings reference, with live service states. */
#settingsPanelApi .settings-card { padding: 22px 24px 24px; }
#settingsPanelApi .connection-badge { min-height: 22px; padding: 0 8px; border: 0; border-radius: 3px; font-size: 11px; line-height: 14px; }
#settingsPanelApi .settings-form { max-width: none; }
#settingsPanelApi .settings-field-row label { display: flex; flex-direction: column; gap: 6px; color: var(--label-ink, #474743); font-weight: 600; }
#settingsPanelApi .settings-field-row input { height: 32px; font-weight: 600; border-color: var(--line-strong, #d4d4ce); }
#settingsPanelApi .settings-actions.connection-footer { justify-content: flex-end; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.connection-test-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 8px; background: var(--track, #f0f0f0); }
#settingsPanelApi .settings-status { position: static; min-height: 0; flex: 1; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; font-size: 12px; font-weight: 600; line-height: 16px; overflow-wrap: anywhere; }
.connection-check { display: none; flex: none; }
.connection-test-row:has(.success), .figma-account { background: #dff6dd; color: #0e700e; }
.connection-test-row:has(.success) .connection-check, .figma-test-result:has(.success) .connection-check { display: block; }
.connection-test-row:has(.success) .secondary-button { color: #0e700e; background: transparent; }
.connection-test-row .secondary-button { flex: none; padding-inline: 12px; }
#settingsPanelApi .settings-status.success { color: #0e700e; }
#settingsPanelApi .settings-status.error { color: var(--red); }
.figma-account { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 16px; }
#settingsPanelApi .figma-connection-footer { gap: 24px; margin: 0; padding-top: 16px; border: 0; }
.figma-test-result { display: flex; align-items: center; flex: 1 1 230px; gap: 10px; min-width: 0; }
#settingsPanelApi .figma-connection-footer button { flex: none; }
#settingsPanelApi .connection-fallback-note { display: flex; align-items: flex-start; gap: 10px; }
.connection-fallback-note img { flex: none; }
#settingsPanelApi .connection-fallback-note p { margin: 0; color: var(--ink); font-size: 13px; line-height: 20px; }
:root[data-theme="dark"] .connection-test-row:has(.success), :root[data-theme="dark"] .figma-account { background: #183b24; color: #9fe2ad; }
:root[data-theme="dark"] #settingsPanelApi .settings-status.success, :root[data-theme="dark"] .connection-test-row:has(.success) .secondary-button { color: #9fe2ad; }
@media (max-width: 600px) {
  .connection-test-row { flex-wrap: wrap; }
  .connection-test-row .settings-status { flex-basis: calc(100% - 26px); }
  .connection-test-row .secondary-button { margin-left: auto; }
  #settingsPanelApi .figma-connection-footer { gap: 10px; }
  .figma-test-result { flex-basis: 100%; }
}

/* AI Team chat shares the existing agent records and design tokens. */
.team-chat-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: max(683px, calc(100dvh - 190px)); max-height: 960px; overflow: hidden; border-radius: 16px; background: linear-gradient(135deg, var(--module-glass-sheen), transparent 65%), var(--module-glass); border: 1px solid var(--module-glass-edge); box-shadow: inset 0 1px 0 var(--module-glass-sheen), var(--module-glass-shadow); -webkit-backdrop-filter: blur(28px) saturate(115%); backdrop-filter: blur(28px) saturate(115%); }
.team-chat-sidebar { display: flex; flex-direction: column; min-height: 0; padding: 16px 0; border-right: 1px solid var(--line); }
.team-chat-sidebar h3 { margin: 0 18px 32px; font-size: 17px; }
#teamChatList { overflow-y: auto; min-height: 0; }
.team-chat-contact { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 18px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.team-chat-contact:hover { background: var(--track, #f0f0f0); }
.team-chat-contact.active { background: var(--line); }
.team-chat-contact > span:last-child { min-width: 0; }
.team-chat-contact strong, .team-chat-contact small, .team-chat-owner strong, .team-chat-owner small { display: block; }
.team-chat-contact strong, .team-chat-owner strong { font-size: 12px; line-height: 16px; font-weight: 600; }
.team-chat-contact small, .team-chat-owner small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 16px; }
.team-chat-contact small.working { color: #005ca3; }
.team-chat-contact small.needs-input { color: #a43e00; }
.team-chat-avatar { display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; width: 28px; height: 28px; overflow: hidden; border-radius: 8px; background: #28243b; }
.team-chat-avatar img { display: block; width: 24px; height: 24px; object-fit: contain; }
.team-chat-group-avatar { display: grid; flex: 0 0 28px; grid-template-columns: repeat(3, 1fr); gap: 1px; width: 28px; height: 28px; }
.team-chat-group-avatar .team-chat-avatar { width: 8px; height: 8px; border-radius: 2px; }
.team-chat-group-avatar .team-chat-avatar img { width: 8px; height: 8px; }
.team-chat-owner { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.team-chat-you { display: inline-grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--track, #f0f0f0); color: var(--ink); font-size: 12px; font-weight: 600; }
.team-chat-sidebar > p { margin: 8px 18px 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 20px; }
.team-chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.team-chat-header { display: flex; align-items: center; flex-shrink: 0; gap: 12px; min-height: 68px; padding: 14px 24px; }
.team-chat-header > .team-chat-avatar { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; }
.team-chat-header > .team-chat-avatar img { width: 30px; height: 30px; }
.team-chat-header > .team-chat-avatar img[src$="team.svg"] { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.team-chat-heading { flex: 1; min-width: 0; }
.team-chat-heading h3 { margin: 0; font-size: 17px; line-height: 22px; }
.team-chat-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-chat-shell .primary-button { min-height: 34px; padding: 8px 16px; border-color: #675bcb; background: #675bcb; color: #fff; font-size: 12px; white-space: nowrap; }
.team-chat-shell .secondary-button { min-height: 34px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--track, #f0f0f0); color: var(--ink); font-size: 12px; white-space: nowrap; }
.team-chat-body { display: flex; flex: 1; min-height: 0; background: transparent; }
.team-chat-history { flex: 1; min-width: 0; overflow-y: auto; padding: 24px; }
.team-chat-message { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.team-chat-message > .team-chat-avatar, .team-chat-message > .team-chat-you { width: 32px; height: 32px; flex-basis: 32px; }
.team-chat-message-content { max-width: min(568px, 85%); min-width: 0; }
.team-chat-message-meta { display: flex; gap: 10px; margin-bottom: 6px; color: var(--muted); font-size: 12px; line-height: 16px; }
.team-chat-message-meta strong { font-weight: 500; }
.team-chat-bubble { width: fit-content; max-width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; background: var(--surface-strong); overflow-wrap: anywhere; }
.team-chat-bubble p { margin: 0; color: inherit; font-size: 13px; line-height: 20px; white-space: pre-wrap; }
.team-chat-bubble a { display: block; margin-top: 8px; color: inherit; font-size: 12px; text-decoration: underline; }
.team-chat-message.outgoing { flex-direction: row-reverse; }
.outgoing .team-chat-message-meta { justify-content: flex-end; }
.outgoing .team-chat-bubble { margin-left: auto; background: #675bcb; color: #fff; }
.team-chat-empty { display: flex; height: 100%; min-height: 180px; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.team-chat-empty h3 { margin: 18px 0 8px; color: var(--ink); font-size: 17px; }
.team-chat-empty p { margin: 0; font-size: 13px; }
.team-chat-composer { position: relative; flex-shrink: 0; padding: 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 20%, transparent); }
:root .team-chat-composer textarea { display: block; width: 100%; min-height: 50px; max-height: 140px; resize: none; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; font: inherit; font-size: 13px; line-height: 20px; }
.team-chat-composer textarea:focus { outline: none; }
.team-chat-composer:focus-within { box-shadow: inset 0 0 0 2px #675bcb44; }
.team-chat-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.team-chat-actions > span { margin-left: auto; color: var(--muted); font-size: 12px; }
.team-chat-action { display: inline-flex; flex: 0 0 24px; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 4px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.team-chat-action img { display: block; width: 16px; height: 16px; }
.team-chat-action:hover { background: var(--track); }
.team-chat-action:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-theme="dark"] .team-chat-action img { filter: brightness(0) invert(.67); }
/* Override the global dark form field background without changing other inputs. */
:root[data-theme="dark"] .team-chat-composer textarea { background: transparent; border: 0; box-shadow: none; }
.team-chat-composer .agent-skill-picker { bottom: calc(100% + 6px); left: 18px; right: 18px; max-height: 300px; overflow-y: auto; }
.team-chat-composer .agent-selected-skill { margin-bottom: 12px; }
.team-chat-info { flex: 0 0 240px; overflow-y: auto; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-strong) 20%, transparent); }
.team-chat-info h4 { padding: 0 18px; }
.team-chat-info p { padding: 0 18px; color: var(--muted); font-size: 12px; line-height: 20px; }
.team-chat-search { display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--line); font-size: 12px; }
.team-chat-search input { flex: 1; min-width: 0; }
.team-chat-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.team-chat-attachments > span { margin-bottom: 10px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.team-chat-attachments button { margin-left: 8px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
:root[data-theme="dark"] .team-chat-contact small.working { color: #8dc9ff; }
:root[data-theme="dark"] .team-chat-contact small.needs-input { color: #ffbd87; }
@media (max-width: 1100px) {
  .team-chat-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .team-chat-header { padding: 14px 16px; gap: 8px; }
  .team-chat-info { flex-basis: 190px; }
}
@media (max-width: 760px) {
  .team-chat-shell { grid-template-columns: 74px minmax(0, 1fr); height: calc(100dvh - 170px); min-height: 550px; border-radius: 12px; }
  .team-chat-sidebar h3 { margin: 0 8px 18px; font-size: 13px; text-align: center; }
  .team-chat-contact { justify-content: center; padding: 8px; }
  .team-chat-sidebar .team-chat-contact > span:last-child, .team-chat-sidebar > p, .team-chat-owner { display: none; }
  .team-chat-header { flex-wrap: wrap; padding: 12px; }
  .team-chat-heading { min-width: 90px; }
  .team-chat-header .primary-button { margin-left: auto; }
  .team-chat-history { padding: 16px 12px; }
  .team-chat-composer { padding: 12px; }
  .team-chat-actions { gap: 10px; }
  .team-chat-actions > span { visibility: hidden; font-size: 0; }
  .team-chat-info { flex-basis: 160px; }
  .team-chat-info .team-chat-contact { justify-content: flex-start; }
}
.team-chat-shell [hidden] { display: none !important; }
#teamChatSearchToggle img { display: block; width: 18px; height: 18px; }
:root[data-theme="dark"] #teamChatSearchToggle img { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .team-chat-shell .secondary-button,
:root[data-theme="dark"] .team-chat-you,
:root[data-theme="dark"] .team-chat-contact:hover { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .team-chat-shell .primary-button { background: #675bcb; border-color: #675bcb; color: #fff; }

/* S4 / S5 management pages reuse the settings surfaces and theme tokens. */
.management-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.management-heading h4 { margin: 0; }
.management-add { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--blue); font-size: 12px; cursor: pointer; }
.management-add img { width: 20px; height: 20px; }
.management-table-scroll { overflow-x: auto; }
.management-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.management-table th { color: var(--muted); font-size: 11.67px; font-weight: 400; padding: 12px 0; }
.management-table td { border-top: 1px solid var(--line); padding: 11px 8px 11px 0; }
.management-table td:first-child { padding-left: 20px; }
.management-table strong, .management-table small { display: block; }
.management-table small { color: var(--muted); font-size: 11.67px; margin-top: 3px; }
.management-table td:last-child { width: 32px; }
.management-delete { display: grid; place-items: center; width: 32px; height: 32px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.management-delete:hover { background: var(--track); }
.management-delete img { width: 18px; height: 18px; }
.management-role { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 3px; background: var(--track); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
select.management-role { width: auto; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); cursor: pointer; }
.management-role.manager { color: var(--blue); background: var(--blue-soft, #eeecfb); }
.management-requests { display: flex; flex-direction: column; gap: 8px; }
.management-request { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
.management-kind { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--step-failed-bg, #fcebdc); }
.management-kind img { width: 18px; height: 18px; }
.management-request-body { flex: 1; min-width: 0; }
.management-request-body strong { font-size: 14px; }
.management-request-body p { margin: 3px 0 0; }
.management-request-body dl { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin: 12px 0 0; font-size: 11.67px; }
.management-request-body dt { color: var(--muted); }
.management-request-body dd { margin: 0; overflow-wrap: anywhere; }
.management-request-actions { display: flex; gap: 10px; align-self: center; }
#teamManagerForm { padding: 14px 0 20px; }
#adminOperations .settings-facts > div { font-size: 12px; }
:root[data-theme="dark"] .management-delete img { filter: brightness(2); }
@media (max-width: 700px) { .management-request { flex-wrap: wrap; } .management-request-actions { margin-left: 44px; } .management-table { min-width: 500px; } .management-heading { flex-wrap: wrap; } }

.management-request-body > small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.67px; }
.management-review-facts { margin: 12px 0 0; font-size: 12px; }
.management-review-facts > div { display: flex; gap: 8px; margin-top: 8px; }
.management-review-facts dt { flex: 0 0 72px; color: var(--muted); }
.management-review-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.settings-page { min-width: 0; width: 100%; max-width: 100%; }
.settings-page .settings-tab-panel { min-width: 0; width: 100%; }
.settings-page .management-review-facts { display: block; width: 100%; }
.settings-page .management-review-facts > div { display: flex; width: 100%; }
.settings-page .management-review-facts dd { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .settings-page .settings-tabs { width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: auto; }
  .settings-page .management-request-body { flex-basis: calc(100% - 44px); }
}
.management-table-scroll { position: relative; min-width: 0; max-width: 100%; }

/* AMP reference article: editorial layout from Figma 754:9880. */
:root .app-shell > .workspace:has([data-page-view="wonder-moment"]:not([hidden])) { padding: 36px; background: var(--surface-strong); }
.amp-guide {
  --amp-window: #000000;
  --amp-window-text: #ffffff;
  --amp-hotlight: #7775ff;
  --amp-gray-text: #a9a9a9;
  --amp-highlight: #cfa4ff;
  --amp-highlight-text: #2b2b2b;
  --amp-button: #000000;
  --amp-button-text: #fff200;
  min-width: 0;
  color: var(--ink);
}
.amp-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; line-height: 18px; }
.amp-breadcrumb button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.amp-breadcrumb button:hover { color: var(--blue); text-decoration: underline; }
.amp-guide-body { display: grid; gap: 36px; font-size: 16px; line-height: 1.55; }
.amp-guide-intro { margin: 0; color: var(--muted); }
.amp-guide-toc { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.amp-guide-toc button, .amp-guide-source button { min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
.amp-guide-toc button:hover, .amp-guide-source button:hover { border-color: var(--blue); background: var(--blue-soft); }
.amp-guide :is(button, a, input, [tabindex="0"]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.amp-chapter { display: grid; gap: 24px; min-width: 0; scroll-margin-top: 24px; color: var(--muted); }
.amp-chapter h2 { margin: 0; color: var(--ink); font-size: 28px; font-weight: 600; line-height: 1.55; letter-spacing: -.3px; }
.amp-chapter h3 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.45; }
.amp-chapter p, .amp-chapter figure { margin: 0; }
.amp-chapter ul { display: grid; gap: 12px; margin: 0; padding-left: 24px; }
.amp-callout { padding: 20px 24px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; background: var(--blue-soft); color: var(--ink); }
.amp-callout > strong { display: block; margin-bottom: 8px; }
.amp-principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.amp-principles > div { display: grid; align-content: start; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
.amp-principles h3 { font-size: 18px; }
.amp-token-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.amp-token-card { display: flex; align-items: flex-start; gap: 16px; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
.amp-token-card > div { display: grid; gap: 6px; min-width: 0; }
.amp-token-card h3 { font-size: 18px; }
.amp-token-card p { font-size: 14px; }
.amp-token-card code { color: var(--ink); font-size: 12px; }
.amp-swatch { display: block; flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 10px; }
.amp-color-window { background: var(--amp-window); }
.amp-color-window-text { background: var(--amp-window-text); }
.amp-color-hotlight { background: var(--amp-hotlight); }
.amp-color-gray-text { background: var(--amp-gray-text); }
.amp-color-highlight { background: var(--amp-highlight); }
.amp-color-highlight-text { background: var(--amp-highlight-text); }
.amp-color-button { background: var(--amp-button); }
.amp-color-button-text { background: var(--amp-button-text); }
.amp-pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.amp-pairs figure { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.amp-pair { display: grid; place-items: center; min-height: 90px; padding: 16px; font-size: 15px; font-weight: 600; }
.amp-pair-window { background: var(--amp-window); color: var(--amp-window-text); }
.amp-pair-highlight { background: var(--amp-highlight); color: var(--amp-highlight-text); }
.amp-pair-button { background: var(--amp-button); color: var(--amp-button-text); }
.amp-pairs figcaption { padding: 12px; font-size: 12px; }
.amp-note { font-size: 13px; }
.amp-table-scroll { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.amp-table-scroll table { width: 100%; min-width: 640px; border-collapse: collapse; color: var(--ink); font-size: 14px; line-height: 1.55; }
.amp-table-scroll caption { padding: 16px; text-align: left; font-weight: 600; font-size: 16px; }
.amp-table-scroll th, .amp-table-scroll td { padding: 12px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.amp-table-scroll thead { background: var(--bg); }
.amp-table-scroll tbody th { font-weight: 500; }
.amp-process { padding: 20px 24px; border-radius: 10px; background: var(--blue-soft); color: var(--ink); text-align: center; }
.amp-process > div { line-height: 2; }
.amp-process span { padding-inline: 6px; color: var(--blue); }
.amp-process figcaption { margin-top: 8px; font-size: 12px; }
.amp-state-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.amp-state-grid figure { display: grid; align-content: start; gap: 16px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
.amp-state-grid figcaption { color: var(--ink); font-size: 16px; font-weight: 600; }
.amp-state-grid p { font-size: 13px; }
.amp-state-preview { padding: 6px; }
.amp-state-sample { display: grid; place-items: center; min-height: 46px; padding: 8px; border: 2px solid var(--amp-button-text); border-radius: 6px; background: var(--amp-button); color: var(--amp-button-text); font-size: 14px; font-weight: 600; }
.amp-state-hover { border-color: var(--amp-highlight); }
.amp-state-pressed, .amp-state-selected { border-color: var(--amp-highlight); background: var(--amp-highlight); color: var(--amp-highlight-text); }
.amp-state-pressed { transform: translateY(2px); }
.amp-state-focus { outline: 2px solid var(--amp-highlight); outline-offset: 2px; }
.amp-state-disabled { border-color: var(--amp-gray-text); color: var(--amp-gray-text); }
.amp-checklist { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.amp-checklist legend { margin-bottom: 16px; color: var(--ink); font-size: 20px; font-weight: 600; }
.amp-checklist label { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 14px; line-height: 1.55; cursor: pointer; }
.amp-checklist input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.amp-night-sky { padding: 24px; border: 1px solid var(--amp-window-text); border-radius: 12px; background: var(--amp-window); color: var(--amp-window-text); }
.amp-night-sky figcaption { display: grid; gap: 6px; margin-bottom: 24px; }
.amp-night-sky figcaption > span { font-size: 13px; }
.amp-night-sky > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.amp-night-sky > div > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.amp-night-sky .amp-swatch { flex-basis: 36px; width: 36px; height: 36px; border-color: var(--amp-window-text); border-radius: 50%; }
.amp-night-sky strong, .amp-night-sky code { display: block; }
.amp-night-sky > div strong { font-size: 13px; }
.amp-night-sky code { margin-top: 4px; font-size: 11px; }
.amp-guide-source { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.amp-guide-source a { color: var(--blue); text-decoration: underline; }
@media (max-width: 1100px) {
  .amp-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amp-night-sky > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amp-token-card { padding: 18px; gap: 12px; }
}
@media (max-width: 760px) {
  :root .app-shell > .workspace:has([data-page-view="wonder-moment"]:not([hidden])) { padding: 24px 16px; }
  .amp-chapter h2 { font-size: 24px; }
  .amp-token-grid, .amp-principles, .amp-pairs, .amp-state-grid { grid-template-columns: 1fr; }
  .amp-night-sky { padding: 20px 16px; }
  .amp-night-sky > div { gap: 20px 12px; }
  .amp-night-sky > div > div { gap: 8px; }
  .amp-night-sky .amp-swatch { flex-basis: 28px; width: 28px; height: 28px; }
}


/* Icon documentation shares the Library article layout and source artwork. */
.icon-guide-figure { min-width: 0; }
.icon-guide-image-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.icon-guide-image-scroll a { display: block; min-width: 900px; }
.icon-guide-image-scroll img { display: block; width: 100%; height: auto; }
.icon-guide-figure figcaption { margin-top: 12px; font-size: 13px; }
.icon-guide-filenames { display: grid; gap: 12px; min-width: 0; margin: 0; }
.icon-guide-filenames > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.icon-guide-filenames dt { color: var(--ink); font-size: 14px; font-weight: 600; }
.icon-guide-filenames dd { min-width: 0; margin: 0; }
.icon-guide-filenames code, .icon-guide-code code { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.icon-guide-code { display: grid; gap: 12px; min-width: 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: 10px; }
.icon-guide-code p { font-size: 13px; }
.icon-guide .amp-callout ol { display: grid; gap: 12px; margin: 0; padding-left: 24px; }
@media (max-width: 600px) {
  .icon-guide-filenames > div { grid-template-columns: 1fr; }
}

/* Wonder moment: two image columns with the source posters kept intact. */
.wonder-masonry { columns: 3; column-gap: 24px; }
.wonder-card { display: inline-block; width: 100%; margin: 0 0 28px; break-inside: avoid; vertical-align: top; }
.wonder-image-link { display: block; overflow: hidden; border-radius: 12px; background: var(--surface-strong); }
.wonder-image-link img { display: block; width: 100%; height: auto; }
.wonder-image-link:hover { outline: 2px solid var(--blue); outline-offset: 3px; }
.wonder-image-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.wonder-card h4 { margin: 12px 0 4px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 22px; letter-spacing: -.2px; overflow-wrap: anywhere; }
.wonder-author { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.wonder-author-mark { display: inline-grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--blue-soft); color: var(--ink); font-size: 11px; font-weight: 600; }
.wonder-author time { margin-left: 6px; color: var(--muted); font-size: 12px; }
.wonder-text-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.wonder-text-card h4 { margin-top: 0; }
.wonder-text-card p { margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
@media (min-width: 761px) and (max-width: 1100px) { .wonder-masonry { columns: 2; } }
@media (max-width: 760px) {
  .wonder-masonry { columns: 1; }
}

.wonder-detail-page.active { display: block; min-width: 0; }
.wonder-detail-heading { margin: 28px 0 24px; }
.wonder-detail-heading h1 { margin: 0 0 8px; color: var(--ink); font-size: 30px; font-weight: 700; line-height: 36px; letter-spacing: -.6px; }
.wonder-detail-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.library-experience-card[data-go-page] { background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.library-experience-card[data-go-page]:hover { border-color: var(--blue); background: var(--blue-soft); }
.library-experience-card[data-go-page]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 760px) { .wonder-detail-heading h1 { font-size: 26px; } }


/* Native modal keeps the background inert and restores the opener's focus. */
body.wonder-preview-open { overflow: hidden; }
.wonder-preview { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; border-radius: 0; background: transparent; color: #f2f2f2; box-sizing: border-box; }
.wonder-preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 20px; }
.wonder-preview::backdrop { background: rgba(0, 0, 0, .76); }
.wonder-preview-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; border-radius: 12px; background: rgba(20, 20, 24, .8); }
.wonder-preview-meta { flex: 1 1 240px; min-width: 0; }
.wonder-preview-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.wonder-preview-meta h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 22px; letter-spacing: -.2px; overflow-wrap: anywhere; }
.wonder-preview-meta p { margin: 4px 0 0; color: #ddd; font-size: 13px; line-height: 18px; }
.wonder-preview-toolbar a, .wonder-preview-toolbar button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 12px; border: 1px solid #777; border-radius: 8px; background: #252525; color: #f2f2f2; font: inherit; font-size: 12px; line-height: 20px; text-decoration: none; cursor: pointer; }
.wonder-preview-toolbar a:hover, .wonder-preview-toolbar button:hover { background: #3b3b3b; }
.wonder-preview :is(a, button):focus-visible { outline: 2px solid #b2a9ff; outline-offset: 3px; }
.wonder-preview-stage { position: relative; min-width: 0; min-height: 0; }
.wonder-preview-stage img { position: absolute; top: 50%; left: 50%; display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; transform: translate(-50%, -50%); object-fit: contain; box-shadow: 0 12px 48px #0006; }
@media (max-width: 760px) { .wonder-preview { padding: 12px; } .wonder-preview[open] { gap: 12px; } }

/* Skill upload dialog · Figma 699:9310. */
:root .modal.skill-modal {
  --skill-track: #f0f0f0;
  --skill-drop: #faf9f6;
  --skill-notice: #fcebdc;
  --skill-notice-ink: #8a3707;
  --dialog-primary: var(--blue);
  --dialog-primary-text: #fff;
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border-color: var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(27, 26, 24, .2);
}
:root[data-theme="dark"] .modal.skill-modal { --skill-track: #151515; --skill-drop: #252525; --skill-notice: #3d281b; --skill-notice-ink: #ffc599; --dialog-primary: var(--blue); --dialog-primary-text: #111; }
.skill-modal .modal-heading { margin-bottom: 16px; min-height: 32px; }
.skill-modal .modal-heading h3 { font-weight: 700; letter-spacing: -.14px; }
:root .modal.skill-modal .modal-heading .close-button { flex-basis: 32px; width: 32px; height: 32px; border-radius: 8px; }
.skill-modal .skill-form { display: grid; gap: 16px; }
.skill-modal legend, .skill-modal label > span, .skill-upload-label { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 16px; }
.skill-modal .skill-source-tabs { display: flex; width: 100%; flex-wrap: nowrap; gap: 2px; padding: 3px; background: var(--skill-track); border-color: var(--line); border-radius: 8px; }
.skill-modal .skill-source-tabs .segment { flex: 1; min-width: 0; min-height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600; }
.skill-modal .skill-source-tabs .segment.active { border-radius: 4px; background: var(--dialog-surface); color: var(--blue-ink, #332c73); }
:root[data-theme="dark"] .skill-modal .skill-source-tabs .segment.active { color: var(--ink); }
.skill-upload-notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--skill-notice); color: var(--skill-notice-ink); }
.skill-upload-notice[hidden] { display: none; }
.skill-upload-notice > img { flex: none; margin-top: 1px; }
.skill-upload-notice p { margin: 0; font-size: 13px; line-height: 20px; }
.skill-upload-notice p + p { margin-top: 4px; font-size: 12px; line-height: 18.6px; }
.skill-upload-notice strong { font-weight: 500; }
:root[data-theme="dark"] .skill-upload-notice > img { filter: brightness(0) saturate(100%) invert(83%) sepia(30%) saturate(700%); }
.skill-modal .skill-source-fields { gap: 6px; }
.skill-modal .skill-dropzone { position: relative; display: flex; align-items: center; gap: 12px; padding: 20px 16px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--skill-drop); cursor: pointer; }
.skill-upload-icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #ede8ff; }
.skill-dropzone-copy { flex: 1; min-width: 0; }
.skill-dropzone-copy strong, .skill-dropzone-copy small { display: block; }
.skill-dropzone-copy strong { font-size: 12px; line-height: 16px; font-weight: 600; }
.skill-dropzone-copy small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; }
.skill-modal .skill-choose-file { flex: none; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--dialog-surface); color: var(--ink); font-size: 12px; line-height: 16px; white-space: nowrap; }
.skill-dropzone #skillFile { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.skill-dropzone:hover, .skill-dropzone.drag-over { border-color: var(--blue); background: var(--blue-soft); }
.skill-dropzone:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.skill-installed-options { margin-top: 4px; color: var(--muted); font-size: 11px; }
.skill-installed-options summary { cursor: pointer; }
.skill-installed-options label { margin-top: 10px; }
.skill-installed-options small { display: block; margin-top: 8px; line-height: 1.55; }
.skill-modal :is(input[type="text"], input[type="url"], textarea, select) { min-height: 32px; padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 16px; background-color: var(--dialog-surface); }
.skill-modal #skillDesc { height: 32px; }
.skill-agent-choices { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.skill-agent-choices .agent-list-avatar { width: 48px; height: 48px; padding: 1px; opacity: .3; }
.skill-agent-choices .agent-list-avatar img { width: 46px; height: 46px; }
:root .modal.skill-modal .skill-form-actions { gap: 10px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
:root .modal.skill-modal .skill-form-actions button, :root .modal.skill-modal #readGitHubSkill { min-height: 34px; padding: 8px 16px; font-size: 12px; font-weight: 600; line-height: 16px; }
:root .modal.skill-modal #cancelSkillEdit { border-color: var(--line-strong); background: var(--dialog-surface); color: var(--ink); }
@media (max-width: 600px) {
  :root .modal.skill-modal { padding: 20px 16px; }
  .skill-modal .skill-source-tabs .segment { padding-inline: 5px; font-size: 11px; }
  .skill-modal .skill-dropzone { flex-wrap: wrap; }
  .skill-dropzone-copy { flex-basis: calc(100% - 48px); }
  .skill-modal .skill-choose-file { margin-left: 48px; }
  .skill-agent-choices { justify-content: flex-start; }
}

:root .modal.skill-modal .skill-form-actions > button { flex: 0 0 auto; }
.skill-modal #closeSkillEditor img { width: 18px; height: 18px; }
:root[data-theme="dark"] .skill-modal .form-status.success { color: var(--green); }
/* Production save state stays visible when a network failure needs recovery. */
.workspace-data-menu { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.workspace-data-menu summary { padding: 6px 0; cursor: pointer; }
.workspace-data-menu summary span { margin-left: 6px; color: var(--danger, var(--ink)); font-weight: 600; }
.workspace-data-panel { display: grid; gap: 6px; margin-top: 6px; }
.workspace-data-panel p { margin: 6px 0 0; }
.workspace-data-panel button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-strong); color: var(--ink); text-align: left; cursor: pointer; }
.workspace-data-menu [hidden] { display: none; }

/* Keep single-select arrows aligned independently of native browser chrome. */
:root select:not([multiple]):not([size]) {
  appearance: none;
  padding-right: 36px;
  background-image: url("assets/figma-ui/skills-select-chevron.svg");
  background-position: right 10px center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}

@media (forced-colors: active) {
  :root select:not([multiple]):not([size]) {
    appearance: auto;
    background-image: none;
  }
}

/* Credential controls share the existing settings layout and remain role-gated. */
#azureCredentials { min-width: 0; margin: 0; padding: 0 0 20px; border: 0; display: grid; gap: 16px; }
#azureCredentials legend { margin-bottom: 16px; font-weight: 600; }
#azureCredentials p { margin: 0; color: var(--muted); font-size: 12px; }
#azureCredentials label { display: flex; flex-direction: column; gap: 6px; }

/* Personal center: approved membership, join form, and pending approval. */
#settingsPanelPersonal .settings-card { padding: 22px 24px 24px; }
#settingsPanelPersonal .settings-card h4 { font-weight: 600; }
#settingsPanelPersonal .settings-facts > div { padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
#settingsPanelPersonal .settings-facts dt { font-size: 14px; line-height: 20.3px; }
#settingsPanelPersonal .settings-facts dd { font-size: 13px; line-height: 18px; }
#settingsPanelPersonal .personal-role-row { padding: 16px 0; }
.personal-role { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 3px; background: var(--track, #f0f0f0); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 14px; }
.settings-card #personalTeamPending { margin: 0; font-size: 14px; line-height: normal; }
#personalTeamPending strong { color: var(--ink); font-weight: 500; }
#personalJoinForm label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; line-height: 16px; }
#personalTeamSelect { width: 100%; min-height: 32px; padding: 7px 34px 7px 10px; border: 1px solid var(--field-line, #d4d4ce); border-radius: 8px; background: var(--field, white) url("assets/figma-ui/personal-chevron.svg") no-repeat right 10px center; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 16px; appearance: none; }
#personalJoinForm .primary-button { width: 100%; height: 40px; margin-top: 24px; }
#personalTeamTitle:focus { outline: none; }

@media (forced-colors: active) { #personalTeamSelect { appearance: auto; background-image: none; } }

/* Figma W10 task menu and task dialogs. */
.task-more-trigger { anchor-name: --task-actions; display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.task-more-trigger img { width: 18px; height: 18px; }
.task-more-trigger:hover { background: var(--blue-soft); }
.task-more-menu { position: fixed; position-anchor: --task-actions; inset: auto; top: anchor(bottom); right: anchor(right); margin: 4px 0 0; width: 240px; max-width: calc(100vw - 24px); height: max-content; min-height: 0; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 6px; border: 1px solid #dcdcd6; border-radius: 12px; background: rgba(255,255,255,.98); color: #20201f; box-shadow: 0 20px 55px #1f1e1c33; }
.task-more-menu:popover-open { display: flex; flex-direction: column; gap: 8px; }
.task-more-menu button { display: flex; align-items: center; flex: none; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; text-align: left; background: transparent; color: inherit; }
.task-more-menu button:hover, .task-more-menu button:focus-visible { background: var(--track); }
.task-more-menu button:disabled { opacity: .45; cursor: default; }
.task-more-menu img, .task-locked-brief img, .task-artifact-note img { width: 16px; height: 16px; flex: none; }
.task-more-menu button span { display: grid; gap: 1px; }
.task-more-menu strong { font: 600 12px/16px Inter, sans-serif; }
.task-more-menu small { margin: 0; color: var(--muted); font: 400 11.67px/14px Inter, sans-serif; }
.task-more-menu hr { width: 100%; height: 1px; margin: 0; border: 0; background: var(--line); }
.task-more-menu [data-delete-command] { color: #b44848; }
:root .task-action-dialog.modal { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-strong); color: var(--ink); box-shadow: 0 24px 80px #1b1a1833; overflow-y: auto; }
.task-action-dialog form { display: flex; flex-direction: column; gap: 16px; }
.task-action-dialog header { display: flex; align-items: flex-start; gap: 12px; }
.task-action-dialog h3 { flex: 1; margin: 0; font-size: 16px; line-height: 22px; }
.task-action-dialog p { margin: 0; font-size: 14px; line-height: 20.3px; }
.task-dialog-close { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; }
.task-dialog-close img { width: 18px; height: 18px; }
.task-dialog-state { display: flex; align-items: center; gap: 8px; font-size: 11.67px; color: var(--muted); }
.task-dialog-field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
.task-dialog-field input { width: 100%; min-height: 32px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font: 600 12px/16px Inter, sans-serif; }
.task-priority { padding: 0; margin: 0; border: 0; }
.task-priority legend { margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.task-priority > div { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--track); }
.task-priority label { position: relative; }
.task-priority input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.task-priority span { display: block; padding: 9px 12px; border-radius: 4px; color: var(--muted); font: 600 12px/16px Inter, sans-serif; }
.task-priority input:checked + span { background: var(--surface-strong); color: var(--blue); box-shadow: 0 1px 3px #1f1f1d1a; }
.task-priority input:focus-visible + span { outline: 2px solid var(--blue); }
.task-locked-brief { display: grid; justify-items: start; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.task-locked-brief strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.task-locked-brief p { font-size: 11.67px; line-height: 14px; }
.task-locked-brief small { color: var(--muted); font-size: 12px; line-height: 18.6px; }
.task-action-dialog footer { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.task-delete-confirm { min-height: 34px; padding: 8px 16px; border: 0; border-radius: 8px; background: #b4484814; color: #b44848; font: 600 12px/16px Inter, sans-serif; }
.task-artifact-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.task-action-dialog .task-artifact-note, .task-delete-artifacts { font-size: 13px; line-height: 20px; }
.task-delete-artifacts { display: flex; align-items: center; gap: 10px; }
.task-delete-artifacts input { width: 16px; height: 16px; }
.deleted-task-source { color: var(--muted); }
:root[data-theme="dark"] .task-more-menu { background: var(--surface-strong); border-color: var(--line); color: var(--ink); }
:root[data-theme="dark"] :is(.task-more-trigger img, .task-more-menu button:not([data-delete-command]) img, .task-dialog-close img, .task-locked-brief img, .task-artifact-note img) { filter: brightness(0) invert(.8); }

.modal.task-action-dialog :is(.primary-button, .secondary-button) { min-height: 34px; height: 34px; padding: 8px 16px; font: 600 12px/16px Inter, sans-serif; }

.task-action-dialog .task-delete-artifacts { display: flex; margin: 0; font-weight: 400; }

/* W16 task drafts reuses the workspace table and filters. */
.task-drafts-panel { padding: 22px 24px 24px; }
.task-draft-controls { grid-template-columns: minmax(200px, 320px) 170px 170px; }
.task-drafts-table { min-width: 920px; }
.task-draft-issue { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 12px; }
.task-draft-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.task-draft-actions .secondary-button { white-space: nowrap; min-height: 34px; padding: 0 12px; font-size: 12px; }
.task-draft-actions .icon-button { flex: 0 0 32px; width: 32px; height: 32px; }
.task-draft-actions .icon-button img { width: 18px; height: 18px; }
@media (max-width: 760px) { .task-draft-controls { grid-template-columns: 1fr; } .task-drafts-panel { padding: 18px; } }

/* Workflow detail overview and task history. */
.workflow-overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  align-items: start;
  gap: 24px;
}
.workflow-overview-main { display: grid; gap: 24px; min-width: 0; }
.workflow-overview-main h4, .workflow-overview-settings h4, .workflow-history h4 { margin: 0 0 14px; font-size: 17px; }
.workflow-overview-settings { display: grid; gap: 12px; }
.workflow-overview-settings h4 { margin-bottom: 0; }
.workflow-overview-settings p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.workflow-overview-settings dl + p { margin-top: 32px; }
.workflow-overview-settings [role="status"]:empty { display: none; }
.workflow-overview-main .workflow-stage-cards { display: flex; gap: 28px; overflow-x: auto; padding-bottom: 3px; }
.workflow-overview-main .workflow-stage-cards .workflow-detail-stage { flex: 0 0 196px; position: relative; min-height: 132px; background: var(--bg); }
.workflow-overview-main .workflow-stage-cards .workflow-detail-stage + .workflow-detail-stage::before {
  content: "›";
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.workflow-stage-cards .workflow-detail-stage > span small { color: var(--blue); }
.workflow-history { margin-top: 24px; }
.workflow-history .agent-detail-section-head { flex-wrap: wrap; margin-bottom: 10px; }
.workflow-history .agent-detail-section-head h4 { margin: 0; }
.workflow-history-filters button { min-height: 32px; }
.workflow-history-scroll { overflow-x: auto; }
.workflow-history table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; font-size: 12px; }
.workflow-history :is(th, td) { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.workflow-history :is(th, td):first-child { width: 29%; padding-left: 0; }
.workflow-history thead th, .workflow-history td { color: var(--muted); font-weight: 400; }
.workflow-history .task-row-button { font-weight: 600; overflow-wrap: anywhere; }
.workflow-history .task-progress { justify-content: flex-start; min-width: 90px; }
.workflow-history .task-progress progress { flex: 1; min-width: 54px; }
.workflow-history .task-current { min-width: 108px; }
.workflow-history td a { color: var(--blue); }
.workflow-history-more { display: block; margin: 10px auto 0; background: transparent; }
:root[data-theme="dark"] .workflow-history td:last-child img { filter: brightness(0) invert(.7); }
@media (max-width: 980px) {
  .workflow-overview-columns { grid-template-columns: minmax(0, 1fr); }
}

/* String assistant · F9–F12 */
.sa-page { gap: 24px; }
.sa-page > h3 { margin: -18px 0 12px; letter-spacing: -.6px; }
.sa-page .panel { border: 0; border-radius: 14px; background: var(--surface-strong); box-shadow: 0 14px 36px rgba(30,30,28,.06); }
.sa-page .sa-columns .panel { padding: 24px; }
.sa-page .workflow-detail-hero { min-height: 96px; }
.sa-author { display: grid; gap: 6px; text-align: right; border-left: 1px solid var(--line); padding-left: 24px; font-size: 12px; }
.sa-author small { color: var(--muted); }
.sa-functions { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--control-track); margin-bottom: 14px; }
.sa-functions button { flex: 1; min-height: 34px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 6px 8px; }
.sa-functions button[aria-pressed="true"] { background: var(--surface-strong); color: var(--control-selected-ink); box-shadow: 0 1px 3px #1f1f1d1a; }
.sa-functions small { color: var(--muted); margin-left: 6px; font-size: 11px; }
.sa-details { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; font-size: 13px; }
.sa-details dt, .sa-details dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.sa-details dt { color: var(--muted); }
.sa-details dd { display: flex; justify-content: flex-end; align-items: center; gap: 8px; text-align: right; font-weight: 600; }
.sa-details .agent-list-avatar { width: 24px; height: 24px; }
.sa-columns { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
.sa-page .string-assistant-form { display: flex; flex-direction: column; gap: 14px; padding: 0; border: 0; background: transparent; }
.sa-page .string-assistant-form > .sa-functions { width: 100%; margin: -4px 0 0; }
.sa-page .string-assistant-form label { display: flex; flex-direction: column; gap: 8px; width: 100%; font-size: 12px; font-weight: 500; }
.sa-page .string-assistant-form input, .sa-page .string-assistant-form select { min-height: 42px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--ink); font-size: 12px; }
.sa-page .string-assistant-operation { display: flex; flex-direction: column; gap: 14px; border: 0; margin: 0; padding: 0; min-width: 0; }
.sa-page .string-assistant-operation > legend { display: none; }
.sa-page [hidden] { display: none !important; }
.sa-page .string-assistant-operation input[type="file"] { height: auto; padding: 8px; }
.sa-export-range { display: grid; gap: 6px; padding: 0; margin: 0; border: 0; }
.sa-export-range legend { font-size: 12px; margin-bottom: 8px; }
.sa-page .sa-export-range label { flex-direction: row; align-items: center; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 42px; }
.sa-page .sa-export-range label:has(:checked) { color: var(--blue); background: #f3f1ff; border-color: var(--blue); }
.sa-page .sa-export-range input { width: 12px; min-height: 12px; margin: 0; accent-color: var(--blue); }
.sa-page .string-assistant-form .form-status:empty, .sa-page [data-string-assistant-preview]:empty { display: none; }
.sa-page .string-assistant-operation > button { align-self: start; }
.sa-editor-stages { display: grid; gap: 8px; padding-top: 8px; }
.sa-editor-stages button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--bg); text-align: left; cursor: pointer; }
.sa-editor-stages button[aria-pressed="true"] { border-color: #c9c3ee; background: #eeecfb; }
.sa-stage-number { display: grid; place-items: center; flex: 0 0 24px; height: 24px; background: var(--surface-strong); border-radius: 50%; font-size: 12px; }
.sa-editor-stages [aria-pressed="true"] .sa-stage-number { color: white; background: var(--blue); }
.sa-editor-stages button > span:nth-child(2) { flex: 1; display: grid; gap: 3px; }
.sa-editor-stages strong { font-size: 13px; }
.sa-editor-stages small { color: var(--muted); font-size: 11.67px; }
.sa-stage-agent { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sa-stage-agent .agent-list-avatar { width: 24px; height: 24px; }
.sa-instructions { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; line-height: 1.45; }
.sa-instructions small { color: var(--muted); }
.sa-instructions p { margin: 6px 0 0; }
@media (max-width: 1100px) { .sa-columns { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); } .sa-stage-agent { max-width: 100px; } .sa-functions small { display: none; } }
@media (max-width: 760px) { .sa-columns { grid-template-columns: minmax(0, 1fr); } .workflow-detail-hero { flex-wrap: wrap; } .sa-author { flex-basis: 100%; border: 0; padding: 0; text-align: left; } .sa-stage-agent { display: none; } }

:root:not([data-theme="dark"]) .workspace:has(.sa-page) { background: #f7f7f5; }
:root:not([data-theme="dark"]) .sa-page { --surface-strong: #fff; --surface: #fff; }
:root[data-theme="dark"] .sa-page .sa-export-range label:has(:checked), :root[data-theme="dark"] .sa-editor-stages button[aria-pressed="true"] { background: #332c54; color: var(--ink); }

.sa-page .string-assistant-form { align-items: stretch; }
.sa-page .string-assistant-operation { width: 100%; }

/* T1 chat workflow progress reuses the task's actual execution stages. */
.team-chat-stage-entry { display: flex; gap: 10px; margin-top: 12px; }
.team-chat-stage-entry > div { flex: 1; min-width: 0; }
.team-chat-stage-handoff { margin: 0 0 6px; color: var(--muted); font-size: 12px; line-height: 20px; }
.team-chat-stage { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--blue) 6%, var(--surface)); color: var(--ink); text-align: left; cursor: pointer; }
.team-chat-stage-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--blue); font-size: 12px; }
.team-chat-stage-heading svg { width: 16px; height: 16px; }
.team-chat-stage-status { margin-left: auto; padding: 3px 6px; border-radius: 3px; background: var(--track); color: var(--ink); font-size: 11px; }
.team-chat-stage strong { font-size: 13px; }
.team-chat-stage small { color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.team-chat-stage.is-done { background: var(--surface); border-color: var(--line); }
.team-chat-stage.is-done .team-chat-stage-status { background: color-mix(in srgb, #3ecf9b 20%, var(--surface)); }
.team-chat-stage.is-failed { border-color: #c85b5b; }
.team-chat-composer .agent-skill-option > svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); }
.team-chat-composer .agent-skill-option-copy { flex: 1; }
.team-chat-composer .agent-skill-option { gap: 10px; }
.team-chat-stage:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.team-chat-stage svg, .team-chat-composer .agent-skill-option > svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* W6 task deliverables: artifact selector, inline preview and review/export side panels. */
.task-deliverables-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
.task-deliverables-layout > *, .task-artifacts-split > * { min-width: 0; }
.task-detail-content .task-artifacts-panel { min-height: 688px; padding: 22px 24px 24px; }
.task-artifacts-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; }
.task-artifacts-heading h3 { flex: 1; }
.task-artifacts-heading .segment { white-space: nowrap; }
.task-artifacts-split { display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); gap: 16px; }
.task-artifact-list { display: grid; align-content: start; gap: 4px; }
.task-artifact-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.task-artifact-item[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--accent-line, var(--blue)); }
.task-artifact-item:hover { background: var(--blue-soft); }
.task-artifact-item > span:last-child { min-width: 0; }
.task-artifact-item strong { display: block; font-size: 12px; line-height: 16px; font-weight: 600; overflow-wrap: anywhere; }
.task-artifact-item small { display: block; margin-top: 1px; line-height: 14px; overflow-wrap: anywhere; }
.task-artifact-item .agent-list-avatar { width: 28px; height: 28px; flex: 0 0 28px; }
.task-artifact-preview { min-height: 582px; max-height: 780px; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, var(--surface-strong)); overflow-wrap: anywhere; }
.task-artifact-preview > header { display: flex; align-items: center; gap: 10px; }
.task-artifact-preview h4 { flex: 1; min-width: 0; margin: 0; font-size: 24px; line-height: 32px; letter-spacing: -.5px; font-weight: 600; }
.task-artifact-preview header :is(button, a) { display: grid; place-items: center; flex: 0 0 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.task-artifact-preview header img, .task-export-row > img { width: 18px; height: 18px; }
.task-artifact-meta { color: var(--muted); font-size: 13px; line-height: 20px; margin: 10px 0 16px; }
.task-artifact-body { font-size: 15px; line-height: 24px; }
.task-artifact-body .library-preview-document { padding: 0; background: transparent; border: 0; }
.task-artifact-body :is(h2, h3, h4) { font-size: 17px; line-height: 24px; margin: 16px 0 4px; }
.task-artifact-body .library-preview-document :is(p, li), .task-artifact-body p { margin: 4px 0; font-size: 15px; line-height: 24px; }
.task-artifact-body pre { white-space: pre-wrap; }
.task-deliverables-side { display: grid; gap: 14px; }
.task-reviewer { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.task-reviewer small { display: block; margin-top: 2px; }
.task-review-body { font-size: 13px; line-height: 20px; max-height: 360px; overflow: auto; overflow-wrap: anywhere; }
.task-review-body :is(h2, h3, h4) { font-size: 14px; margin: 10px 0 4px; }
.task-artifacts-saved { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 8px 10px; border-radius: 8px; background: #dff6dd; color: #0e700e; font-size: 12px; line-height: 16px; font-weight: 600; }
.task-artifacts-saved img { width: 16px; height: 16px; }
.task-export-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.task-export-row > span { flex: 1; min-width: 0; }
.task-export-row strong { display: block; font-size: 12px; line-height: 16px; }
.task-export-row small { display: block; margin-top: 2px; line-height: 14px; }
.task-export-row button { flex-shrink: 0; }
.task-export-status { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-export-status:empty { display: none; }
.task-deliverables-layout :is(button, a):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-theme="dark"] .task-deliverables-layout img[src*="deliverable-"]:not([src*="saved"]) { filter: brightness(1.8); }
:root[data-theme="dark"] .task-artifacts-heading .segment.active { background: var(--blue-soft); color: var(--ink); }
@media (max-width: 1250px) { .task-deliverables-layout { grid-template-columns: minmax(0, 1fr); } .task-deliverables-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .task-artifacts-heading { flex-wrap: wrap; } .task-artifacts-heading h3 { flex-basis: 100%; margin-bottom: 0; } .task-artifacts-heading .segmented { display: flex; flex-direction: row; width: 100%; } .task-artifacts-heading .segment { flex: 1; padding: 8px; } .task-artifacts-split, .task-deliverables-side { grid-template-columns: minmax(0, 1fr); } .task-detail-content .task-artifacts-panel { min-height: 0; padding: 18px; } .task-artifact-preview { min-height: 360px; padding: 18px; } }

/* Design knowledge and the local publishing studio. */
.sharing-panel { padding: 24px; border-radius: 16px; }
.sharing-panel-header, .sharing-studio-header, .sharing-blocks > header, .sharing-block > header, .sharing-reader-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sharing-panel-header { margin-bottom: 16px; }
.sharing-panel-header .primary-button { display: flex; align-items: center; gap: 12px; min-width: 112px; justify-content: center; }
.sharing-panel-header .primary-button img { width: 15px; height: 15px; filter: brightness(0) invert(1); }
.sharing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 14px; }
.sharing-experience, .sharing-section, .sharing-blog-list { display: grid; min-width: 0; }
.sharing-experience { gap: 28px; }
.sharing-section, .sharing-blog-list { gap: 16px; }
.sharing-section > h3 { margin: 0; font-size: 24px; line-height: 1.45; }
.sharing-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sharing-channel { display: flex; flex-direction: column; padding: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--module-glass); color: var(--ink); text-align: left; }
.sharing-channel:disabled { opacity: 1; cursor: default; }
.sharing-channel:not(:disabled):hover, .sharing-blog-row:hover, .sharing-tool-card:hover { border-color: var(--blue); }
.sharing-channel-cover, .sharing-motion-visual { display: block; width: 100%; aspect-ratio: 538 / 211; object-fit: cover; }
.sharing-channel-cover { object-position: center bottom; }
.sharing-channel-caption { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; width: 100%; min-height: 62px; }
.sharing-channel-caption > span { flex: 1; min-width: 0; }
.sharing-channel-caption strong, .sharing-channel-caption small { display: block; }
.sharing-channel-caption strong { font-size: 16px; line-height: 20px; font-weight: 600; }
.sharing-channel-caption small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 16px; }
.sharing-entry-open { flex-shrink: 0; }
.sharing-motion-visual { position: relative; overflow: hidden; background: #12383c; color: #e8f7e9; container-type: inline-size; }
.sharing-motion-visual > img { position: absolute; top: -13px; right: 3%; }
.sharing-motion-title, .sharing-motion-summary { position: absolute; z-index: 1; left: 5%; }
.sharing-motion-title { top: 23%; font-size: clamp(18px, 5.4cqw, 29px); line-height: 1.17; font-weight: 700; }
.sharing-motion-summary { top: 65%; color: #b9dccf; font-size: clamp(9px, 2.4cqw, 13px); }
@container (max-width: 450px) { .sharing-motion-visual > img { transform: scale(.75); transform-origin: top right; } }
.sharing-blog-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 32px; align-items: center; gap: 24px; padding: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.sharing-blog-cover, .sharing-blog-placeholder { display: block; width: 120px; height: 72px; border-radius: 6px; object-fit: cover; }
.sharing-blog-placeholder { display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 14px; }
.sharing-blog-copy { display: grid; gap: 8px; min-width: 0; }
.sharing-blog-copy strong { font-size: 14px; line-height: 16px; }
.sharing-blog-copy > span, .sharing-blog-copy small { color: var(--muted); font-size: 12px; line-height: 16px; }
.sharing-blog-copy > :is(strong, span) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sharing-blog-copy small { margin-top: 12px; overflow-wrap: anywhere; }
.sharing-blog-empty { margin: 0; color: var(--muted); font-size: 14px; }
.sharing-tool-card h4 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.sharing-panel :is(button, a):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
:root[data-theme="dark"] .sharing-entry-open { filter: brightness(0) invert(.8); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sharing-channel { background: var(--surface-strong); } }
@media (max-width: 760px) {
  .sharing-channels { grid-template-columns: minmax(0, 1fr); }
  .sharing-blog-row { grid-template-columns: 88px minmax(0, 1fr) 18px; gap: 12px; }
  .sharing-blog-cover, .sharing-blog-placeholder { width: 88px; height: 60px; }
  .sharing-blog-copy > :is(strong, span) { white-space: normal; overflow-wrap: anywhere; }
  .sharing-blog-copy small { margin-top: 4px; }
}
.sharing-tool-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.sharing-tool-card header { display: flex; gap: 12px; align-items: center; }
.sharing-tool-card header > img { width: 40px; height: 40px; }
.sharing-tool-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 18px 0; }
.sharing-open-tool, .sharing-soft-button { border: 0; background: var(--blue-soft,#ece8ff); color: var(--blue); border-radius: 8px; padding: 12px; font-size: 12px; font-weight: 600; }
.sharing-open-tool { display: flex; align-items: center; gap: 8px; }
.sharing-open-tool img { display: block; }
.sharing-studio { display: grid; gap: 22px; }
.sharing-studio-header { align-items: flex-end; }
.sharing-studio-header h1 { margin: 22px 0 0; font-size: 28px; line-height: 34px; }
.sharing-studio-header > div:last-child { display: flex; gap: 16px; }
.sharing-studio-header > div:last-child button { min-width: 140px; }
.sharing-basic, .sharing-blocks, .sharing-block-library { background: var(--surface-strong); border-radius: 14px; padding: 24px; }
.sharing-studio h3 { margin: 0; font-size: 18px; font-weight: 600; }
.sharing-basic > h3 { margin-bottom: 28px; }
.sharing-basic-grid { display: grid; grid-template-columns: minmax(0, 1fr) min(38%, 400px); gap: 16px; }
.sharing-cover-upload { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 240px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow: hidden; }
.sharing-cover-upload > img:not(.sharing-cover-preview), .sharing-dropzone > img:not(.sharing-block-image) { width: 18px; height: 18px; }
.sharing-cover-upload strong { font-size: 14px; color: var(--blue); }
.sharing-cover-upload small { font-size: 12px; color: var(--muted); text-align: center; }
.sharing-cover-preview { width: 100%; height: 100%; object-fit: cover; }
.sharing-cover-upload input, .sharing-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sharing-cover-upload:focus-within, .sharing-dropzone:focus-within { outline: 2px solid var(--blue); }
.sharing-basic-fields { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.sharing-basic-fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.sharing-basic-fields fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sharing-basic-fields legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.sharing-basic-fields .segmented { display: flex; }
.sharing-basic-fields .segment { flex: 1; min-height: 42px; }
.sharing-studio input:not([type=file]), .sharing-studio textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 12px; color: var(--ink); background: var(--surface-strong); font-size: 14px; font-weight: 400; }
.sharing-tool-picker {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  min-height: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--module-glass-sheen);
  text-align: center;
}
.sharing-tool-picker strong, .sharing-tool-picker small { display: block; }
.sharing-tool-picker strong { font-size: 14px; color: var(--blue); }
.sharing-tool-picker small { margin-top: 4px; font-size: 12px; color: var(--muted); }
.sharing-tool-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.sharing-tool-option { position: relative; display: block; }
.sharing-tool-option input[type="radio"] { position: absolute; inset: 0; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sharing-tool-option > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; }
.sharing-tool-option:hover > span { background: var(--blue-soft); }
.sharing-tool-option input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.sharing-tool-option input:checked + span { background: var(--blue); }
:root[data-theme="dark"] .sharing-tool-option input:not(:checked) + span img { filter: brightness(0) invert(.82); }
.sharing-tool-option input:checked + span img { filter: brightness(0) invert(1); }
.sharing-tool-option input:not(:checked) + span:has(.sharing-tool-figma-outline) img:last-child,
.sharing-tool-option input:checked + span .sharing-tool-figma-outline { display: none; }
.sharing-tool-option input:checked + span:has(.sharing-tool-figma-outline) img { filter: none; }
.sharing-editor-grid { display: grid; grid-template-columns: minmax(0,760fr) minmax(260px,364fr); gap: 24px; align-items: stretch; }
.sharing-blocks, .sharing-block-library { min-height: 868px; }
.sharing-import { display: flex; align-items: center; gap: 5px; color: var(--blue); font-size: 14px; cursor: pointer; }
.sharing-import img { width: 16px; height: 16px; }
.sharing-import input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sharing-import:focus-within { outline: 2px solid var(--blue); }
#sharingBlockList { display: grid; margin-top: 12px; }
.sharing-insert-slot { position: relative; height: 16px; }
.sharing-insert-slot.is-target::after {
  position: absolute;
  inset: 6px 0;
  border-radius: 3px;
  background: var(--blue);
  content: "";
}
.sharing-empty-blocks {
  display: grid;
  min-height: 112px;
  place-items: center;
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}
.sharing-block { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.sharing-block > header { font-size: 12px; color: var(--muted); }
.sharing-block > header > span { display: flex; align-items: center; gap: 4px; }
.sharing-block > header button { border: 0; background: transparent; color: var(--ink); font-size: 12px; padding: 2px 4px; }
.sharing-block > header button:disabled { opacity: .3; cursor: default; }
.sharing-drag { cursor: grab; }
.sharing-drag img { display: block; width: 16px; height: 16px; }
.sharing-block > input, .sharing-block > textarea { border: 0 !important; padding: 0 !important; resize: vertical; }
.sharing-block > input { min-height: 24px; }
.sharing-block[data-block-index] > input:first-of-type { font-size: 14px; }
.sharing-link-fields { display: grid; grid-template-columns: 1fr 1.7fr; gap: 8px; }
.sharing-link-fields label { display: flex; align-items: center; background: var(--bg); padding: 0 8px; border-radius: 4px; gap: 8px; font-size: 11px; color: var(--muted); }
.sharing-link-fields input { border: 0 !important; background: transparent !important; padding: 8px 0 !important; }
.sharing-dropzone { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border: 1px dashed var(--muted); border-radius: 4px; min-height: 100px; padding: 16px; text-align: center; font-size: 13px; }
.sharing-dropzone small { color: var(--muted); font-size: 11px; }
.sharing-block-image { max-width: 100%; max-height: 220px; object-fit: contain; }
.sharing-block-library { padding: 20px; }
.sharing-block-library > p { font-size: 14px; color: var(--muted); margin: 8px 0 24px; }
.sharing-block-library > button { display: flex; align-items: center; width: 100%; min-height: 68px; gap: 16px; padding: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-align: left; margin-bottom: 14px; }
.sharing-block-library > button[draggable] { cursor: grab; }
.sharing-block-library > button[draggable]:active { cursor: grabbing; }
.sharing-block-library > button > img:first-child { width: 24px; height: 24px; }
.sharing-block-library > button > img:last-child { width: 15px; height: 15px; margin-left: auto; }
.sharing-block-library strong, .sharing-block-library small { display: block; }
.sharing-block-library strong { font-size: 14px; font-weight: 600; }
.sharing-block-library small { font-size: 12px; color: var(--muted); margin-top: 4px; }
#sharingSaveStatus { font-size: 13px; color: var(--muted); margin: 0; }
.sharing-reader { width: min(100%, 860px); margin: 0 auto; padding: clamp(16px, 3vw, 32px); border-radius: 16px; }
.sharing-reader .amp-breadcrumb button { color: var(--blue); font-weight: 600; }
.sharing-reader-header { flex-wrap: wrap; }
.sharing-preview-status { color: var(--red); font-size: 13px; margin: 12px 0 0; }
.sharing-preview-status:empty { display: none; }
.sharing-article { display: grid; gap: 24px; margin-top: 24px; overflow-wrap: anywhere; }
.sharing-article-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); line-height: 1.25; }
.sharing-article-heading h1:focus { outline: none; }
.sharing-article-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.sharing-article-cover { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 16px; }
.sharing-article-summary, .sharing-prose { margin: 0; white-space: pre-wrap; line-height: 1.6; }
.sharing-article-summary { color: var(--muted); }
.sharing-article-body { display: grid; gap: 24px; min-width: 0; }
.sharing-article-body:empty { display: none; }
.sharing-article-body h2 { margin: 10px 0 -12px; font-size: 24px; line-height: 1.4; }
.sharing-article-body figure { margin: 0; }
.sharing-article-body figure img { display: block; max-width: 100%; height: auto; border-radius: 16px; }
.sharing-article-body figcaption, .sharing-article-file p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.sharing-article-link { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 16px; }
.sharing-article-link a { color: var(--blue); min-width: 0; }
.sharing-article-file a { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 10px 12px; background: #6b5cd4; color: white; border-radius: 8px; text-decoration: none; }
.sharing-article-file a:hover { text-decoration: underline; }
:root[data-theme="dark"] .sharing-article-link img { filter: invert(1); }
@media(max-width:1000px) { .sharing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .sharing-editor-grid { grid-template-columns: minmax(0,1fr) 260px; } }
@media(max-width:760px) { .sharing-grid, .sharing-basic-grid, .sharing-editor-grid { grid-template-columns: 1fr; } .sharing-studio-header { flex-direction: column; align-items: stretch; } .sharing-studio-header > div:last-child button { min-width: 0; flex: 1; } .sharing-blocks, .sharing-block-library { min-height: 0; } .sharing-panel { padding: 16px; } .sharing-panel-header { flex-wrap: wrap; } .sharing-link-fields { grid-template-columns: 1fr; } }
.sharing-tool-mark { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #eeeafe; }
.sharing-tool-mark.imgFrame1 { background: #e4f3ef; }
.sharing-tool-mark.imgFrame2 { background: #eaf0ff; }
.sharing-tool-mark img { display: block; }
.sharing-tool-mark-custom { background: var(--blue-soft); }
:root[data-theme="dark"] .sharing-tool-mark-custom img:not([src$="sharing-tool-figma.svg"]) { filter: brightness(0) invert(.82); }
.sharing-article-heading h1:has(.sharing-tool-mark) { display: flex; align-items: center; gap: 12px; }
@media (max-width: 1000px) { .sharing-tool-options { column-gap: 8px; } }
:root[data-theme="dark"] .sharing-studio input:not([type="file"]),
:root[data-theme="dark"] .sharing-studio textarea { background: #202020; color: #f2f2f2; border-color: var(--line-strong); }
:root[data-theme="dark"] .sharing-block-library > button > img:first-child { filter: invert(1); }

/* FAQ uses the Library publishing studio and the same workspace surfaces. */
.faq-view { color: var(--ink); }
.faq-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.faq-head h1 { margin:0; font-size:30px; }
.faq-card { background:var(--surface-strong); border-radius:14px; padding:24px; }
.faq-card h3 { margin:0 0 18px; font-size:17px; }
.faq-card small, .faq-answer figcaption, .faq-empty p { color:var(--muted); }
.faq-search { display:flex; align-items:center; gap:10px; padding:0 14px; background:var(--bg); border:1px solid var(--line); border-radius:8px; }
.faq-search:focus-within { outline:2px solid var(--blue); }
.faq-search img, .faq-empty img { width:18px; height:18px; }
.faq-search input { width:100%; background:transparent; color:var(--ink); border:0; padding:14px 0; outline:0; }
.faq-row { border-top:1px solid var(--line); }
.faq-row header { display:flex; align-items:center; gap:12px; }
.faq-question, .faq-chevron { border:0; background:transparent; color:inherit; }
.faq-question { display:grid; gap:6px; flex:1; text-align:left; padding:18px 0; min-width:0; overflow-wrap:anywhere; }
.faq-question strong { font-size:16px; font-weight:600; }
.faq-question small { font-size:12px; }
.faq-chevron { font-size:19px; padding:8px; }
.faq-question, .faq-chevron { text-decoration:none; }
.faq-question:hover strong, .faq-view .amp-breadcrumb a { color:var(--blue); }
.faq-answer { display:grid; justify-items:start; gap:18px; padding:24px; overflow-wrap:anywhere; }
.faq-answer p,.faq-answer h3,.faq-answer figure { margin:0; white-space:pre-wrap; max-width:100%; }
.faq-answer img,.faq-answer video { display:block; max-width:100%; height:auto; border-radius:6px; }
.faq-answer video { width:490px; background:#312d4e; }
.faq-answer figcaption { font-size:12px; margin-top:8px; }
.faq-empty { text-align:center; padding:48px 0; }
.faq-empty h3 { margin:12px 0 6px; }
.faq-success { background:var(--surface-strong); color:var(--ink); border-inline-start:3px solid #399568; padding:14px; }
.faq-block-list { display:grid; margin-top:8px; }
.faq-video-icon { width:24px; text-align:center; }
.faq-error { color:var(--ink); }
.faq-view .sharing-basic-fields { margin-top:18px; }
.faq-view .sharing-dropzone input[type=file] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.faq-view .sharing-dropzone:focus-within { outline:2px solid var(--blue); }
.nav-item[data-page="faq"][hidden] { display:none; }
[data-page-view="faq"] .faq-head:has(h1:only-child) { min-height:104px; }
.faq-view .secondary-button { background:var(--surface-strong); border:1px solid var(--line); }

:root[data-theme="dark"] .faq-search input { background:transparent; border:0; box-shadow:none; }
:root[data-theme="dark"] .faq-search img, :root[data-theme="dark"] .faq-empty img { filter:brightness(0) invert(.78); }
.faq-view .amp-breadcrumb a { text-decoration:none; }
.faq-view .amp-breadcrumb a:hover { text-decoration:underline; }
[data-page-view="faq-preview"] { width:min(100%, 860px); margin-inline:auto; }
.faq-preview-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; background:var(--blue-soft); color:var(--blue); padding:12px 24px; border-radius:8px; }
.faq-preview-bar > div { display:flex; flex-wrap:wrap; gap:16px; }
.faq-preview-bar .secondary-button { border-color:var(--blue); color:var(--blue); background:transparent; }
.faq-preview-bar button { min-height:42px; }

#artifactTabs { width:fit-content; max-width:100%; min-width:0; justify-self:start; flex-wrap:nowrap; overflow-x:auto; }
.sharing-block-library button, .sharing-drag { touch-action:none; user-select:none; cursor:grab; }
.studio-drag-preview { position:fixed; z-index:9999; pointer-events:none; top:0; left:0; border:1px solid var(--line); background:var(--surface-strong); color:var(--ink); box-shadow:var(--shadow); border-radius:8px; padding:14px 24px; font-size:14px; font-weight:600; }

.studio-drag-preview { display:flex; align-items:center; gap:12px; max-width:min(360px, 90vw); }
.studio-drag-preview img { width:22px; height:22px; }
.studio-drag-preview img:last-child { width:15px; height:15px; margin-left:auto; }
.studio-drag-preview small { display:block; margin-top:4px; color:var(--muted); font-size:12px; font-weight:400; }
:root[data-theme="dark"] .studio-drag-preview img:first-child { filter:invert(1); }

/* Wonder moment D3–D5: retain the gallery and shared glass behind the overlays. */
.wonder-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#openWonderPublish { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wonder-publish { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border-radius: 16px; color: var(--ink); box-sizing: border-box; }
.wonder-publish {
  --module-glass: rgba(255,255,255,.92);
  --module-glass-edge: rgba(255,255,255,.72);
  --module-glass-sheen: rgba(255,255,255,.18);
  background: linear-gradient(135deg, var(--module-glass-sheen), transparent 65%), var(--module-glass);
  border: 1px solid var(--module-glass-edge);
  box-shadow: 0 12px 40px rgba(20,15,31,.24);
  -webkit-backdrop-filter: blur(28px) saturate(115%);
  backdrop-filter: blur(28px) saturate(115%);
}
:root[data-theme="dark"] .wonder-publish { --module-glass: rgba(24,26,31,.94); --module-glass-edge: rgba(255,255,255,.12); --module-glass-sheen: rgba(255,255,255,.025); }
.wonder-publish::backdrop, .wonder-preview::backdrop { background: rgba(25,23,31,.44); }
#wonderPublishForm { display: grid; gap: 24px; }
#wonderPublishForm > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#wonderPublishForm h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 26px; }
#wonderPublishForm header p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.wonder-icon-close { padding: 0; border: 0; background: transparent; cursor: pointer; }
.wonder-field { display: grid; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; }
.wonder-field b { color: var(--red); }
.wonder-upload { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; height: 144px; border: 1.5px dashed #ada8b8; border-radius: 10px; overflow: hidden; cursor: pointer; }
.wonder-upload strong { color: var(--blue); font-size: 16px; font-weight: 600; }
.wonder-upload small { color: var(--muted); font-size: 12px; font-weight: 400; }
.wonder-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wonder-upload:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
#wonderUploadPreview:not([hidden]) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface-strong); }
#wonderImageTitle { min-width: 0; width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--input-bg, transparent); font: inherit; font-weight: 400; }
#wonderImageTitle::placeholder { color: var(--muted); }
#wonderPublishForm footer { display: flex; justify-content: flex-end; gap: 8px; }
#wonderPublishForm footer button { height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; cursor: pointer; }
#wonderPublishSubmit:disabled { opacity: .55; cursor: default; }
#wonderPublishStatus { margin: 0; color: var(--red); font-size: 13px; }
.wonder-preview { padding: 7.5dvh 80px; }
.wonder-preview[open] { display: block; }
.wonder-preview-toolbar { position: absolute; inset: 0; padding: 0; border-radius: 0; background: transparent; pointer-events: none; }
.wonder-preview-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wonder-preview-actions { position: absolute; right: 68px; top: 7.5dvh; pointer-events: auto; }
#closeWonderPreview { width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.23); }
#closeWonderPreview img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
#wonderPreviewOriginal[hidden] { display: none; }
.wonder-preview-stage { width: 100%; height: 100%; pointer-events: none; }
.wonder-preview-stage img { pointer-events: auto; box-shadow: 0 4px 8px #0002; }
:root[data-theme="dark"] .wonder-icon-close img { filter: invert(1); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .wonder-publish { background: var(--surface-strong); } }
@media (max-width: 760px) {
  .wonder-publish { padding: 20px; }
  .wonder-preview { padding: 72px 16px 24px; }
  .wonder-preview-actions { top: 12px; right: 16px; }
  #closeWonderPreview { width: 44px; height: 44px; }
}
