/* ── Preview area ───────────────────────────────────────────────────────── */
.preview {
  padding: 32px;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-tint);
  transition: background 0.2s ease;
}
.preview-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Persona card base ──────────────────────────────────────────────────── */
.persona-card {
  /* Isolate card variables from the app dark theme cascade */
  --card-bg: #ffffff;
  --text: #1f2329;
  --muted: #6b7280;
  --border: #e5e7eb;

  position: relative;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 40px;
  display: grid;
  gap: 32px;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
  color: var(--text);
}

/* ── Card dark theme ────────────────────────────────────────────────────── */
.persona-card.card-dark {
  --card-bg: #1e1e1e;
  --text: #e8e8e8;
  --muted: #909090;
  --border: #333333;
  --bg-tint: #161616;
  background: var(--card-bg) !important;
  color: var(--text);
}

/* ── Decorative grid background ─────────────────────────────────────────── */
.card-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 8px 100%;
  opacity: 0.5;
}

/* ── Column base ────────────────────────────────────────────────────────── */
.col {
  position: relative;
  z-index: 1;
}

/* ── Avatar (used in templates A and B) ─────────────────────────────────── */
.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #e8ebf0;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.avatar img.loaded { display: block; }
.avatar-fallback {
  font-size: 56px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar img.loaded + .avatar-fallback { display: none; }

/* ── Name, role, section title ──────────────────────────────────────────── */
.persona-name {
  font-size: 28px;
  margin: 0 0 4px;
  color: var(--text);
}
.persona-role {
  margin: 0 0 20px;
  color: var(--primary);
  font-weight: 500;
}
.section-title {
  font-size: 18px;
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── About grid ─────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.about-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.about-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.about-icon svg { width: 16px; height: 16px; }

/* ── Chips ──────────────────────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  background: #f1f3f7;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
}
.persona-card.card-dark .chip {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Content blocks ─────────────────────────────────────────────────────── */
.block {
  margin-bottom: 24px;
}
.block:last-child { margin-bottom: 0; }
.paragraph {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.bullet-list li { margin-bottom: 2px; }

/* ── Personality bars ───────────────────────────────────────────────────── */
.personality-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.personality-item .labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.bar {
  position: relative;
  height: 4px;
  background: #e8ebf0;
  border-radius: 999px;
  overflow: hidden;
}
.persona-card.card-dark .bar { background: rgba(255, 255, 255, 0.12); }
.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  position: relative;
}
.bar-fill::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* ── Motivation dots ────────────────────────────────────────────────────── */
.behavior-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.behavior-item .skill-name {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text);
}
.dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #e8ebf0;
  flex-shrink: 0;
}
.persona-card.card-dark .dot { background: rgba(255, 255, 255, 0.12); }
.dot.filled { background: var(--primary); }

/* ── Vertical layout – mobile-like width ────────────────────────────────── */
.persona-card.vertical {
  grid-template-columns: 1fr !important;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .preview { height: auto; padding: 16px; }
  .persona-card { grid-template-columns: 1fr !important; }
}
