/* ─── Wizard Step Indicator ──────────────────────────────────────────────── */
.wizard-container { max-width: 820px; margin: 0 auto; }

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wizard-step__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.wizard-step.active .wizard-step__dot {
  background: var(--brand);
  color: white;
  box-shadow: 0 0 0 4px rgba(67, 0, 152, 0.15);
}

.wizard-step.done .wizard-step__dot {
  background: var(--sage);
  color: white;
}

.wizard-step__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.wizard-step.active .wizard-step__label { color: var(--brand); font-weight: 500; }
.wizard-step.done .wizard-step__label { color: var(--sage); }

.wizard-step--clickable { cursor: pointer; }
.wizard-step--clickable:hover .wizard-step__dot { opacity: 0.8; transform: scale(1.08); }
.wizard-step--clickable:hover .wizard-step__label { color: var(--brand); }

.wizard-step__line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 24px;
  margin-bottom: 22px;
  margin-left: -2px;
  margin-right: -2px;
}

/* ─── Wizard Body ────────────────────────────────────────────────────────── */
.wizard-step-content { animation: fadeSlideIn 0.25s ease; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wizard-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.wizard-step-icon { font-size: 1.8rem; }
.wizard-step-header h3 { margin: 0; font-size: 1.3rem; }
.wizard-step-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

.wizard-fields { display: flex; flex-direction: column; gap: 4px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Prevent any child from overflowing its grid cell */
.field-row > * { min-width: 0; }
.field-row .form-input,
.field-row .form-select { width: 100%; box-sizing: border-box; }

/* Stack to single column on small screens */
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.form-textarea--tall { min-height: 180px; }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.wizard-nav__right { display: flex; align-items: center; gap: 10px; }
.wizard-save-btn { color: var(--text-muted); min-width: 70px; }
.wizard-save-btn .hidden { display: none; }
.wizard-save-btn__saved { color: var(--sage, #5c9e6e); font-weight: 600; }

/* ─── Trait Picker ───────────────────────────────────────────────────────── */
.trait-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.trait-chip {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.trait-chip:hover { border-color: var(--brand); color: var(--brand); }
.trait-chip.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

/* ─── Radio Group ────────────────────────────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.radio-label input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ─── Preview Cards (Eulogy) ─────────────────────────────────────────────── */
.preview-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 600px) { .preview-cards { grid-template-columns: 1fr; } }

.preview-card {
  background: var(--purple-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.preview-card__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-card__body {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

.preview-card__body p { color: var(--text); margin-bottom: 4px; }
.preview-traits { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── AI Generate Box ────────────────────────────────────────────────────── */
.ai-generate-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--purple-100), var(--purple-50));
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

.ai-generate-box__icon {
  font-size: 1.8rem;
  color: var(--brand);
  flex-shrink: 0;
}

.ai-generate-box__title {
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.ai-generate-box__desc { font-size: 0.88rem; color: var(--text-muted); }

.ai-generate-box .btn { flex-shrink: 0; margin-left: auto; }

.eulogy-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Memorial Checklist ─────────────────────────────────────────────────── */
.checklist-wrapper { display: flex; flex-direction: column; height: 100%; }

.checklist-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.checklist-progress-label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }

.checklist-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  min-height: 500px;
}

.checklist-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-cat-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.checklist-cat-nav:hover { background: var(--purple-100); color: var(--brand); }
.checklist-cat-nav.active { background: var(--brand); color: white; }
.checklist-cat-nav.active .cat-count { background: rgba(255,255,255,0.2); color: white; }

.cat-count {
  font-size: 0.75rem;
  background: var(--slate-100);
  padding: 2px 7px;
  border-radius: 100px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cat-count--done { background: var(--sage); color: white; }

.checklist-main { overflow-y: auto; }

.category-block__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.category-block__icon { font-size: 1.6rem; }
.category-block__header h4 { margin: 0; font-size: 1.05rem; }

.checklist-items { display: flex; flex-direction: column; gap: 2px; }

.checklist-item {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: all 0.15s;
}

.checklist-item:hover { background: var(--purple-50); border-color: var(--border); }
.checklist-item.done { background: linear-gradient(135deg, #f0f7f3, #fafffe); border-color: rgba(107,158,126,0.3); }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.check-input { display: none; }

.check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-input:checked ~ .check-box {
  background: var(--sage);
  border-color: var(--sage);
}

.check-input:checked ~ .check-box::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.check-text { display: flex; flex-direction: column; gap: 2px; }
.check-main { font-size: 0.92rem; color: var(--text); font-weight: 500; }
.check-detail { font-size: 0.8rem; color: var(--text-muted); }

.checklist-item.done .check-main { text-decoration: line-through; opacity: 0.7; }

.check-field {
  margin-top: 8px;
  margin-left: 32px;
}

.form-input--sm { padding: 8px 12px; font-size: 0.88rem; }

/* ─── Personal Messages ──────────────────────────────────────────────────── */
.messages-wrapper { display: flex; flex-direction: column; gap: 20px; }

.messages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.messages-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 40px;
  color: var(--text-muted);
}

.messages-empty__icon { font-size: 3rem; margin-bottom: 16px; }
.messages-empty h4 { margin-bottom: 8px; color: var(--text); }
.messages-empty p { margin-bottom: 24px; }

.compose-panel {
  background: white;
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeSlideIn 0.2s ease;
}

.compose-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--purple-100);
  border-bottom: 1px solid var(--border);
}

.compose-panel__header h4 { margin: 0; font-size: 1rem; }
.compose-body { padding: 24px; }

.compose-extras {
  background: var(--purple-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .link-input-row { grid-template-columns: 1fr; } }

.color-picker { display: flex; gap: 8px; margin-top: 6px; }

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--brand); transform: scale(1.15); }

.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Message Cards Grid */
.messages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.message-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.message-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.message-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.message-card__to { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.message-card__rel { font-size: 0.8rem; margin-top: 2px; }
.message-card__when { font-size: 0.75rem; text-align: right; flex-shrink: 0; }

.message-card__photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}

.message-card__body { font-size: 0.9rem; line-height: 1.65; }

.message-card__links { display: flex; flex-direction: column; gap: 4px; }
.message-card__link { font-size: 0.82rem; text-decoration: underline; word-break: break-all; }

.message-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.message-card__date { font-size: 0.75rem; }

/* ─── Family Execution Packet ────────────────────────────────────────────── */
.packet-wrapper { display: flex; flex-direction: column; }

.packet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.packet-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  min-height: 600px;
}

.packet-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.packet-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.15s;
  gap: 6px;
}

.packet-nav-item:hover { background: var(--purple-100); color: var(--brand); }
.packet-nav-item.active { background: var(--brand); color: white; }
.packet-nav-item.active .cat-count { background: rgba(255,255,255,0.2); color: white; }

.packet-fields-area { overflow-y: auto; }

.packet-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.packet-section-icon { font-size: 1.8rem; }
.packet-section-header h4 { margin: 0; font-size: 1.05rem; }

.packet-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) { .packet-fields-grid { grid-template-columns: 1fr; } }

.field-filled {
  color: var(--sage);
  font-size: 0.75rem;
  margin-left: 6px;
  font-style: normal;
}

/* ─── Responsive overrides ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .checklist-layout,
  .packet-layout {
    grid-template-columns: 1fr;
  }

  .checklist-sidebar,
  .packet-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .checklist-cat-nav,
  .packet-nav-item {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* ── About You expanded sections ───────────────────────────────────────────── */

.field-section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: var(--brand); margin-bottom: 6px; margin-top: 4px;
  padding-bottom: 6px; border-bottom: 1.5px solid var(--border);
}
.field-subsection-label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 8px; margin-top: 4px;
}
.field-section-hint {
  font-size: 0.82rem; color: var(--text-muted); margin: -4px 0 12px;
}
.field-empty-hint {
  font-size: 0.82rem; color: var(--text-muted); padding: 8px 0;
  font-style: italic;
}
.form-label-hint {
  font-weight: 400; color: var(--text-muted); font-size: 0.8rem;
}

