:root {
  --ink: #14211c;
  --muted: #68756e;
  --forest: #174c3e;
  --forest-2: #236653;
  --mint: #e8f2ed;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --soft: #f8faf9;
  --line: #d9e1dc;
  --line-strong: #bdcbc3;
  --danger: #9b3d43;
  --focus: #2f7d62;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --shadow: 0 18px 50px rgba(25, 45, 36, 0.12);
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

a,
button,
input,
select,
textarea,
summary {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--forest);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(calc(-100% - 16px));
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 20px;
  height: 20px;
  flex: none;
  fill: var(--forest-2);
}

.room-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.project-dot,
.connection-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #75b89b;
  box-shadow: 0 0 0 4px #e5f2ec;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.text-button,
.quiet-button,
.primary-button,
.connection-button,
.run-button,
.attach-button,
.send-button,
.link-button,
.danger-button,
.close-button {
  min-height: 40px;
  border-radius: 9px;
  font-weight: 750;
}

.text-button,
.quiet-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: #3c4a43;
  background: #fff;
}

.text-button:hover,
.quiet-button:hover {
  border-color: var(--line-strong);
  background: var(--soft);
}

.action-count {
  min-width: 20px;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.connection-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid #b9d4c7;
  color: var(--forest);
  background: #f4faf7;
}

.connection-button.connected {
  border-color: var(--line);
  color: #405048;
  background: #fff;
}

.connection-button.connected .connection-dot {
  background: #2e8b67;
}

.workspace {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: clamp(24px, 3vw, 44px);
  background:
    radial-gradient(circle at 45% 0%, rgba(220, 239, 230, 0.8), transparent 32%),
    var(--canvas);
}

.mission-overview,
.active-team-panel,
.stage-grid {
  width: min(1160px, 100%);
  margin-inline: auto;
}

.mission-overview,
.active-team-panel,
.collaboration-card,
.output-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.mission-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px 30px;
  padding: clamp(22px, 3vw, 34px);
}

.eyebrow,
.field-label {
  color: #627168;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.mission-copy h1 {
  max-width: 850px;
  margin: 7px 0 9px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.mission-copy p,
.wizard-header p,
.drawer-header p,
.wizard-step > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.mission-copy p {
  max-width: 760px;
}

.mission-actions {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.primary-button,
.run-button,
.send-button {
  border: 1px solid var(--forest);
  color: #fff;
  background: var(--forest);
  box-shadow: 0 5px 14px rgba(23, 76, 62, 0.14);
}

.primary-button:hover,
.run-button:hover,
.send-button:hover {
  border-color: #0f3d32;
  background: #0f3d32;
}

.primary-button {
  padding: 9px 15px;
}

.run-button {
  min-height: 44px;
  padding: 10px 17px;
  white-space: nowrap;
}

.cancel-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #e3c5c7;
  border-radius: 9px;
  color: var(--danger);
  font-weight: 750;
  white-space: nowrap;
  background: #fff8f8;
}

.cancel-button:hover {
  border-color: #cf999d;
  background: #fff1f2;
}

.cancel-button[hidden] {
  display: none;
}

.run-button span {
  margin-left: 7px;
}

.mission-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}

.mission-summary div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--soft);
}

.mission-summary dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mission-summary dd {
  margin: 0;
  color: #34423b;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.active-team-panel {
  margin-top: 14px;
  padding: 17px;
}

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

