.interaction-mode-bar {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 8px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.interaction-mode-switch {
  padding: 3px;
  display: inline-flex;
  gap: 3px;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  background: #f3f5f6;
}

.interaction-mode-switch button,
.work-context-button,
.council-mode-button {
  min-height: 42px;
  border: 0;
  color: #52605b;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.interaction-mode-switch button {
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 10px;
}

.interaction-mode-switch button[aria-pressed="true"] {
  color: #fff;
  background: #12201d;
  box-shadow: 0 4px 12px rgba(18, 32, 29, 0.18);
}

.work-context-controls {
  min-width: 0;
  max-width: 55%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.council-mode-button {
  min-height: 40px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  color: #52605b;
  background: #fff;
  white-space: nowrap;
}

.council-provider-picker:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  flex-shrink: 0;
  min-width: 0;
  margin: 0;
  padding: 0.25rem 1rem;
  border: 0;
}

.council-provider-picker label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 36px;
}

.council-mode-button:hover,
.council-mode-button:focus-visible {
  border-color: #8aa99b;
  outline: none;
}

.council-mode-button[aria-pressed="true"] {
  color: #fff;
  border-color: #146b55;
  background: #146b55;
  box-shadow: 0 4px 12px rgba(20, 107, 85, 0.2);
}

.work-context-button {
  min-width: 0;
  padding: 4px 8px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.work-context-button:hover,
.work-context-button:focus-visible {
  border-color: #dfe3e8;
  background: #f6f7f7;
  outline: none;
}

.work-context-copy {
  min-width: 0;
  text-align: right;
}

.work-context-copy strong,
.work-context-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-context-copy strong {
  color: #17212b;
  font-size: 12px;
}

.work-context-copy small {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.work-manager-intro,
.work-storage-note {
  margin: 0 0 14px;
  padding: 13px 14px;
  border-radius: 13px;
  color: #475569;
  background: #f3f6f8;
  line-height: 1.45;
}

.work-save-notice,
.work-save-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 13px;
  color: #166534;
  background: #dcfce7;
  font-size: 13px;
  font-weight: 700;
}

.work-save-error {
  color: #991b1b;
  background: #fee2e2;
}

.work-storage-note {
  color: #7c4a03;
  background: #fff4d7;
  font-size: 12px;
}

.work-manager-section {
  margin: 0 0 20px;
}

.work-manager-section h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.work-choice-list {
  display: grid;
  gap: 8px;
}

.work-agent-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.work-agent-edit {
  min-width: 92px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  color: #0f5132;
  background: #f8faf9;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.work-choice-card {
  width: 100%;
  border: 1px solid #dfe3e8;
  color: #17212b;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.work-choice-card {
  padding: 13px 14px;
  border-radius: 13px;
}

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

.work-choice-card small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.work-choice-card.active {
  border-color: #278a52;
  box-shadow: 0 0 0 2px rgba(39, 138, 82, 0.12);
}

.work-manager-form {
  margin-top: 10px;
  padding: 13px;
  display: grid;
  gap: 8px;
  border: 1px solid #e4e7eb;
  border-radius: 14px;
  background: #fafbfb;
}

.work-manager-form h4 {
  margin: 0 0 3px;
  font-size: 15px;
}

.work-agent-edit-form {
  border-color: #86c89f;
  background: #f3fbf6;
}

.work-project-context-form {
  border-color: #9bc9b2;
  background: #f5fbf7;
}

.work-form-label {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 800;
}

.work-project-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.work-project-tools label {
  min-width: 0;
  padding: 8px 9px;
  display: flex;
  gap: 7px;
  align-items: center;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  background: #fff;
}

.work-project-tools input {
  width: auto;
  margin: 0;
}

.work-advanced-settings {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: #f8fafc;
}

.work-advanced-settings > summary {
  color: #475569;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.work-advanced-settings[open] > summary {
  margin-bottom: 10px;
}

.work-form-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}

.work-manager-form .work-form-cancel {
  color: #17212b;
  background: #e8edf0;
}

.work-manager-form label {
  font-size: 12px;
  font-weight: 800;
}

.work-manager-form input,
.work-manager-form textarea,
.work-manager-form select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #17212b;
  background: #fff;
  font: inherit;
}

@media (max-width: 520px) {
  .work-agent-choice {
    grid-template-columns: 1fr;
  }

  .work-agent-edit {
    width: 100%;
  }

  .work-project-tools {
    grid-template-columns: 1fr;
  }
}

.work-manager-form textarea {
  min-height: 84px;
  resize: vertical;
}

.work-manager-form button {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #12201d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.work-activity-list {
  display: grid;
  gap: 10px;
}

.work-activity-item {
  padding: 13px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  border: 1px solid rgba(18, 32, 29, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
}

.work-activity-item strong {
  color: #1b6f57;
  font-size: 13px;
}

.work-activity-item[data-status="needs-input"] strong,
.work-activity-item[data-status="blocked"] strong {
  color: #b24827;
}

.work-activity-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-activity-item small {
  grid-column: 2;
  color: #1b6f57;
  font-weight: 800;
}

@media (max-width: 900px) {
  .interaction-mode-bar {
    padding: 7px 12px 0;
  }

  .interaction-mode-switch button {
    min-height: 40px;
    padding: 7px 10px;
  }

  .work-context-controls {
    max-width: 58%;
  }
}

@media (max-width: 560px) {
  .interaction-mode-bar {
    gap: 5px;
  }

  .interaction-mode-switch button span,
.work-context-copy {
    display: none;
  }

  .interaction-mode-switch button {
    width: 42px;
    justify-content: center;
  }

  .work-context-controls {
    width: auto;
    max-width: none;
  }

  .work-context-button {
    padding-left: 6px;
  }

  .council-mode-button {
    width: 42px;
    justify-content: center;
    padding: 7px;
  }

  .council-mode-button span {
    display: none;
  }
}

.work-project-chat-controls,
.work-project-chat-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-project-chat-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.work-project-chat-action {
  min-height: 42px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid #c3d5cd;
  border-radius: 10px;
  background: #fff;
  color: #155a47;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.work-project-chat-controls > :first-child,
.work-project-chat-action[aria-current="true"] {
  border-color: #155a47;
  background: #155a47;
  color: #fff;
}

.work-project-chat-action:focus-visible {
  outline: 2px solid #155a47;
  outline-offset: 2px;
}