/* Education entries */
.edu-entry {
  background: var(--slate-50); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 12px;
}
.edu-entry__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.edu-entry__label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.edu-entry__remove {
  font-size: 0.78rem; color: #e74c3c; background: none; border: none;
  cursor: pointer; padding: 2px 8px; border-radius: 4px; font-family: inherit;
  transition: background 0.15s;
}
.edu-entry__remove:hover { background: #fde8e8; }

/* Assoc / alumni entries */
.assoc-entry {
  background: var(--slate-50); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px; margin-bottom: 10px;
}

/* AI enhance wrap */
.ai-field-wrap { display: flex; flex-direction: column; gap: 6px; }
.btn-ai-enhance {
  align-self: flex-end; font-size: 0.78rem; font-weight: 600;
  color: var(--brand); background: var(--purple-100);
  border: 1.5px solid var(--lavender); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-family: inherit;
  transition: all 0.15s; white-space: nowrap;
}
.btn-ai-enhance:hover { background: var(--brand); color: white; border-color: var(--brand); }
.btn-ai-enhance:disabled { opacity: 0.5; cursor: not-allowed; }

/* Previous relationships toggle */
.prev-rel-toggle {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.88rem; color: var(--text); cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; background: white; margin-top: 12px;
  line-height: 1.4;
}
.prev-rel-toggle input[type="checkbox"] { margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.prev-rel-toggle:has(input:checked) { border-color: var(--brand); background: var(--purple-100); }

.prevrel-entry {
  background: var(--slate-50); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 12px;
}

/* ─── Personality Profiles Section ──────────────────────────────────────── */
.personality-profiles-section {
  background: var(--purple-50, #f8f4ff);
  border: 1px solid var(--lavender, #d4c5f0);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.profile-link {
  font-size: 0.75rem; font-weight: 500; color: var(--brand);
  text-decoration: none; margin-left: 8px; opacity: 0.8;
}
.profile-link:hover { opacity: 1; text-decoration: underline; }

.love-lang-picker {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.love-lang-chip {
  padding: 6px 14px; border-radius: 20px; font-size: 0.83rem; font-weight: 500;
  border: 1.5px solid var(--lavender, #d4c5f0); background: white;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.love-lang-chip.selected {
  background: var(--brand); color: white; border-color: var(--brand);
}
.love-lang-chip:hover:not(.selected) { border-color: var(--brand); color: var(--brand); }

/* ─── Contributor Section ────────────────────────────────────────────────── */
.contributor-section {
  background: white; border: 1.5px solid var(--lavender, #d4c5f0);
  border-radius: 12px; padding: 24px; margin-top: 8px;
}
.contributor-section__header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px;
}
.contributor-section__icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }
.contributor-invite-form {
  background: var(--purple-50, #f8f4ff); border-radius: 8px; padding: 16px;
  margin-bottom: 4px;
}

/* ─── Contributors Table ─────────────────────────────────────────────────── */
.contributors-table { display: flex; flex-direction: column; gap: 8px; }
.contributor-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; background: #f9f9f9; border-radius: 8px;
  border: 1px solid #eee; font-size: 0.875rem;
}
.contributor-row--done { background: #f3faf3; border-color: #c3e6c3; }
.contributor-row__info { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.contributor-row__name { font-weight: 600; color: var(--text); }
.contributor-row__rel { font-size: 0.8rem; color: #888; font-style: italic; }
.contributor-row__email { font-size: 0.8rem; color: #aaa; }
.contributor-row__status { flex-shrink: 0; }
.contrib-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 600;
}
.contrib-badge--done { background: #e6f4e6; color: #2a7a2a; }
.contrib-badge--pending { background: #fff3e0; color: #b36200; }
.contributor-row__view {
  background: none; border: none; color: var(--brand); font-size: 0.8rem;
  cursor: pointer; padding: 0; font-family: inherit; text-decoration: underline;
}
.contributor-row__remove {
  background: none; border: none; color: #ccc; cursor: pointer;
  font-size: 0.85rem; padding: 2px 4px; border-radius: 4px; transition: color 0.15s;
}
.contributor-row__remove:hover { color: #e00; }
.contributor-response {
  width: 100%; border-top: 1px solid #e0e0e0; margin-top: 8px; padding-top: 12px;
}
.contributor-response.hidden { display: none; }
.contrib-response-item { margin-bottom: 12px; }
.contrib-response-item__q {
  font-size: 0.78rem; font-weight: 600; color: #888; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 3px;
}
.contrib-response-item__a { font-size: 0.88rem; color: var(--text); line-height: 1.6; }

/* ─── Faith Step ─────────────────────────────────────────────────────────── */
.faith-section {
  background: var(--purple-50, #f8f4ff);
  border: 1px solid var(--lavender, #d4c5f0);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.faith-section .field-section-label { margin-bottom: 14px; }

/* ─── Scripture Section ──────────────────────────────────────────────────── */
.scripture-section {
  border: 1.5px solid var(--lavender, #d4c5f0);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}
.scripture-section > .field-section-label { margin-bottom: 6px; }
.scripture-section > .field-section-hint { margin-bottom: 16px; }

.scripture-controls { display: flex; flex-direction: column; gap: 10px; }
.scripture-search-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.scripture-search-row .form-input { flex: 1; min-width: 200px; }
.scripture-search-type { display: flex; gap: 12px; align-items: center; padding-top: 10px; flex-shrink: 0; }
.radio-label--sm { font-size: 0.82rem; gap: 4px; }

.scripture-results { margin-top: 14px; border: 1px solid #e8e0f5; border-radius: 8px; overflow: hidden; }
.scripture-results.hidden { display: none; }
.scripture-loading { padding: 14px 16px; font-size: 0.9rem; color: #888; }

.scripture-result {
  padding: 14px 16px;
  border-bottom: 1px solid #f0ebff;
  background: white;
}
.scripture-result:last-child { border-bottom: none; }
.scripture-result__ref { font-size: 0.8rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.scripture-result__text { font-size: 0.92rem; color: var(--text); line-height: 1.7; margin-bottom: 10px; font-style: italic; }
.scripture-result__actions { display: flex; flex-direction: column; gap: 6px; }
.scripture-result__reflection { font-size: 0.85rem; }
.scripture-result__add { align-self: flex-start; padding: 6px 14px; font-size: 0.83rem; }

/* ─── Saved Passages / Scripture Cards ───────────────────────────────────── */
.scripture-saved { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.scripture-card {
  background: #f9f5ff;
  border: 1px solid var(--lavender, #d4c5f0);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
}
.scripture-card__ref { font-size: 0.78rem; font-weight: 700; color: var(--brand); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 5px; }
.scripture-card__tx { font-weight: 400; color: #999; margin-left: 6px; }
.scripture-card__text { font-size: 0.9rem; color: var(--text); line-height: 1.7; font-style: italic; margin-bottom: 6px; }
.scripture-card__reflection { font-size: 0.84rem; color: #555; line-height: 1.6; border-left: 3px solid var(--brand); padding-left: 10px; margin-top: 8px; }
.scripture-card__remove { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #ccc; cursor: pointer; font-size: 0.78rem; transition: color 0.15s; }
.scripture-card__remove:hover { color: #e00; }

/* ─── Manual passage form ────────────────────────────────────────────────── */
.scripture-manual-form {
  background: var(--purple-50, #f8f4ff);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Readings Section (Books & Quotes) ──────────────────────────────────── */
.readings-section {
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  padding: 22px;
}
.readings-section > .field-section-label { margin-bottom: 6px; }
.readings-section > .field-section-hint { margin-bottom: 16px; }

.reading-add-form { background: #f8f9fa; border-radius: 8px; padding: 16px; }
.reading-type-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.reading-type-btn {
  padding: 7px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
  border: 1.5px solid #ddd; background: white; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: all 0.15s;
}
.reading-type-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
.reading-type-btn:hover:not(.active) { border-color: var(--brand); color: var(--brand); }

.reading-card {
  background: white; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 14px 40px 14px 16px; position: relative;
}
.reading-card__type { font-size: 0.75rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.reading-card__title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.reading-card__excerpt { font-size: 0.88rem; font-style: italic; color: #555; margin-top: 6px; line-height: 1.6; border-left: 3px solid #e0e0e0; padding-left: 10px; }
.reading-card__reason { font-size: 0.84rem; color: #777; margin-top: 6px; line-height: 1.5; }
.reading-card__remove { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #ccc; cursor: pointer; font-size: 0.78rem; transition: color 0.15s; }
.reading-card__remove:hover { color: #e00; }
.empty-hint { font-size: 0.85rem; color: #aaa; font-style: italic; margin: 4px 0; }

/* ─── Book Search ─────────────────────────────────────────────────────────── */
.book-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.book-search-row .form-input { flex: 1; }

.book-search-results {
  border: 1px solid #e4d9ff;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
  background: white;
  max-height: 320px;
  overflow-y: auto;
}
.book-search-results.hidden { display: none; }
.book-search-loading {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: #888;
  font-style: italic;
}

.book-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f4efff;
  transition: background 0.1s;
}
.book-result:last-child { border-bottom: none; }
.book-result:hover { background: #faf7ff; }

.book-result__cover {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.book-result__no-cover {
  width: 42px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebff;
  border-radius: 3px;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.book-result__info { flex: 1; min-width: 0; }
.book-result__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-result__author {
  font-size: 0.78rem;
  color: #777;
  margin-top: 2px;
}
.book-result__select {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: 0.8rem;
}

/* ─── Selected book card ─────────────────────────────────────────────────── */
.book-selected-card {
  background: #f4efff;
  border: 1.5px solid var(--lavender, #d4c5f0);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.book-selected-card__inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.book-cover-thumb {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.book-cover-thumb-sm {
  width: 30px;
  height: 42px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.book-selected-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text, #1a1a2e);
}
.book-selected-card__author {
  font-size: 0.78rem;
  color: #666;
  margin-top: 2px;
}
.book-selected-clear {
  margin-left: auto;
  background: none;
  border: 1px solid #c9b8e8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #7a5fa8;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.15s;
}
.book-selected-clear:hover { background: white; color: var(--brand); }

/* ─── Reading card with cover image ─────────────────────────────────────── */
.reading-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

/* ─── Inline AI field wrap (for dynamic/compact contexts) ────────────────── */
.ai-field-wrap--inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-field-wrap--inline .btn-ai-enhance {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 3px 10px;
}

/* ─── Book cover fallback placeholders ───────────────────────────────────── */
.book-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebff;
  font-size: 1.3rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.book-cover-fallback-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebff;
  font-size: 1rem;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Ensure cover wrap in results uses consistent sizing */
.book-result__cover-wrap {
  flex-shrink: 0;
  width: 42px;
  height: 58px;
  position: relative;
}
.book-result__cover-wrap img,
.book-result__cover-wrap .book-result__no-cover {
  width: 42px;
  height: 58px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEMORIAL WISHES — Tile & Chip Picker Design
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section intro text ──────────────────────────────────────────────────── */
.m-section-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* ── Question block ──────────────────────────────────────────────────────── */
.m-question { margin-bottom: 24px; }
.m-question-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: block;
}
.m-question-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
  font-weight: 400;
}

/* ── Tile grid (pick one) ────────────────────────────────────────────────── */
.m-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.m-tiles--wide {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.m-tiles--compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.m-tile {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-tile:hover { border-color: var(--purple-400); background: var(--purple-50); }
.m-tile--active {
  border-color: var(--brand);
  background: var(--purple-100);
  box-shadow: 0 0 0 3px rgba(67,0,152,0.1);
}
.m-tile__icon { font-size: 1.3rem; line-height: 1; }
.m-tile__label { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.m-tile__desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.3; }
.m-tile--active .m-tile__label { color: var(--brand); }

/* ── Chip group (multi-select) ───────────────────────────────────────────── */
.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m-chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  user-select: none;
}
.m-chip:hover { border-color: var(--purple-400); color: var(--brand); background: var(--purple-50); }
.m-chip--active {
  border-color: var(--brand);
  background: var(--purple-100);
  color: var(--brand);
}

/* ── Reveal block (conditional) ─────────────────────────────────────────── */
.m-reveal {
  margin-top: 16px;
  padding: 16px;
  background: var(--purple-50);
  border-radius: var(--radius);
  border: 1px solid var(--purple-200);
  display: none;
}
.m-reveal.visible { display: block; }
.m-reveal > .m-question:last-child { margin-bottom: 0; }

/* ── Text input inside memorial form ─────────────────────────────────────── */
.m-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
}
.m-input:focus { outline: none; border-color: var(--brand); }
.m-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* ── Song suggestion expander ────────────────────────────────────────────── */
.m-song-suggestions {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.m-song-suggestions summary {
  padding: 10px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  background: var(--purple-50);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.m-song-suggestions summary:hover { background: var(--purple-100); }
.m-song-suggestions summary::marker,
.m-song-suggestions summary::-webkit-details-marker { display: none; }
.m-song-suggestions[open] summary::before { content: '▾ '; }
.m-song-suggestions:not([open]) summary::before { content: '▸ '; }
.m-song-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 8px;
}
.m-song-group { padding: 8px; }
.m-song-group__title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.m-song-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  font-size: 0.8rem;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.4;
}
.m-song-btn:hover { background: var(--purple-100); color: var(--brand); }

/* ── Divider between question groups ─────────────────────────────────────── */
.m-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Toggle row (yes/no/up to family) ────────────────────────────────────── */
.m-toggle-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.m-toggle-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  color: var(--text-muted);
}
.m-toggle-btn:hover { border-color: var(--purple-400); color: var(--brand); }
.m-toggle-btn--active { border-color: var(--brand); background: var(--purple-100); color: var(--brand); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .m-tiles { grid-template-columns: repeat(2, 1fr); }
  .m-song-grid { grid-template-columns: 1fr; }
}
