/**
 * ParsExam AI Experience — identity, welcome, prefs (enterprise SaaS)
 */
.pe-ai-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pe-font-ui);
  vertical-align: middle;
}
.pe-ai-visual {
  position: relative;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #c4b5fd, #4f46e5 55%, #312e81);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 8px 20px rgba(79, 70, 229, 0.28);
}
.pe-ai-canvas, .pe-ai-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.pe-ai-sm .pe-ai-visual { width: 28px; height: 28px; }
.pe-ai-md .pe-ai-visual { width: 48px; height: 48px; }
.pe-ai-lg .pe-ai-visual { width: 72px; height: 72px; }
.pe-ai-hero .pe-ai-visual { width: 120px; height: 120px; }

.pe-ai-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--ep-color-surface, #fff);
  border: 1px solid var(--ep-color-border, #e2e8f0);
  border-radius: 16px;
  box-shadow: var(--ep-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  max-width: 360px;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.pe-ai-card:hover {
  box-shadow: var(--ep-shadow-md, 0 4px 16px rgba(15, 23, 42, 0.1));
  transform: translateY(-1px);
}
.pe-ai-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pe-ai-title {
  font-size: 13px;
  font-weight: 850;
  color: var(--ep-color-text, #0f172a);
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pe-ai-sub { font-size: 11px; color: var(--ep-color-text-muted, #64748b); font-weight: 600; }
.pe-ai-cta {
  margin-top: 8px;
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  min-height: 32px;
}
.pe-ai-cta:hover { filter: brightness(1.06); }

.pe-ai-sidebar {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
.pe-ai-home-chip {
  margin-top: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pe-ai-home-chip strong {
  font-size: 11px;
  font-weight: 850;
  color: #e0e7ff;
}
.pe-ai-home-chip span { font-size: 10px; color: rgba(226, 232, 240, 0.85); }

/* Global assistant ONLY — never float over product tool content */
.pe-ai-prefs {
  display: none; /* hidden unless inside assistant panel */
}
#mftAsstPanel .pe-ai-prefs,
.mft-asst-panel .pe-ai-prefs,
.pe-ai-prefs-in-assistant {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(238, 242, 255, 0.92);
  border: 1px solid rgba(199, 210, 254, 0.85);
  font-size: 11px;
  font-weight: 600;
  color: #4338ca;
  font-family: var(--pe-font-ui);
}
.pe-ai-prefs-title {
  flex: 1 1 100%;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 800;
  color: #312e81;
}
.pe-ai-assistant-prefs-host {
  flex: 0 0 auto;
}
.pe-ai-pref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.pe-ai-pref input { accent-color: #4f46e5; width: 14px; height: 14px; }
/* Product surfaces: never show AI chrome in tool content */
[data-product] .pe-ai-prefs:not(.pe-ai-prefs-in-assistant),
.cl-body > .pe-ai-prefs,
.pg-body > .pe-ai-prefs,
.ps-body > .pe-ai-prefs,
.aa-body > .pe-ai-prefs {
  display: none !important;
}

/* Admin AI Experience settings */
.aix-root {
  max-width: 960px;
  font-family: var(--pe-font-ui);
}
.aix-head { margin-bottom: 14px; }
.aix-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #6d28d9;
  background: #f5f3ff;
  padding: 3px 10px;
  border-radius: 999px;
}
.aix-head h2 { margin: 8px 0 4px; font-size: 18px; font-weight: 850; }
.aix-sub { margin: 0; font-size: 12px; color: #64748b; line-height: 1.7; max-width: 40rem; }
.aix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.aix-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.aix-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 800; }
.aix-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.aix-field input,
.aix-field select,
.aix-field textarea {
  min-height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: #0f172a;
}
.aix-field textarea { min-height: 72px; resize: vertical; }
.aix-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.7;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  margin-top: 8px;
}
.aix-preview {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: linear-gradient(160deg, #eef2ff, #f8fafc);
  border-radius: 14px;
  margin-bottom: 10px;
  min-height: 100px;
  align-items: center;
}
.aix-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.aix-foot { font-size: 11px; color: #94a3b8; margin-top: 12px; line-height: 1.6; }

/* Empty states with AI */
.pe-ai-empty {
  text-align: center;
  padding: 28px 16px;
}
.pe-ai-empty .pe-ai-identity { justify-content: center; margin-bottom: 10px; }

[data-theme="dark"] .pe-ai-card,
[data-theme="dark"] .aix-card {
  background: var(--ep-color-surface, #111827);
  border-color: var(--ep-color-border, #334155);
}
[data-theme="dark"] .pe-ai-prefs {
  background: rgba(30, 27, 75, 0.6);
  border-color: #4338ca;
  color: #c7d2fe;
}
[data-theme="dark"] .aix-field input,
[data-theme="dark"] .aix-field select,
[data-theme="dark"] .aix-field textarea {
  background: #1f2937;
  border-color: #334155;
  color: #f8fafc;
}

@media (max-width: 640px) {
  .pe-ai-card { max-width: 100%; }
  .pe-ai-card:hover { transform: none; }
  .pe-ai-prefs { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .pe-ai-card { transition: none; }
}
