.diagnostico-modal {
  width: min(100% - 2rem, 520px);
  max-height: min(90vh, 720px);
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  background: #fff;
  color: #1a1a1a;
}

.diagnostico-modal::backdrop {
  background: rgba(6, 95, 86, 0.45);
}

.diagnostico-modal__inner {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 720px);
}

.diagnostico-modal__head {
  flex: 0 0 auto;
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.diagnostico-modal__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 2rem 0 0;
  line-height: 1.3;
}

.diagnostico-modal__progress {
  font-size: 0.8rem;
  color: #5c5c5c;
  margin-top: 0.35rem;
}

.diagnostico-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #444;
  border-radius: 6px;
}

.diagnostico-modal__close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.diagnostico-modal__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.diagnostico-modal__foot {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
  border-radius: 0 0 12px 12px;
}

.diagnostico-modal__panel[hidden] {
  display: none !important;
}

.diagnostico-modal__q {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.diagnostico-modal__opts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.diagnostico-modal__opts label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 400;
  cursor: pointer;
  font-size: 0.92rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 2px solid #e2e8e6;
  border-radius: 8px;
  background: #fafcfb;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.diagnostico-modal__opts label:hover {
  border-color: #065f56;
  background: rgba(6, 95, 86, 0.07);
}

.diagnostico-modal__opts label:has(input:checked) {
  border-color: #065f56;
  background: rgba(6, 95, 86, 0.12);
  box-shadow: 0 0 0 1px rgba(6, 95, 86, 0.2);
}

.diagnostico-modal__opts label:has(input:focus-visible) {
  outline: 2px solid #065f56;
  outline-offset: 2px;
}

.diagnostico-modal__opts input[type='radio'] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #065f56;
  cursor: pointer;
  /* El tema global oculta los radio; forzar visibilad dentro del modal */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  vertical-align: middle;
}

.diagnostico-modal textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.diagnostico-modal .form-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.diagnostico-modal__result {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.55;
  max-height: 48vh;
  overflow: auto;
  padding: 0.75rem;
  background: #f4f7f6;
  border-radius: 8px;
  border: 1px solid rgba(6, 95, 86, 0.15);
}

.diagnostico-modal__msg {
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.diagnostico-modal__msg.is-error {
  color: #b42318;
}

.diagnostico-modal.is-busy .diagnostico-modal__foot button {
  pointer-events: none;
  opacity: 0.65;
}
