/* E11-1.17 AI prescription auto-match and switch-protect overlay */
.e1117-hidden-rematch-action {
  display: none !important;
}

.e1117-ai-candidate-root .e1117-candidate-herb-name {
  min-width: 84px;
  max-width: 160px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #ffffff;
  color: #0f2f5f;
  font-weight: 700;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.e1117-ai-candidate-root .e1117-candidate-herb-name:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.e1117-ai-candidate-root .e1117-candidate-name-wrap {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 0 4px;
  vertical-align: middle;
}

.e1117-ai-candidate-root .e1117-auto-match-status {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.e1117-ai-candidate-root .e1117-auto-match-status.matched {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.e1117-ai-candidate-root .e1117-auto-match-status.matching {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.e1117-ai-candidate-root .e1117-auto-match-status.warning {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.e1117-switch-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(2px);
}

.e1117-switch-modal {
  width: min(520px, calc(100vw - 40px));
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
  border: 1px solid #dbeafe;
  padding: 22px 24px 20px;
  color: #0f2f5f;
}

.e1117-switch-modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
}

.e1117-switch-modal p {
  margin: 0;
  line-height: 1.7;
  color: #46617f;
  font-size: 14px;
}

.e1117-switch-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.e1117-switch-modal-actions button {
  min-width: 108px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 800;
  cursor: pointer;
}

.e1117-switch-modal-actions button[data-action="save"] {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.e1117-switch-modal-actions button[data-action="direct"] {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.e1117-right-rail-safe {
  contain: layout paint;
}
