.nav-group-agent button {
  color: #d9f6ee;
  border: 1px solid rgba(111, 224, 196, .18);
  background: linear-gradient(135deg, rgba(54, 170, 143, .18), rgba(255, 255, 255, .04));
}

.agent-step {
  border-color: rgba(13, 106, 95, .3);
  background: linear-gradient(145deg, rgba(249, 255, 253, .96), rgba(236, 247, 243, .9));
}

.agent-step .step-number {
  background: linear-gradient(145deg, #0d6a5f, #083f3a);
}

.agent-heading-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.agent-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(13, 106, 95, .2);
  border-radius: 999px;
  color: #0a5d53;
  background: #edf8f5;
  font: 700 11px/1 system-ui, sans-serif;
}

.agent-status-chip::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0d8b72;
  content: "";
}

.agent-status-chip.offline {
  color: #8a601c;
  border-color: rgba(183, 134, 47, .28);
  background: #fff7e5;
}

.agent-status-chip.offline::before {
  background: #b7862f;
}

.agent-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(8, 74, 67, .08);
}

.agent-mode-tabs button {
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #526562;
  background: transparent;
  cursor: pointer;
  font: 700 13px/1.2 system-ui, sans-serif;
}

.agent-mode-tabs button[aria-selected="true"] {
  color: #084a43;
  border-color: rgba(13, 106, 95, .18);
  background: #fff;
  box-shadow: 0 5px 18px rgba(31, 54, 51, .08);
}

.agent-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .65fr);
  gap: 12px;
  margin-top: 12px;
}

.agent-chat,
.agent-observer {
  min-width: 0;
  border: 1px solid rgba(20, 44, 43, .13);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 34px rgba(31, 54, 51, .07);
}

.agent-chat {
  overflow: hidden;
}

.agent-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 390px;
  max-height: 590px;
  padding: 16px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.agent-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.75 system-ui, sans-serif;
}

.agent-message.user {
  justify-self: end;
  color: #fff;
  border-bottom-right-radius: 4px;
  background: #0d6a5f;
}

.agent-message.assistant {
  justify-self: start;
  color: #243d3a;
  border: 1px solid #dce7e3;
  border-bottom-left-radius: 4px;
  background: #f7fbfa;
}

.agent-message.assistant[data-source]::before {
  display: block;
  margin-bottom: 5px;
  color: #197264;
  content: attr(data-source);
  font: 700 10px/1.4 system-ui, sans-serif;
  letter-spacing: .02em;
}

.agent-message.assistant.streaming::after {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  background: #0d6a5f;
  animation: agent-cursor .8s steps(1) infinite;
  content: "";
}

.agent-message.notice {
  max-width: 100%;
  color: #5c706c;
  border: 1px dashed #cbd9d5;
  background: #fff;
}

.agent-navigation-card {
  display: grid;
  gap: 7px;
  max-width: 92%;
  padding: 12px;
  border: 1px solid rgba(183, 134, 47, .28);
  border-radius: 12px;
  background: #fff9eb;
  font: 12px/1.55 system-ui, sans-serif;
}

.agent-navigation-card strong {
  color: #745317;
}

.agent-navigation-card button {
  justify-self: start;
}

.agent-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 12px;
}

.agent-quick-prompts button,
.agent-entry-button {
  padding: 7px 10px;
  border: 1px solid rgba(13, 106, 95, .2);
  border-radius: 999px;
  color: #0b5a51;
  background: #edf7f4;
  cursor: pointer;
  font: 700 11px/1 system-ui, sans-serif;
}

.agent-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e1e8e5;
  background: #fbfcfb;
}

.agent-composer textarea {
  min-height: 82px;
  max-height: 180px;
  resize: vertical;
}

.agent-composer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  color: #70817e;
  font: 10px/1.55 system-ui, sans-serif;
}

.agent-observer {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.agent-observer h3 {
  margin: 0;
  font-size: 15px;
}

.agent-run-status {
  padding: 10px;
  border-radius: 10px;
  color: #31514c;
  background: #edf7f4;
  font: 12px/1.55 system-ui, sans-serif;
}

.agent-trace {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-trace li {
  position: relative;
  padding: 9px 9px 9px 30px;
  border-radius: 9px;
  color: #5a6f6b;
  background: #f6f8f7;
  font: 11px/1.5 system-ui, sans-serif;
}

.agent-trace li::before {
  position: absolute;
  left: 10px;
  top: 11px;
  width: 10px;
  height: 10px;
  border: 2px solid #8cb9b0;
  border-radius: 50%;
  content: "";
}

.agent-trace li.done::before {
  border-color: #0d8b72;
  background: #0d8b72;
}

.agent-trace li.running::before {
  border-color: #b7862f;
  animation: agent-pulse 1s ease-in-out infinite;
}

.agent-boundary {
  padding: 11px;
  border-left: 3px solid #b7862f;
  border-radius: 0 9px 9px 0;
  color: #6f5b36;
  background: #fff8e9;
  font: 11px/1.6 system-ui, sans-serif;
}

.agent-entry-button {
  float: right;
  margin: -3px 0 8px 10px;
}

.agent-target-highlight {
  position: relative;
  z-index: 2;
  outline: 4px solid rgba(241, 200, 110, .72);
  outline-offset: 4px;
  animation: agent-highlight 1.1s ease-in-out 3;
}

@keyframes agent-cursor {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes agent-pulse {
  50% { transform: scale(1.25); }
}

@keyframes agent-highlight {
  50% { outline-color: rgba(13, 106, 95, .72); }
}

@media (max-width: 1050px) {
  .agent-workbench { grid-template-columns: 1fr; }
  .agent-messages { min-height: 330px; }
}

@media (max-width: 700px) {
  .agent-mode-tabs,
  .agent-composer { grid-template-columns: 1fr; }
  .agent-composer-actions { flex-direction: row; }
  .agent-message { max-width: 96%; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-message.assistant.streaming::after,
  .agent-trace li.running::before,
  .agent-target-highlight { animation: none; }
}