.section-heading h2,
.section-heading h3 {
  margin: 4px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.output-actions .quiet-button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.output-actions[hidden] {
  display: none;
}

.team-count,
.dialogue-status,
.output-status,
.agent-prompt-status,
.key-status {
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.link-button {
  min-height: 40px;
  padding: 7px 3px;
  border: 0;
  color: var(--forest);
  background: transparent;
}

.link-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.active-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.active-team-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #e1e7e3;
  border-radius: 10px;
  background: var(--surface);
}

.team-order {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--forest);
  background: var(--mint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.team-person {
  min-width: 0;
}

.team-person strong,
.team-person small {
  display: block;
  overflow-wrap: anywhere;
}

.team-person strong {
  font-size: 12px;
}

.team-person small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.team-agent-state {
  padding: 4px 6px;
  border-radius: 999px;
  color: #647169;
  background: #eef2ef;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.active-team-card.starting,
.active-team-card.next {
  border-color: #94bca9;
  background: #f6fbf8;
}

.active-team-card.starting .team-agent-state,
.active-team-card.next .team-agent-state {
  color: #22684f;
  background: #dff0e7;
}

.active-team-card.contributed .team-agent-state,
.active-team-card.complete .team-agent-state {
  color: #315e52;
  background: #e7f1ec;
}

.active-team-card.paused .team-agent-state {
  color: #865f2e;
  background: #f5ecdf;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
  padding-bottom: 40px;
}

.collaboration-card,
.output-card {
  min-width: 0;
  min-height: 510px;
  padding: 18px;
}

.collaboration-card {
  display: flex;
  flex-direction: column;
}

.team-transcript {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  padding: 16px 0;
}

.team-transcript-empty,
.empty-output {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  gap: 13px;
  min-height: 315px;
  padding: 28px;
  border: 1px dashed #d3ddd7;
  border-radius: 11px;
  background: var(--soft);
}

.empty-icon {
  width: 28px;
  height: 28px;
  flex: none;
  fill: var(--forest-2);
}

.team-transcript-empty strong,
.empty-output strong {
  display: block;
  font-size: 14px;
}

.team-transcript-empty p,
.empty-output p {
  max-width: 350px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.message {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid #dce5df;
  border-radius: 11px;
  background: #fafcfb;
  overflow-wrap: anywhere;
}

.message > div:last-child {
  min-width: 0;
}

.message-label {
  display: block;
  color: #4a5951;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.message-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.message p {
  margin: 5px 0 0;
  color: #49574f;
  font-size: 12px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.avatar {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #eff8f3;
  background: var(--forest);
  font-size: 11px;
  font-weight: 800;
}

.user-message {
  align-self: flex-end;
  width: auto;
  max-width: 88%;
  margin-left: auto;
  border-color: #cfe0d7;
  background: #eaf3ee;
}

.user-message .avatar {
  display: none;
}

.orchestrator-message {
  border-left: 3px solid #b78b4d;
  background: #fbf8f2;
}

.orchestrator-message .avatar {
  background: #876232;
}

.composer {
  margin-top: auto;
  padding: 13px;
  border: 1px solid #cad6cf;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(28, 50, 40, 0.06);
}

.composer:focus-within {
  border-color: #7cae98;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: none;
}

.composer > label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
}

.composer textarea {
  width: 100%;
  resize: vertical;
  padding: 7px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  line-height: 1.5;
}

.composer textarea:focus-visible {
  outline: 0;
}

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

.attach-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: #4c5b53;
  background: var(--soft);
}

.input-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.send-button {
  padding: 8px 12px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 9px;
}

.attachment-list:empty {
  display: none;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #d5ddd8;
  border-radius: 999px;
  color: var(--ink);
  background: #f7faf8;
  font-family: var(--font-mono);
  font-size: 9px;
}

.attachment-chip img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.attachment-chip > span {
  max-width: 180px;
  overflow-wrap: anywhere;
}

.attachment-chip button {
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.synthesis {
  padding-top: 19px;
}

.synthesis h3 {
  margin: 4px 0 10px;
  font-size: 21px;
  letter-spacing: -0.03em;
  text-transform: capitalize;
}

.synthesis-response {
  color: #46534c;
  font-size: 13px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.synthesis-response > :first-child {
  margin-top: 0;
}

.synthesis-response > :last-child {
  margin-bottom: 0;
}

.synthesis-response h3,
.synthesis-response h4 {
  margin: 1.25em 0 0.45em;
  color: var(--ink);
  font-size: 1.08em;
  letter-spacing: -0.015em;
  text-transform: none;
}

.synthesis-response p,
.synthesis-response ul,
.synthesis-response ol {
  margin: 0.65em 0;
}

.synthesis-response ul,
.synthesis-response ol {
  padding-left: 1.4em;
}

.synthesis-response li + li {
  margin-top: 0.35em;
}

.result-table-wrap {
  max-width: 100%;
  margin: 1em 0;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.result-table caption {
  padding-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

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

.result-table th {
  color: var(--ink);
  background: var(--mint);
}

.synthesis-side {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.synthesis-side strong {
  font-size: 12px;
}

.synthesis-side p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.generated-visual {
  display: block;
  width: 100%;
  margin-top: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

#visualOutputList figure {
  margin: 0;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(18, 31, 25, 0.44);
}

.wizard-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.wizard-dialog form {
  height: min(880px, calc(100dvh - 32px));
  max-height: inherit;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.wizard-header,
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.wizard-header > div,
.drawer-header > div {
  min-width: 0;
}

.wizard-header {
  padding: 24px 26px 17px;
}

.wizard-header h2,
.drawer-header h2 {
  margin: 6px 0 7px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.wizard-header p {
  max-width: 580px;
  font-size: 13px;
}

.close-button {
  width: 40px;
  min-width: 40px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  color: #526159;
  background: #fff;
  font-size: 22px;
}

.close-button:hover {
  background: var(--soft);
}

.wizard-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 26px;
  border-block: 1px solid var(--line);
  background: var(--soft);
}

.wizard-progress p {
  margin: 0;
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.wizard-progress ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-progress li {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.wizard-progress li[aria-current="step"] {
  color: var(--forest);
  background: var(--mint);
}

.wizard-step {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 26px 30px;
}

.wizard-step h3 {
  margin: 0 0 5px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.wizard-step > p {
  margin-bottom: 19px;
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 17px 0 7px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #7f8d85;
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--focus);
}

[aria-invalid="true"] {
  border-color: #c35a61;
  box-shadow: 0 0 0 3px #f8e6e7;
}

.field-help,
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.field-help {
  color: var(--muted);
}

.field-error {
  color: var(--danger);
  font-weight: 700;
}

.conditional-field {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d9e3dd;
  border-radius: 10px;
  background: #f8fbf9;
  scroll-margin-bottom: 120px;
}

.conditional-field[hidden] {
  display: none;
}

.conditional-field .field-label:first-child {
  margin-top: 0;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
}

.template-chip {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #506057;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

.template-chip:hover,
.template-chip[aria-pressed="true"] {
  border-color: #95bdaa;
  color: var(--forest);
  background: var(--mint);
}

.source-card,
.defaults-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

.source-card {
  justify-content: space-between;
}

.source-card strong,
.defaults-summary strong {
  display: block;
  font-size: 13px;
}

.source-card p,
.defaults-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.defaults-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: #dceee5;
  font-weight: 800;
}

.choice-group {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.choice-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: #87b29e;
  background: #f3f9f6;
}

.choice-card input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--forest);
  box-shadow: none;
}

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

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.choice-card em {
  margin-left: 5px;
  color: var(--forest);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wizard-footer,
.drawer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.wizard-footer > div {
  display: flex;
  gap: 8px;
}

.drawer-dialog {
  width: min(480px, 100%);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px 0 0 18px;
  box-shadow: -18px 0 55px rgba(20, 38, 30, 0.17);
}

.specialist-drawer {
  width: min(530px, 100%);
}

.drawer-dialog[open] {
  animation: drawer-in 180ms ease-out;
}

.drawer-dialog form {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-header {
  padding: 23px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-header p {
  max-width: 380px;
  font-size: 12px;
}

.drawer-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.drawer-section,
.agent-editor {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.drawer-section .field-label:first-of-type {
  margin-top: 12px;
}

.tool-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 13px;
  cursor: pointer;
}

.tool-option input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--forest);
  box-shadow: none;
}

.tool-option strong,
.tool-option small {
  display: block;
}

.tool-option strong {
  font-size: 13px;
}

.tool-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.session-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.session-row span:first-child {
  color: var(--forest);
  font-weight: 800;
}

.compact-choices {
  margin-bottom: 7px;
}

.team-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.agent-roster {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.agent-roster-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.agent-roster-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.agent-roster-item.active {
  border-color: #8fb7a4;
  background: #f4f9f6;
}

.agent-choice {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  cursor: pointer;
}

.agent-choice input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--forest);
  box-shadow: none;
}

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

.agent-choice strong {
  font-size: 12px;
}

.agent-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.agent-roster-item > button {
  min-height: 40px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--forest);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.agent-roster-item > button:hover {
  background: var(--mint);
}

.agent-editor {
  background: var(--soft);
}

.agent-editor summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.agent-editor-fields {
  padding-top: 3px;
}

.danger-button {
  width: 100%;
  margin-top: 17px;
  padding: 9px 12px;
  border: 1px solid #e3c5c7;
  color: var(--danger);
  background: #fff8f8;
}

.danger-button:hover {
  border-color: #cf999d;
  background: #fff1f2;
}

.drawer-status {
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  border-radius: 9px;
  color: #fff;
  background: #152c24;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes drawer-in {
  from { transform: translateX(24px); }
  to { transform: translateX(0); }
}

@media (max-width: 920px) {
  .room-label {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .collaboration-card,
  .output-card {
    min-height: 0;
  }

  .team-transcript-empty,
  .empty-output {
    min-height: 260px;
  }
}

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

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 9px;
    padding: 9px 12px 10px;
  }

  .top-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions button {
    min-width: 0;
    padding-inline: 7px;
    font-size: 11px;
  }

  .connection-button {
    justify-content: center;
  }

  .workspace {
    padding: 16px;
  }

  .mission-overview {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .mission-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mission-actions button {
    width: 100%;
  }

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

  .section-heading,
  .section-actions {
    align-items: flex-start;
  }

  .section-actions {
    flex-direction: column;
    gap: 3px;
  }

  .active-team {
    grid-template-columns: 1fr;
  }

  .collaboration-card,
  .output-card {
    padding: 15px;
  }

  .composer-actions {
    flex-wrap: wrap;
  }

  .input-hint {
    display: none;
  }

  .send-button {
    margin-left: auto;
  }

  .wizard-dialog,
  .drawer-dialog,
  .specialist-drawer {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .wizard-dialog form {
    height: 100%;
    max-height: none;
  }

  .wizard-header,
  .wizard-step,
  .drawer-header,
  .drawer-section,
  .agent-editor {
    padding-inline: 18px;
  }

  .wizard-progress {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-inline: 18px;
  }

  .wizard-footer,
  .drawer-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .source-card {
    align-items: stretch;
    flex-direction: column;
  }

  .team-actions {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .link-button,
  .template-chip,
  .agent-roster-item > button {
    min-height: 44px;
  }
}

@media (max-width: 390px) {
  .brand {
    font-size: 13px;
  }

  .connection-dot {
    display: none;
  }

  .mission-summary {
    grid-template-columns: 1fr;
  }

  .wizard-progress li {
    padding-inline: 3px;
    font-size: 10px;
  }

  .wizard-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

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

@media (forced-colors: active) {
  :focus-visible,
  .composer:focus-within {
    outline: 3px solid CanvasText;
  }

  .project-dot,
  .connection-dot {
    border: 1px solid CanvasText;
  }
}
