.appt-ai-wrapper {
  margin-top: 24px;
  max-width: 100%;
}

.appt-ai-section {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  color: #172033;
  max-width: 100%;
  overflow: hidden;
}

.appt-ai-section h3,
.appt-ai-section h4 {
  margin-top: 0;
  color: #0f1f38;
}

.appt-ai-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  margin: 0 0 8px;
}

.appt-ai-question,
.appt-ai-context,
.appt-ai-scenario-step,
.appt-ai-complete {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  max-width: 100%;
  overflow: hidden;
}

.appt-ai-options,
.appt-ai-scenario-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  max-width: 100%;
}

/* Quiz option cards */
.appt-ai-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.appt-ai-option:hover {
  background: #eef4ff;
  border-color: #bcd2ff;
  transform: translateY(-1px);
}

.appt-ai-option input {
  margin-top: 4px;
}

.appt-ai-option span {
  color: #172033;
  font-weight: 600;
  line-height: 1.4;
}

/* Feedback */
.appt-ai-feedback,
.appt-ai-scenario-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  display: none;
  line-height: 1.5;
}

.appt-ai-feedback.correct,
.appt-ai-scenario-feedback.best {
  display: block;
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.appt-ai-scenario-feedback.good {
  display: block;
  background: #eff6ff;
  border: 1px solid #3b82f6;
  color: #1e3a8a;
}

.appt-ai-feedback.incorrect,
.appt-ai-feedback.unanswered,
.appt-ai-scenario-feedback.warn {
  display: block;
  background: #fff7ed;
  border: 1px solid #f59e0b;
  color: #7c2d12;
}

.appt-ai-scenario-feedback.risk {
  display: block;
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #7f1d1d;
}

/* Actions */
.appt-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.appt-ai-primary,
.appt-ai-secondary,
.appt-ai-scenario-option {
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}

.appt-ai-primary {
  border: 0;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  color: #ffffff;
}

.appt-ai-primary:hover {
  opacity: 0.9;
}

.appt-ai-secondary {
  border: 0;
  background: #e5e7eb;
  color: #172033;
}

.appt-ai-secondary:hover {
  background: #d1d5db;
}

.appt-ai-score {
  font-weight: 700;
  color: #172033;
}

/* Scenario dashboard */
.appt-ai-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  max-width: 100%;
}

.appt-ai-dashboard div {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.appt-ai-dashboard span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.appt-ai-dashboard strong {
  font-size: 18px;
  color: #172033;
}

/* Scenario */
.appt-ai-scenario-box {
  margin-top: 16px;
  max-width: 100%;
  overflow: hidden;
}

.appt-ai-scenario-option {
  width: 100%;
  max-width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  color: #172033;
  white-space: normal;
  transition: all 0.2s ease;
}

.appt-ai-scenario-option:hover:not(:disabled) {
  background: #eef4ff;
  border-color: #bcd2ff;
  transform: translateY(-1px);
}

.appt-ai-scenario-option.selected {
  border-color: #2563eb;
  background: #eef4ff;
}

.appt-ai-scenario-option:disabled {
  opacity: 0.7;
  cursor: default;
}

.appt-ai-scenario-option strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #172033;
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0.01em;
}

.appt-ai-scenario-option small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #5b6b82;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Hard containment against theme overrides */
.appt-ai-wrapper *,
.appt-ai-section *,
.appt-ai-scenario-box *,
.appt-ai-scenario-step * {
  max-width: 100%;
}

@media (max-width: 760px) {
  .appt-ai-dashboard {
    grid-template-columns: 1fr;
  }

  .appt-ai-section {
    padding: 18px;
  }

  .appt-ai-question,
  .appt-ai-context,
  .appt-ai-scenario-step,
  .appt-ai-complete {
    padding: 16px;
  }
}