:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  --canvas: light-dark(#fff, #141414);
  --sidebar: light-dark(#f7f7f7, #1c1c1c);
  --rail: light-dark(#ededed, #101010);
  --soft: light-dark(#f3f3f3, #262626);
  --hover: light-dark(#e9e9e9, #303030);
  --line: light-dark(#dfdfdf, #363636);
  --ink: light-dark(#191919, #f1f1f1);
  --muted: light-dark(#626262, #b1b1b1);
  --warning: light-dark(#865400, #f0c177);
  --success: light-dark(#176148, #92d5ba);
  --error: light-dark(#a52626, #ffaaaa);
  --content: 780px;
  background: var(--canvas);
  color: var(--ink);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 60px 230px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

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

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

button:disabled { cursor: default; opacity: .55; }

input, textarea, select {
  min-width: 0;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

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

p, h1, h2, h3 { margin: 0; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-inline-end: 1px solid var(--line);
  background: var(--rail);
}

.mark {
  display: flex;
  height: 32px;
  margin-bottom: 19px;
  padding: 3px;
  border-radius: 7px;
  background: #151515;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.mark span { display: grid; place-items: center; width: 18px; }
.mark span:last-child { background: #ffa31a; color: #151515; border-radius: 4px; }

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
  padding: 0;
}

.round-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}

.round-button:disabled { opacity: 1; }

.icon-button:not(:disabled):hover,
.icon-button[aria-pressed="true"],
.icon-button[aria-expanded="true"] {
  background: var(--hover);
  color: var(--ink);
}

.rail .icon-button[aria-pressed="true"] {
  background: light-dark(#dadada, #303030);
}

.rail a.icon-button { text-decoration: none; }
.rail-bottom { margin-top: auto; }

.context {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-inline-end: 1px solid var(--line);
}

.context-brand {
  display: flex;
  align-items: center;
  flex: 0 0 60px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.025em;
}

.context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 5px 16px;
}

.context-header h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.context-list {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1px 9px 12px;
}

.context-item {
  display: block;
  width: 100%;
  padding: 10px 9px;
  color: var(--ink);
  text-align: start;
  border-radius: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 13px;
}

.context-item:hover,
.context-item[aria-current="true"] { background: var(--hover); }
.context-item[aria-current="true"] { font-weight: 650; }
.context-item:focus-visible { outline-offset: -2px; }

.list-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 16px;
}

.context-list .list-empty { padding-inline: 7px; }

#chatList { padding-bottom: 78px; }
.chat-list-row { display: flex; align-items: center; gap: 3px; }
.chat-list-row .context-item { min-width: 0; flex: 1; }
.chat-list-menu { position: relative; }
.chat-list-menu .chat-actions { width: 32px; height: 32px; font-weight: 700; }
.chat-menu-actions {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 3px) 0 auto auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
.chat-menu-actions button {
  display: block;
  width: 100%;
  text-align: start;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
}
.chat-menu-actions button:hover { background: var(--hover); }
.chat-menu-actions .chat-remove { color: var(--error); }

.project-form {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 2px 12px 12px;
}

.project-form input { width: 100%; }

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--canvas);
}

.topbar {
  min-height: 60px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px clamp(12px, 3vw, 32px);
}

.topbar-heading, .topbar-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-heading { min-width: 0; }
.topbar-controls { flex-shrink: 0; }

.topbar h1 {
  font-size: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.015em;
}

.context-toggle { display: none; }
.runner { font-size: 12px; color: var(--muted); }
.theme-moon, :root[data-theme="dark"] .theme-sun { display: none; }
:root[data-theme="dark"] .theme-moon { display: block; }

.workspace-notices { grid-row: 2; }

.notice {
  padding: 9px clamp(12px, 3vw, 32px);
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.notice.unavailable { color: var(--error); }

.model-status, .model-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.model-status { justify-content: space-between; }
.model-controls select { max-width: 100%; font-size: 13px; }
.model-status p { overflow-wrap: anywhere; }

.history {
  grid-row: 3;
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scrollbar-gutter: stable;
  padding: 0 clamp(12px, 3vw, 32px);
}

.history:focus-visible { outline-offset: -3px; }

.history-inner {
  width: 100%;
  max-width: var(--content);
  min-height: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.empty {
  margin: auto;
  width: 100%;
  padding: 30px 0;
}

.empty h2 { font-size: clamp(23px, 3.5vw, 32px); letter-spacing: -.035em; font-weight: 650; }
.empty p { color: var(--muted); margin-top: 8px; line-height: 1.5; font-size: 14px; }
.empty button { margin-top: 14px; }

.chat-messages { display: grid; gap: 24px; padding: 22px 0; }
.chat-message { min-width: 0; overflow-wrap: anywhere; }
.chat-message.user {
  justify-self: end;
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--soft);
}
.chat-message-text { white-space: pre-wrap; line-height: 1.6; }
.chat-message-text:empty { display: none; }
.chat-message-status { color: var(--muted); font-size: 13px; }
.chat-message-text:not(:empty) + .chat-message-status { margin-top: 6px; }
.chat-message-status:has(+ .chat-message-text:not(:empty)) { margin-bottom: 6px; }
.agent-elapsed { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

@supports (background-clip: text) {
  .agent-activity {
    background: linear-gradient(100deg, var(--activity-text, var(--muted)) 34%, var(--ink) 50%,
      var(--activity-text, var(--muted)) 66%) 100% 0 / 250% 100%;
    background-clip: text;
    --activity-foreground: transparent;
    color: var(--activity-foreground);
    animation: agent-highlight 2s linear infinite;
  }
}

@keyframes agent-highlight {
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .agent-activity {
    --activity-foreground: var(--activity-text, var(--muted));
    animation: none;
    background: none;
    color: var(--activity-foreground);
  }
}

.chat-answer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; }
.chat-copy { width: 32px; height: 32px; }
.chat-copy svg { width: 17px; height: 17px; }
.chat-copy-feedback, .chat-message-timing { color: var(--muted); font-size: 12px; }
.chat-copy-feedback:empty { display: none; }
.chat-message-timing { font-variant-numeric: tabular-nums; }
.chat-search-notice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.chat-search-icon {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
}
.chat-search-icon svg { width: 18px; height: 18px; }
.chat-search-notice h2 { font-size: 15px; line-height: 1.35; font-weight: 650; }
.chat-search-notice p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
#chatComposer[data-search] { padding: 12px; background: var(--canvas); }
#chatComposer[data-search] > .photo-preview { display: none; }
#chatComposer[data-search] > textarea { background: var(--soft); border: 1px solid var(--line); }
.chat-search-controls { display: grid; gap: 5px; min-width: 0; margin: 9px 0 0; padding: 0; border: 0; }
.chat-search-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.chat-search-controls:not(:disabled) label:hover { background: var(--soft); }
.chat-search-controls label:has(:checked) { border-color: var(--line); background: var(--soft); }
.chat-search-controls input { margin: 0; accent-color: var(--ink); }
#chatSearchError { margin: 0; }
#confirmChatSearch {
  justify-self: end;
  min-height: 36px;
  padding-inline: 12px;
  background: var(--ink);
  color: var(--canvas);
  border-color: transparent;
}
#confirmChatSearch:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 86%, var(--canvas)); }
.chat-sources { margin-top: 9px; color: var(--muted); font-size: 13px; }
.chat-sources ol { margin-block: 6px 0; padding-inline-start: 22px; }
.chat-sources a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.chat-image { display: block; max-width: min(100%, 320px); max-height: 280px; border-radius: 8px; }
.chat-file { display: inline-block; margin-block: 3px; color: var(--muted); font-size: 13px; }

.generated-image {
  position: relative;
  width: min(100%, 320px, 42dvh);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--soft);
}
.generated-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.generated-image-actions { position: absolute; inset: auto 8px 8px auto; display: flex; gap: 6px; }
.image-action {
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  color: #fff;
  background: rgb(18 18 18 / 62%);
}
.image-action:not(:disabled):hover, .image-action:focus-visible { color: #fff; background: rgb(18 18 18 / 88%); }
.image-action:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.image-dialog {
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--canvas);
  overflow: hidden;
}
.image-dialog::backdrop { background: rgb(0 0 0 / 76%); }
.image-dialog-content {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}
.image-dialog-content img { display: block; max-width: none; }
.image-dialog-close { position: absolute; inset: 8px 8px auto auto; }

.task {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.task:last-child { border-bottom: 0; }

.task-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-bottom: 7px;
}

.task-heading h2 { font-size: 16px; font-weight: 650; }
.task-info, .task-status { font-size: 12px; color: var(--muted); }
.task-status.running {
  --activity-text: var(--warning);
  color: var(--activity-foreground, var(--activity-text));
}
.task-status.review { color: var(--warning); }
.task-status.succeeded { color: var(--success); }
.task-status.failed, .task-status.blocked { color: var(--error); }
.task-prompt, .task-result { margin-top: 11px; white-space: pre-wrap; line-height: 1.6; }
.task-result { color: var(--muted); }

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.secondary {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  min-height: 30px;
}

.secondary:not(:disabled):hover,
.secondary[aria-expanded="true"] { background: var(--hover); }

.task-log {
  margin: 10px 0 0;
  padding: 10px;
  max-height: 200px;
  overflow: auto;
  border-radius: 8px;
  background: var(--soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.composer-area {
  grid-row: 4;
  padding: 10px clamp(12px, 3vw, 32px) max(16px, env(safe-area-inset-bottom));
}

.error-message {
  max-width: var(--content);
  margin: 0 auto 8px;
  color: var(--error);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.error-message:empty { display: none; }

.composer {
  max-width: var(--content);
  margin-inline: auto;
  padding: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.composer > input, .composer > textarea {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  background: transparent;
}

.composer > input { font-weight: 650; }
.composer > textarea {
  min-height: 38px;
  max-height: 24vh;
  max-height: 24dvh;
  line-height: 1.5;
  overflow-y: auto;
  resize: none;
}
.composer > :disabled::placeholder { color: var(--muted); }

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.composer-toolbar > select {
  margin-inline-start: auto;
  max-width: 100%;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
}

.photo-tools { position: relative; flex: 0 0 auto; }

.photo-menu, .photo-note {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 8px);
  inset-inline-start: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--canvas);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
}

.photo-menu { width: max-content; padding: 4px; }

.photo-menu button, .photo-file-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: start;
  font-size: 14px;
}

.photo-file-choice { position: relative; }

.photo-file-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-menu button:hover, .photo-menu button:focus-visible,
.photo-file-choice:hover, .photo-file-choice:focus-within { background: var(--hover); }
.photo-menu svg { width: 18px; height: 18px; }
.photo-note { width: max-content; padding: 7px 10px; color: var(--error); font-size: 13px; }

.photo-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}

.photo-preview img { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 5px; object-fit: cover; }
.photo-preview div { min-width: 0; flex: 1; }
.photo-preview strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.photo-preview p { color: var(--muted); font-size: 12px; }
.photo-preview button { width: 28px; height: 28px; font-size: 20px; }

.camera-dialog, .chat-dialog {
  width: min(520px, calc(100% - 24px));
  padding: 16px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.camera-dialog::backdrop, .chat-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.camera-dialog h2 { font-size: 17px; }
.camera-dialog p { margin-top: 8px; color: var(--muted); }
.camera-dialog p:empty { display: none; }
.camera-dialog video { display: block; width: 100%; max-height: 60dvh; margin-top: 10px; border-radius: 8px; background: black; }
.camera-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.chat-dialog form { display: grid; gap: 9px; }
.chat-dialog h2 { font-size: 17px; }
.chat-dialog label, .chat-dialog p { color: var(--muted); overflow-wrap: anywhere; }
.chat-dialog .error-message, .chat-dialog .danger { color: var(--error); }
.chat-dialog .delete-chat-name { font-weight: 650; color: var(--ink); }
.chat-dialog .chat-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }

.task-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 0 2px;
  border-top: 1px solid var(--line);
}

.task-settings label { color: var(--muted); font-size: 12px; }
.task-settings select { display: block; margin-top: 5px; }

@media (max-width: 760px) {
  body { grid-template-columns: 48px minmax(0, 1fr); }
  .context-toggle { display: grid; }
  .context { display: none; }

  .context.is-open {
    position: fixed;
    display: flex;
    inset: 60px auto 0 48px;
    width: min(260px, calc(100vw - 60px));
    z-index: 1;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .14);
  }

  .context-brand { display: none; }
  .topbar { padding-inline: 9px; gap: 6px; }
  .topbar-heading { gap: 5px; }
}

@media (max-width: 480px) {
  .runner { display: none; }
  .history { scrollbar-gutter: auto; }
  .composer-area { padding-inline: 7px; }
  .composer > input, .composer > textarea, .project-form input { font-size: 16px; }
  .composer-toolbar { flex-wrap: nowrap; }
  #chatComposer .composer-toolbar > select { min-width: 0; flex: 0 1 auto; }
  .task-settings { gap: 8px; }
}

.work-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.work-actions .secondary { font-size: 13px; padding: 5px 10px; }
.work-actions button[aria-pressed="true"] { color: var(--canvas); background: var(--ink); border-color: var(--ink); }
.work-draft-options {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}
.work-draft-options label, .work-draft-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.work-draft-options :is(input, select), .work-draft-fields :is(input, textarea) { width: 100%; }
.work-draft { border: 1px solid var(--line); border-radius: 12px; padding: clamp(12px, 3vw, 20px); }
.work-draft h3 { font-size: 16px; }
.work-draft dl { margin-block: 14px; }
.work-draft dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.work-draft dd { margin: 3px 0 12px; white-space: pre-wrap; line-height: 1.55; }
.work-draft-fields { display: grid; gap: 9px; }
.work-draft-fields textarea { resize: vertical; min-height: 56px; }
#workDraftDialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }

@media (max-width: 480px) {
  .work-draft-options { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); }
  .work-draft-options .work-email-audience { grid-column: 1 / -1; }
  .work-draft-fields :is(input, select, textarea), .work-draft-options :is(input, select) { font-size: 16px; }
}

.work-draft-options[data-kind="incident"] { grid-template-columns: minmax(0, 160px); }

.work-draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; align-items: start; }
.work-draft-row > dt, .work-draft-row > dd:not(.work-copy-field) { grid-column: 1; }
.work-draft-row > .work-copy-field { grid-column: 2; grid-row: 1 / span 2; margin: -3px 0 0; text-align: end; }
.work-copy-field .chat-copy-feedback { display: block; max-width: 84px; }
.work-copy-field .chat-copy-feedback:empty { display: none; }
.work-draft-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.work-progress:empty { display: none; }
.work-progress { color: var(--muted); font-size: 13px; }

#projectSourceLabel { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
#projectSource { min-width: 0; width: 100%; }
#projectInstructions { font-size: 12px; }
.orchestration-list { display: grid; gap: 12px; }
.orchestration-steps { list-style: none; padding: 0; margin: 12px 0; }
.orchestration-steps li { border-top: 1px solid var(--line); font-size: 13px; }
.agent-step-toggle {
  display: grid;
  grid-template-columns: 17px max-content minmax(0, 1fr) max-content minmax(4ch, max-content);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 4px 6px;
  border-radius: 5px;
  text-align: left;
  color: var(--muted);
}
.agent-step-toggle:hover, .agent-step-toggle:focus-visible { background: var(--hover); }
.agent-step-toggle:hover, .agent-step-toggle[aria-expanded="true"] { color: var(--ink); }
.agent-step-terminal { display: flex; align-items: center; }
.agent-step-terminal svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.agent-step-name { font-size: 12px; white-space: nowrap; }
.agent-step-activity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-step-status, .agent-step-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.agent-step-status[data-state="failed"], .agent-step-status[data-state="blocked"] { color: var(--error); }
.agent-step-time { text-align: right; font-variant-numeric: tabular-nums; }
.agent-step-details { padding: 0 6px 7px 25px; }
.agent-step-details p { margin-block: 6px; white-space: pre-wrap; }
.orchestration-dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
#orchestrationPlanSteps { display: grid; gap: 12px; }
.orchestration-plan-step { min-width: 0; display: grid; gap: 6px; border: 1px solid var(--line);
  border-radius: 9px; padding: 10px; }
.orchestration-plan-step label { display: grid; gap: 3px; font-size: 13px; }
.orchestration-plan-step textarea { resize: vertical; }
.orchestration-plan-step button { justify-self: start; }
#orchestrationReviewDialog .task-log { max-height: 50dvh; }
#orchestrationChangedFiles { margin-block: 8px; overflow-wrap: anywhere; font-size: 13px; }
#orchestrationChangedFiles:empty { display: none; }

.agent-team {
  display: grid;
  grid-template-columns: repeat(8, minmax(76px, 1fr));
  gap: 6px;
  padding: 7px clamp(10px, 2.5vw, 27px) 9px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-bottom: 1px solid var(--line);
}
.agent-portrait {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  min-height: 82px;
  gap: 1px;
  padding: 3px 4px 5px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--ink);
}
.agent-portrait:disabled { opacity: 1; cursor: default; }
.agent-portrait:not(:disabled):hover, .agent-portrait:focus-visible { background: var(--soft); }
.agent-portrait.is-working { border-color: var(--line); background: var(--soft); }
.agent-portrait .team-atlas { width: 54px; height: 58px; }
.agent-portrait strong { font-size: 11px; white-space: nowrap; }
.agent-portrait-status { color: var(--muted); font-size: 10px; white-space: nowrap; }
.agent-portrait-time { color: var(--muted); font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.orchestration-steps li { scroll-margin-block-start: 10px; border-radius: 4px; }
.orchestration-steps li:focus { outline: 1px solid var(--line); outline-offset: 4px; }
.agent-inline-log { max-height: 260px; margin-top: 7px; padding: 10px; background: var(--soft); }
.preview-link { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }

@media (max-height: 580px) {
  .agent-team { padding-block: 4px; }
  .agent-portrait { min-height: 66px; }
  .agent-portrait .team-atlas { width: 40px; height: 42px; }
}
