/* Shared floating HIS Agent widget used by login, dashboard, and patient editor pages. */
:root {
  --his-agent-blue: #1d4ed8;
  --his-agent-blue-dark: #1e40af;
  --his-agent-cyan: #0891b2;
  --his-agent-green: #047857;
  --his-agent-amber: #b45309;
  --his-agent-red: #b42318;
  --his-agent-text: #172033;
  --his-agent-muted: #64748b;
  --his-agent-line: #d8e1ee;
  --his-agent-panel: #ffffff;
  --his-agent-soft: #f6f9fd;
}

.his-agent-launcher {
  position: fixed;
  right: 20px;
  top: 44%;
  z-index: 2147483647;
  display: grid;
  gap: 6px;
  width: 112px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
  color: var(--his-agent-blue-dark);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.his-agent-launcher strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.his-agent-launcher span {
  color: var(--his-agent-muted);
  font-size: 12px;
  line-height: 1.3;
}

.his-agent-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 2147483647;
  display: none;
  width: min(430px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 40px));
  min-width: 320px;
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
  color: var(--his-agent-text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  overflow: hidden;
  touch-action: none;
}

.his-agent-recovery-launcher {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 2147483647;
  display: grid;
  gap: 4px;
  min-width: 126px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.his-agent-recovery-launcher strong {
  font-size: 15px;
  line-height: 1.2;
}

.his-agent-recovery-launcher span {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.9;
}

.his-agent-recovery-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 2147483647;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

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

.his-agent-recovery-panel strong {
  display: block;
  margin-bottom: 8px;
  color: #1e40af;
}

.his-agent-recovery-panel p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.his-agent-recovery-panel button {
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eef6ff;
  color: #1e40af;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.his-agent-panel.open {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.his-agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 10px;
  background: #ffffff;
  border-top: 3px solid #dbeafe;
  border-bottom: 1px solid #eef2f7;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.his-agent-header:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.his-agent-drag-handle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: inherit;
  user-select: none;
  touch-action: none;
}

.his-agent-back-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.his-agent-back-button[hidden] {
  display: none !important;
}

.his-agent-back-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.his-agent-panel.dragging,
.his-agent-panel.resizing,
.his-agent-launcher.dragging {
  user-select: none;
}

.his-agent-panel.dragging {
  cursor: grabbing;
}

.his-agent-panel.resizing {
  cursor: nwse-resize;
}

.his-agent-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.his-agent-header-task-button {
  min-height: 32px;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  cursor: pointer;
}

.his-agent-header-task-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.his-agent-header-task-button[hidden] {
  display: none !important;
}

.his-agent-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: #111827;
}

.his-agent-subtitle {
  margin: 3px 0 0;
  color: var(--his-agent-muted);
  font-size: 12px;
}

.his-agent-icon-button {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
}

.his-agent-icon-button:hover {
  background: #f3f6ff;
  border-color: #dbe4ff;
}

.his-agent-reset-button {
  opacity: 0.45;
}

.his-agent-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 26px 16px;
  background: #ffffff;
  position: relative;
  scroll-behavior: smooth;
}

.his-agent-body.restoring-scroll {
  visibility: hidden;
  scroll-behavior: auto !important;
}

.his-agent-view[hidden] {
  display: none !important;
}

.his-agent-home-view,
.his-agent-chat-view,
.his-agent-status-view,
.his-agent-examples-view,
.his-agent-voice-view {
  min-height: 0;
  animation: his-agent-view-in 240ms ease-out;
}

.his-agent-chat-view,
.his-agent-status-view,
.his-agent-examples-view,
.his-agent-voice-view {
  display: grid;
  gap: 10px;
}

.his-agent-view-intro {
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.his-agent-soft-button,
.his-agent-card-button,
.his-agent-carousel-button {
  min-height: 32px;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1e3a8a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.his-agent-soft-button:hover,
.his-agent-card-button:hover,
.his-agent-carousel-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.his-agent-soft-button:active,
.his-agent-card-button:active,
.his-agent-carousel-button:active {
  transform: translateY(1px);
}

@keyframes his-agent-view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.his-agent-status {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
}

.his-agent-status[hidden],
.his-agent-connection-row[hidden],
.his-agent-compat-actions[hidden] {
  display: none !important;
}

.his-agent-task {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  background: #f0f9ff;
  color: #0c4a6e;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.his-agent-current-card {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.1);
  backdrop-filter: blur(8px);
  opacity: 1;
  transform: scale(1);
  transition: opacity 240ms ease, transform 240ms ease, max-height 260ms ease;
}

.his-agent-current-card[hidden] {
  display: none;
}

.his-agent-current-card.recent {
  border-color: #bbf7d0;
  background: #fbfefc;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.08);
}

.his-agent-current-card.recent .his-agent-current-title {
  color: #047857;
}

.his-agent-current-card.minimized {
  padding: 8px 10px;
  gap: 0;
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.08);
}

.his-agent-current-compact,
.his-agent-current-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.his-agent-current-head {
  justify-content: space-between;
}

.his-agent-current-compact strong {
  min-width: 0;
  overflow: hidden;
  color: #12335f;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.his-agent-current-compact-title,
.his-agent-current-compact-meta {
  flex: 0 0 auto;
  color: var(--his-agent-muted);
  font-size: 11px;
  font-weight: 800;
}

.his-agent-current-compact-error {
  flex: 1 1 100%;
  min-width: 100%;
  color: #b42318;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.his-agent-link-button {
  flex: 0 0 auto;
  min-height: 26px;
  border: 1px solid #dbe4ff;
  border-radius: 7px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
}

.his-agent-link-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.his-agent-panel.is-planning-task .his-agent-current-card,
.his-agent-panel.has-active-task .his-agent-current-card {
  min-height: 0;
}

.his-agent-current-title,
.his-agent-task-list-title {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.his-agent-current-main {
  color: #12335f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.his-agent-current-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-current-meta span {
  padding: 2px 6px;
  border: 1px solid var(--his-agent-line);
  border-radius: 999px;
  background: #f8fafc;
}

.his-agent-current-error {
  padding: 6px 8px;
  border: 1px solid #fda29b;
  border-radius: 6px;
  background: #fff1f0;
  color: var(--his-agent-red);
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-current-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.his-agent-button.danger {
  border-color: #fecaca;
  background: #fff1f0;
  color: #b42318;
}

.his-agent-button.danger:hover {
  background: #fee2e2;
}

.his-agent-current-narration {
  padding: 7px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.5;
}

.his-agent-current-steps {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.his-agent-current-steps summary {
  min-height: 30px;
  padding: 6px 9px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.his-agent-current-steps[open] .his-agent-task-list {
  max-height: min(240px, 38vh);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 8px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.his-agent-home {
  display: grid;
  gap: 22px;
  opacity: 1;
  transform: translateY(0);
  max-height: 440px;
  overflow: hidden;
  transition: opacity 260ms ease, transform 260ms ease, max-height 280ms ease;
}

.his-agent-panel.his-agent-view-chat .his-agent-home {
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  pointer-events: none;
}

.his-agent-greeting {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.his-agent-mark {
  width: 46px;
  height: 46px;
  color: #6d5dfc;
  font-size: 58px;
  line-height: 46px;
  font-weight: 900;
}

.his-agent-greeting h3 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
}

.his-agent-greeting h3 span {
  color: #5b6ee1;
}

.his-agent-greeting p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.his-agent-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.his-agent-open-chat-button {
  min-width: 132px;
}

.his-agent-topic-carousel {
  display: grid;
  gap: 12px;
  padding: 2px;
}

.his-agent-topic-viewport {
  overflow: hidden;
  width: 100%;
  padding: 6px;
  margin: -6px;
}

.his-agent-topic-track {
  display: flex;
  gap: 14px;
  width: 100%;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.his-agent-topic-track.no-transition {
  transition: none;
}

.his-agent-topic-card {
  display: grid;
  flex: 0 0 calc((100% - 14px) / 2);
  gap: 12px;
  min-height: 124px;
  padding: 18px;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  color: #172033;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.his-agent-topic-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.his-agent-topic-card:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(30, 64, 175, 0.1);
}

.his-agent-topic-card strong {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
}

.his-agent-topic-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-topic-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 2px;
  overflow: visible;
}

.his-agent-topic-nav-button {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  outline-offset: 3px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.his-agent-topic-nav-button.primary {
  border-color: #e5e7eb;
  background: #ffffff;
  color: #64748b;
}

.his-agent-topic-nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.his-agent-topic-nav-button:active:not(:disabled) {
  transform: translateY(1px);
  background: #1d4ed8;
  color: #ffffff;
}

.his-agent-topic-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.his-agent-connection-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.his-agent-connection-row span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.his-agent-connection-chip {
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--his-agent-line);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
}

.his-agent-connection-chip strong {
  font-weight: 800;
}

.his-agent-connection-chip em {
  font-style: normal;
  color: var(--his-agent-muted);
}

.his-agent-connection-chip.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.his-agent-connection-chip.connected em {
  color: var(--his-agent-green);
}

.his-agent-connection-chip.warning,
.his-agent-connection-chip.checking {
  border-color: #fed7aa;
  background: #fff7ed;
}

.his-agent-connection-chip.warning em,
.his-agent-connection-chip.checking em {
  color: #92400e;
}

.his-agent-connection-chip.disconnected {
  border-color: #fda29b;
  background: #fff1f0;
}

.his-agent-connection-chip.disconnected em {
  color: var(--his-agent-red);
}

.his-agent-service-diagnostics {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.his-agent-service-diagnostic-row {
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--his-agent-line);
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.his-agent-service-diagnostic-row code {
  overflow-wrap: anywhere;
  color: #1e3a8a;
}

.his-agent-service-diagnostic-row em {
  color: var(--his-agent-red);
  font-style: normal;
}

.his-agent-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.his-agent-tabs button {
  min-height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.his-agent-tabs button.active {
  border-color: #1d4ed8;
  background: #dbeafe;
  color: #1e3a8a;
}

.his-agent-module-tabs {
  display: none;
}

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

.his-agent-section-title {
  margin: 12px 0 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.his-agent-history,
.his-agent-turns {
  display: grid;
  gap: 9px;
}

.his-agent-history {
  max-height: none;
  overflow: visible;
  padding-right: 2px;
  margin-top: 4px;
}

.his-agent-new-messages {
  position: sticky;
  z-index: 2;
  bottom: 8px;
  justify-self: center;
  min-height: 32px;
  margin: 8px auto 0;
  padding: 6px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  cursor: pointer;
}

.his-agent-new-messages[hidden] {
  display: none !important;
}

.his-agent-new-messages:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.his-agent-chat-view .his-agent-history {
  min-height: 120px;
  align-content: start;
}

.his-agent-panel.topic-response-mode:not(.has-active-task):not(.is-planning-task) .his-agent-history {
  align-content: start;
}

.his-agent-panel.has-active-task .his-agent-history,
.his-agent-panel.is-planning-task .his-agent-history {
  max-height: none;
}

.his-agent-message,
.his-agent-turn {
  border: 1px solid var(--his-agent-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.his-agent-post-voice-actions[hidden] {
  display: none !important;
}

.his-agent-message.user {
  justify-self: end;
  max-width: 82%;
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1e3a8a;
}

.his-agent-message.agent {
  justify-self: start;
  max-width: 90%;
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.his-agent-message.system {
  justify-self: start;
  max-width: 90%;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #7c2d12;
}

.his-agent-message.error {
  border-color: #fda29b;
  background: #fff1f0;
  color: var(--his-agent-red);
}

.his-agent-message.progress {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
}

.his-agent-message-topic-card,
.his-agent-message-connection-status {
  border-color: #dbe4ff;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(30, 64, 175, 0.08);
}

.his-agent-message-topic-command {
  max-width: 72%;
  margin-left: auto;
}

.his-agent-connection-title {
  color: #172033;
  font-size: 16px;
  font-weight: 800;
}

.his-agent-connection-hint {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.his-agent-connection-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.his-agent-connection-topic-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.his-agent-connection-topic-row strong {
  color: #334155;
  font-size: 12px;
}

.his-agent-connection-topic-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.his-agent-connection-topic-row.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.his-agent-connection-topic-row.connected span {
  color: #047857;
}

.his-agent-connection-topic-row.checking,
.his-agent-connection-topic-row.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.his-agent-connection-topic-row.checking span,
.his-agent-connection-topic-row.warning span {
  color: #b45309;
}

.his-agent-connection-topic-row.disconnected {
  border-color: #fecaca;
  background: #fff1f0;
}

.his-agent-connection-topic-row.disconnected span {
  color: #b42318;
}

.his-agent-connection-error {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.5;
}

.his-agent-status-panel {
  display: grid;
  gap: 12px;
}

.his-agent-status-hint,
.his-agent-voice-session-summary {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

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

.his-agent-status-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(80px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.his-agent-status-row strong {
  color: #172033;
  font-size: 12px;
}

.his-agent-status-row span {
  font-size: 12px;
  font-weight: 800;
}

.his-agent-status-row small {
  color: #64748b;
  font-size: 11px;
  text-align: right;
}

.his-agent-status-row.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.his-agent-status-row.connected span {
  color: #047857;
}

.his-agent-status-row.warning,
.his-agent-status-row.checking {
  border-color: #fed7aa;
  background: #fff7ed;
}

.his-agent-status-row.warning span,
.his-agent-status-row.checking span {
  color: #b45309;
}

.his-agent-status-row.disconnected {
  border-color: #fecaca;
  background: #fff1f0;
}

.his-agent-status-row.disconnected span {
  color: #b42318;
}

.his-agent-developer-foldout {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.his-agent-developer-foldout summary {
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.his-agent-example-grid {
  display: grid;
  gap: 10px;
}

.his-agent-example-card {
  display: grid;
  gap: 7px;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid #edf2ff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(30, 64, 175, 0.08);
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.his-agent-example-card:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 34px rgba(30, 64, 175, 0.14);
}

.his-agent-example-card strong {
  color: #4f63d9;
  font-size: 14px;
}

.his-agent-example-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-message-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  white-space: normal;
}

.his-agent-message-topic-card .his-agent-message-actions,
.his-agent-message-connection-status .his-agent-message-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.his-agent-message-actions .his-agent-button {
  justify-content: center;
  min-height: 34px;
}

.his-agent-voice-task-title {
  margin-top: 8px;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.his-agent-voice-task-editor {
  width: 100%;
  min-height: 84px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.his-agent-voice-task-editor:focus {
  border-color: #3b63ff;
  box-shadow: 0 0 0 3px rgba(59, 99, 255, 0.12);
  outline: none;
}

.his-agent-voice-task-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-message-detail {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
  white-space: normal;
}

.his-agent-message-detail summary,
.his-agent-task-history-item summary {
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.his-agent-message-detail pre,
.his-agent-developer-details,
.his-agent-task-history-item pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.his-agent-task-detail-panel {
  margin-top: 9px;
}

.his-agent-history-link-row {
  margin: 8px 0 10px;
}

.his-agent-history-link-row .his-agent-button {
  width: 100%;
}

.his-agent-current-step {
  margin-top: 7px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-step-details,
.his-agent-task-history-list {
  display: grid;
  gap: 7px;
}

.his-agent-task-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.his-agent-task-item {
  border: 1px solid var(--his-agent-line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.his-agent-task-item.running {
  border-color: #93c5fd;
  box-shadow: inset 3px 0 0 var(--his-agent-blue);
}

.his-agent-task-item.current-step {
  border-color: #8b5cf6;
  box-shadow: inset 3px 0 0 #8b5cf6, 0 0 0 1px rgba(139, 92, 246, 0.14), 0 10px 22px rgba(59, 130, 246, 0.12);
}

.his-agent-task-item.agent-step-pulse {
  animation: his-agent-current-step-pulse 1.4s ease-in-out infinite;
}

@keyframes his-agent-current-step-pulse {
  0% {
    box-shadow: inset 3px 0 0 #8b5cf6, 0 0 0 0 rgba(99, 102, 241, 0.18), 0 10px 22px rgba(59, 130, 246, 0.10);
  }
  50% {
    box-shadow: inset 3px 0 0 #2563eb, 0 0 0 5px rgba(99, 102, 241, 0.10), 0 12px 24px rgba(59, 130, 246, 0.16);
  }
  100% {
    box-shadow: inset 3px 0 0 #8b5cf6, 0 0 0 0 rgba(99, 102, 241, 0.18), 0 10px 22px rgba(59, 130, 246, 0.10);
  }
}

@media (prefers-reduced-motion: reduce) {
  .his-agent-task-item.agent-step-pulse {
    animation: none;
  }
}

.his-agent-task-item.completed {
  border-color: #bbf7d0;
  box-shadow: inset 3px 0 0 var(--his-agent-green);
}

.his-agent-task-item.failed {
  border-color: #fda29b;
  box-shadow: inset 3px 0 0 var(--his-agent-red);
}

.his-agent-task-item.waiting_user {
  border-color: #fed7aa;
  box-shadow: inset 3px 0 0 var(--his-agent-amber);
}

.his-agent-task-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  cursor: pointer;
  list-style: none;
}

.his-agent-task-row::-webkit-details-marker {
  display: none;
}

.his-agent-status-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.his-agent-status-mark.completed {
  background: #dcfce7;
  color: var(--his-agent-green);
}

.his-agent-status-mark.running {
  background: #dbeafe;
  color: var(--his-agent-blue-dark);
}

.his-agent-status-mark.failed {
  background: #fff1f0;
  color: var(--his-agent-red);
}

.his-agent-status-mark.waiting_user {
  background: #fff7ed;
  color: var(--his-agent-amber);
}

.his-agent-task-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.his-agent-task-copy strong {
  color: #172033;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.his-agent-task-copy span {
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-task-copy .his-agent-task-error {
  color: var(--his-agent-red);
  font-weight: 700;
}

.his-agent-task-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: 36px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-task-meta > span {
  padding: 2px 6px;
  border: 1px solid var(--his-agent-line);
  border-radius: 999px;
  background: #f8fafc;
}

.his-agent-status-pill.completed {
  color: var(--his-agent-green);
}

.his-agent-status-pill.running {
  color: var(--his-agent-blue-dark);
}

.his-agent-status-pill.failed {
  color: var(--his-agent-red);
}

.his-agent-status-pill.waiting_user {
  color: var(--his-agent-amber);
}

.his-agent-task-detail {
  display: grid;
  gap: 8px;
  padding: 0 9px 9px 45px;
}

.his-agent-task-detail-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-task-detail-grid strong {
  color: #334155;
  font-weight: 700;
  word-break: break-word;
}

.his-agent-task-detail pre {
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.his-agent-step-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--his-agent-line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.his-agent-step-row.completed strong {
  color: var(--his-agent-green);
}

.his-agent-step-row.failed strong {
  color: var(--his-agent-red);
}

.his-agent-step-row.running strong {
  color: var(--his-agent-blue-dark);
}

.his-agent-empty-detail {
  color: var(--his-agent-muted);
  font-size: 12px;
}

.his-agent-task-history-item {
  padding: 7px 8px;
  border: 1px solid var(--his-agent-line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.his-agent-task-history-meta {
  margin-top: 6px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-voice-status-card {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
  padding: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
}

.his-agent-voice-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.his-agent-voice-notice,
.his-agent-voice-mode-note,
.his-agent-draft-note {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-voice-mode-note {
  color: #64748b;
}

.his-agent-voice-dev-summary {
  color: #64748b;
  font-size: 12px;
}

.his-agent-voice-dev-summary summary {
  cursor: pointer;
  color: #475569;
  font-weight: 700;
}

.his-agent-manual-transcript {
  width: 100%;
  min-height: 76px;
  margin: 9px 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--his-agent-text);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}

.his-agent-voice-draft {
  margin: 9px 0;
}

.his-agent-clinical-draft-meta {
  margin: 6px 0 8px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.his-agent-voice-debug-panel {
  margin-top: 9px;
}

.his-agent-voice-debug {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.his-agent-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.his-agent-role-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
}

.his-agent-turn.patient .his-agent-role-label {
  background: #dcfce7;
  color: #166534;
}

.his-agent-turn.doctor {
  border-color: #bfdbfe;
  background: #f8fbff;
  margin-right: 20px;
}

.his-agent-turn.patient {
  border-color: #bbf7d0;
  background: #f7fef9;
  margin-left: 20px;
}

.his-agent-turn.unknown {
  border-style: dashed;
  background: #f8fafc;
}

.his-agent-turn.provisional {
  border-style: dashed;
  opacity: 0.86;
}

.his-agent-turn select {
  min-height: 28px;
  border: 1px solid var(--his-agent-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--his-agent-text);
  font: inherit;
  font-size: 12px;
}

.his-agent-meta {
  margin-top: 5px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-meta-details {
  margin-top: 7px;
  color: var(--his-agent-muted);
  font-size: 11px;
}

.his-agent-meta-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.his-agent-meta-details[open] .his-agent-meta {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.his-agent-controls {
  display: grid;
  gap: 8px;
  padding: 10px 18px 12px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}

.his-agent-controls label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.his-agent-controls textarea,
.his-agent-settings input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--his-agent-text);
  font: inherit;
}

.his-agent-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  touch-action: none;
}

.his-agent-resize-handle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
}

.his-agent-controls textarea {
  min-height: 48px;
  max-height: 104px;
  resize: none;
  overflow-y: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.his-agent-controls textarea:focus,
.his-agent-settings input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 10px 26px rgba(15, 23, 42, 0.06);
  outline: none;
}

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

.his-agent-controls > .his-agent-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.his-agent-controls > .his-agent-actions .his-agent-button {
  justify-content: center;
  padding: 7px 8px;
  white-space: nowrap;
}

.his-agent-button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 12px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.his-agent-button.primary {
  border-color: #5b6ee1;
  background: linear-gradient(135deg, #2563eb 0%, #6d5dfc 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.his-agent-button.secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1f2937;
}

.his-agent-button.secondary:hover:not(:disabled) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.his-agent-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: progress;
}

.his-agent-button.is-loading:disabled {
  opacity: 0.78;
}

.his-agent-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: his-agent-spin 720ms linear infinite;
}

@keyframes his-agent-spin {
  to {
    transform: rotate(360deg);
  }
}

.his-agent-button.primary:hover:not(:disabled) {
  border-color: #4f46e5;
  background: linear-gradient(135deg, #1d4ed8 0%, #5b4df2 100%);
}

.his-agent-button.primary.danger {
  border-color: #ef4444;
  background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.18);
}

.his-agent-button.primary.danger:hover:not(:disabled) {
  border-color: #dc2626;
  background: linear-gradient(135deg, #b91c1c 0%, #ea580c 100%);
}

.his-agent-button.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--his-agent-amber);
}

.his-agent-settings {
  display: none;
}

.his-agent-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
.btn,
.button-link,
.nav-item,
[data-his-entry],
.his-agent-button,
.his-agent-icon-button,
.his-agent-topic-card,
.his-agent-topic-nav-button,
.his-agent-example-card,
.summary-card,
.module-card {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

button:hover:not(:disabled),
.btn:hover,
.button-link:hover,
.nav-item:hover,
[data-his-entry]:hover,
.his-agent-button:hover:not(:disabled),
.his-agent-topic-card:hover,
.his-agent-example-card:hover,
.module-card:hover {
  transform: translateY(-1px);
}

button:active:not(:disabled),
.btn:active,
.button-link:active,
.nav-item:active,
[data-his-entry]:active,
.his-agent-button:active:not(:disabled),
.his-agent-topic-card:active,
.his-agent-example-card:active {
  transform: translateY(0);
  filter: saturate(1.08);
}

button:focus-visible,
.btn:focus-visible,
.button-link:focus-visible,
.nav-item:focus-visible,
[data-his-entry]:focus-visible,
.his-agent-button:focus-visible,
.his-agent-icon-button:focus-visible,
.his-agent-topic-card:focus-visible,
.his-agent-example-card:focus-visible {
  outline: 3px solid rgba(59, 99, 255, 0.28);
  outline-offset: 2px;
}

.his-agent-settings {
  display: none !important;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--his-agent-line);
  border-radius: 8px;
  background: #f8fafc;
}

.his-agent-settings summary {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 760px) {
  .his-agent-launcher {
    right: 10px;
    top: auto;
    bottom: 18px;
  }

  .his-agent-panel {
    right: 8px;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: auto;
  }
}

.his-ui-flash {
  position: relative;
  z-index: 1;
  animation: his-ui-flash-agent 1400ms ease-out;
}

.agent-action-target {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.agent-action-clicking {
  transform: translateY(1px) scale(0.99);
  filter: saturate(1.08);
}

.agent-field-editing {
  border-color: #2563eb !important;
  background-image: linear-gradient(90deg, rgba(219, 234, 254, 0.7), rgba(240, 249, 255, 0.35));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), inset 0 0 0 999px rgba(239, 246, 255, 0.22);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.agent-field-changed {
  animation: agent-field-changed 1500ms ease-out;
}

.agent-field-saved,
.agent-save-pulse {
  animation: agent-save-pulse 1400ms ease-out;
}

.agent-row-highlight {
  animation: agent-row-highlight 1600ms ease-out;
}

.his-ui-flash-change {
  animation-name: his-ui-flash-change;
}

.his-ui-flash-verify {
  animation-name: his-ui-flash-verify;
}

.his-ui-pulse {
  animation: his-ui-pulse 900ms ease-out;
}

.his-agent-action-toast {
  position: fixed;
  right: 24px;
  bottom: 112px;
  z-index: 2147483646;
  max-width: min(360px, calc(100vw - 48px));
  padding: 10px 13px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  color: #12335f;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.his-agent-action-toast[data-type="success"],
.agent-action-toast[data-type="success"] {
  border-color: #86efac;
  background: #ecfdf5;
  color: #065f46;
}

.his-agent-action-toast[data-type="warning"],
.agent-action-toast[data-type="warning"] {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.his-agent-action-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes his-ui-flash-agent {
  0% { box-shadow: 0 0 0 0 rgba(59, 99, 255, 0.34), inset 0 0 0 999px rgba(219, 234, 254, 0.52); }
  100% { box-shadow: 0 0 0 12px rgba(59, 99, 255, 0), inset 0 0 0 999px rgba(219, 234, 254, 0); }
}

@keyframes his-ui-flash-change {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.34), inset 0 0 0 999px rgba(220, 252, 231, 0.68); }
  100% { box-shadow: 0 0 0 12px rgba(4, 120, 87, 0), inset 0 0 0 999px rgba(220, 252, 231, 0); }
}

@keyframes his-ui-flash-verify {
  0% { box-shadow: 0 0 0 0 rgba(180, 83, 9, 0.3), inset 0 0 0 999px rgba(254, 243, 199, 0.62); }
  100% { box-shadow: 0 0 0 12px rgba(180, 83, 9, 0), inset 0 0 0 999px rgba(254, 243, 199, 0); }
}

@keyframes his-ui-pulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 99, 255, 0.28); }
  100% { box-shadow: 0 0 0 10px rgba(59, 99, 255, 0); }
}

@keyframes agent-field-changed {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.34), inset 0 0 0 999px rgba(220, 252, 231, 0.72); }
  55% { box-shadow: 0 0 0 9px rgba(4, 120, 87, 0.08), inset 0 0 0 999px rgba(220, 252, 231, 0.28); }
  100% { box-shadow: 0 0 0 14px rgba(4, 120, 87, 0), inset 0 0 0 999px rgba(220, 252, 231, 0); }
}

@keyframes agent-save-pulse {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.35), inset 0 0 0 999px rgba(220, 252, 231, 0.65); }
  45% { transform: scale(1.01); box-shadow: 0 0 0 10px rgba(4, 120, 87, 0.08), inset 0 0 0 999px rgba(220, 252, 231, 0.3); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(4, 120, 87, 0), inset 0 0 0 999px rgba(220, 252, 231, 0); }
}

@keyframes agent-row-highlight {
  0% { background: #eff6ff; box-shadow: inset 4px 0 0 #2563eb, 0 0 0 0 rgba(37, 99, 235, 0.24); }
  60% { background: #ecfdf5; box-shadow: inset 4px 0 0 #10b981, 0 0 0 8px rgba(16, 185, 129, 0.08); }
  100% { background: transparent; box-shadow: inset 4px 0 0 rgba(16, 185, 129, 0), 0 0 0 12px rgba(16, 185, 129, 0); }
}

  @media (prefers-reduced-motion: reduce) {
  button,
  .btn,
  .button-link,
  .nav-item,
  [data-his-entry],
  .his-agent-button,
  .his-agent-topic-card,
  .his-agent-topic-nav-button,
  .his-agent-example-card,
  .module-card,
  .his-agent-action-toast {
    transition: none;
  }

  .his-ui-flash,
  .his-ui-pulse,
  .agent-field-changed,
  .agent-field-saved,
  .agent-row-highlight,
  .agent-save-pulse {
    animation-duration: 1ms;
  }
}
