/* ==========================================================================
   NancyWell Organizer Suite — artifact workspaces (artifacts.js)
   Program builder · Obituary · Thank-yous. Builds on styles.css tokens.
   ========================================================================== */

.af-wrap{
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.af-wrap.af-narrow{ max-width: 860px; }

.af-loading{ padding: 24px 0; }
.af-loading-label{ font-size: 0.85rem; }

.af-view-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.af-view-head h1{ font-size: clamp(1.5rem, 3vw, 2rem); }
.af-head-actions{ display: flex; gap: 10px; flex-wrap: wrap; }

.af-lede{
  color: var(--text-dim);
  font-size: 0.98rem;
  margin-bottom: 22px;
  max-width: 560px;
}
.af-hint{
  color: var(--text-faint);
  font-size: 0.84rem;
  line-height: 1.5;
  margin-top: 8px;
}
.af-managed-note{
  padding: 32px 30px;
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}
.af-managed-note h3{ margin-bottom: 10px; }
.af-managed-line{ margin: -2px 0 18px; }

/* ---------- Program toolbar ---------- */
.af-toolbar{
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.af-toolbar-field{ display: flex; flex-direction: column; gap: 6px; }
.af-tradition{ min-width: 240px; width: auto; padding: 9px 12px; font-size: 0.92rem; }
.af-tpl-blurb{ margin: 2px 0 18px; max-width: 640px; }

.af-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 9px 0;
  user-select: none;
}
.af-toggle input{ accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

.af-seg{
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
}
.af-seg-btn{
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.af-seg-btn.af-seg-on{
  background: rgba(201,162,75,0.16);
  color: var(--primary);
}

/* ---------- Program grid ---------- */
.af-program-grid{
  display: grid;
  /* The preview is a FIXED-width sheet (a stand-in for the printed page), so
     opening the ideas panel or inserting a reading/song never reflows it —
     the builder column absorbs the panel instead. */
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}
.af-program-grid.af-panel-open{
  grid-template-columns: minmax(0, 1fr) 300px 520px;
}

/* ---------- Section cards ---------- */
.af-sections{ display: flex; flex-direction: column; gap: 12px; }
.af-sec{
  padding: 14px 16px;
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.af-sec.af-sec-sel{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.14);
}
.af-sec-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.af-sec-order{ display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.af-order-btn{
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 0.6rem;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  border-radius: 4px;
}
.af-order-btn:hover{ color: var(--primary); background: var(--surface-2); }
.af-order-btn:disabled{ opacity: 0.3; cursor: default; }
.af-sec-title{
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 600;
}
.af-sec-lock{
  color: var(--text-faint);
  flex-shrink: 0;
  display: inline-flex;
  padding: 4px;
  cursor: help;
}
.af-sec-remove{
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.af-sec-remove:hover{ color: var(--danger); background: rgba(217,120,98,0.1); }
.af-sec-body{
  min-height: 56px;
  font-size: 0.92rem;
  padding: 10px 12px;
}
.af-sec .af-hint{ margin-top: 8px; }
.af-add-btn{ margin-top: 14px; }

.af-etiquette{
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(124,139,119,0.08);
  border: 1px solid rgba(124,139,119,0.28);
  border-radius: var(--radius-sm);
}
.af-etiquette ul{ margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.af-etiquette li{
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}
.af-etiquette li::before{
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Suggestions panel ---------- */
.af-suggest{
  padding: 16px 16px 20px;
  max-height: 76vh;
  overflow-y: auto;
  position: sticky;
  top: 84px;
}
.af-suggest-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.af-suggest-head h3{ font-size: 1rem; }
.af-suggest-close{
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.af-suggest-close:hover{ color: var(--text); background: var(--surface-2); }
.af-suggest-group{
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  margin: 18px 0 8px;
}
.af-suggest-item{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.af-suggest-item:last-child{ border-bottom: none; }
.af-suggest-main{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.af-suggest-main strong{ font-size: 0.9rem; }
.af-suggest-src{ color: var(--text-faint); font-size: 0.76rem; }
.af-suggest-why{ color: var(--text-dim); font-size: 0.82rem; line-height: 1.45; }
.af-suggest-item .btn{ flex-shrink: 0; }

/* ---------- Preview (program) ---------- */
.af-preview-col{ min-width: 0; overflow-x: auto; }
/* The on-screen sheet is capped + centered so its layout is identical whether
   the ideas panel is open or closed. Scoped to the preview column so the
   print clone (#af-print-root) still fills the real paper. */
.af-preview-col .af-page{ max-width: 520px; margin-left: auto; margin-right: auto; }
.af-preview-label{
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.af-page{
  background: #FBF7EE;
  color: #2b2620;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  font-family: var(--font-serif);
}
.af-cover{
  text-align: center;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(43,38,32,0.2);
}
.af-cover-eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: #8a7a55;
  margin-bottom: 12px;
}
.af-cover-name{
  font-size: 1.7rem;
  color: #2b2620;
  font-weight: 600;
}
.af-cover-dates{ margin-top: 6px; font-size: 0.95rem; color: #6b6156; }
.af-portrait{
  width: 120px;
  height: 150px;
  margin: 18px auto 0;
  border: 1px dashed rgba(43,38,32,0.35);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8a8074;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  padding: 8px;
  text-align: center;
}
.af-portrait-note{ font-size: 0.68rem; line-height: 1.4; }
.af-cover-service{ margin-top: 16px; font-size: 0.9rem; color: #52493d; font-style: italic; }

.af-pv-sections.af-pv-bifold{
  columns: 2;
  column-gap: 32px;
}
.af-pv-sec{
  break-inside: avoid;
  margin-bottom: 18px;
}
.af-pv-sec h3{
  font-size: 0.98rem;
  color: #2b2620;
  font-weight: 600;
  margin-bottom: 4px;
}
.af-pv-sec p{
  font-size: 0.88rem;
  line-height: 1.55;
  color: #52493d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.af-page-large .af-cover-name{ font-size: 2.1rem; }
.af-page-large .af-pv-sec h3{ font-size: 1.25rem; }
.af-page-large .af-pv-sec p{ font-size: 1.12rem; line-height: 1.7; }
.af-pv-notes{
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(43,38,32,0.2);
}
.af-pv-notes-label{
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  color: #8a7a55;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
}
.af-pv-note{
  font-size: 0.8rem;
  font-style: italic;
  color: #6b6156;
  line-height: 1.5;
  margin-bottom: 6px;
}
.af-page-large .af-pv-note{ font-size: 0.95rem; }

/* ---------- Obituary ---------- */
.af-form-card{
  padding: 26px 28px;
  margin-bottom: 20px;
}
.af-form-card h3{ font-size: 1.15rem; margin-bottom: 6px; }
.af-form-sub{ font-size: 0.9rem; margin-bottom: 20px; }
.af-form-actions{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.af-form-actions .af-hint{ margin-top: 0; }
.af-form-cancel{ margin: -8px 0 20px; }

.af-tab-card{ padding: 0 0 22px; overflow: hidden; }
.af-tabs{
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.af-tab{
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.af-tab:hover{ color: var(--text); }
.af-tab.af-tab-on{
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.af-tab-panel{ padding: 20px 24px 0; }
.af-tab-panel .af-form-actions{ margin-top: 14px; }

.af-obit-meta{
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.af-rate{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.af-rate-input{
  width: 84px;
  padding: 6px 10px;
  font-size: 0.9rem;
}
.af-cost{ color: var(--text-dim); font-size: 0.9rem; }
.af-cost strong{ color: var(--primary); }
.af-obit-text{
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
}
.af-publish-toggle{ padding: 2px 0 0; }
.af-tab-panel .af-hint{ margin-top: 6px; }

/* Publish-state line under the header — visible from every tab (C5) */
.af-obit-status{
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: -2px 0 12px;
}
.af-status-ok{ color: var(--success); font-weight: 700; }
.af-status-link{ font-size: inherit; }

/* Autosave micro-indicator (C1) */
.af-saveflag{
  color: var(--success);
  font-size: 0.84rem;
  font-weight: 600;
}

/* Read-only published long-form for speakers & contributors (C9) */
.af-obit-read{
  padding: 28px 30px;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
}
.af-obit-read p{ margin-bottom: 14px; }
.af-obit-read p:last-child{ margin-bottom: 0; }

/* Callout — app.css isn't loaded in the suite shell, so the obituary
   warnings style themselves here. */
.af-wrap .callout{
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 12px 0;
}
.af-wrap .callout-warning{
  border-color: rgba(201,162,75,0.45);
  background: rgba(201,162,75,0.08);
}
.af-callout-cta{ margin-top: 10px; }

/* ---------- Thank-yous ---------- */
/* First-run "How this works" 1-2-3 (C8) */
.af-howto{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.af-howto-title{
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.af-howto-steps{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.af-howto-steps strong{ color: var(--text); }

.af-ty-progress{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.88rem;
}
.af-ty-bar{ width: 200px; height: 6px; }

.af-table-card{ padding: 8px 0 10px; margin-bottom: 10px; }
.af-table-wrap{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.af-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.9rem;
}
.af-table th{
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.af-table td{
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.af-table tbody tr:last-child td{ border-bottom: none; }
.af-gift-row:hover td{ background: rgba(243,238,227,0.02); }
.af-cell-name{ font-weight: 600; color: var(--text); }
.af-cell-detail{ color: var(--text-dim); max-width: 260px; overflow-wrap: anywhere; }
.af-cell-center{ text-align: center; }
.af-cell-center input{ accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.af-cell-actions{
  text-align: right;
  white-space: nowrap;
}
.af-cell-actions .link-btn{ margin-left: 12px; text-decoration: none; font-size: 0.85rem; }
.af-cell-actions .link-btn:hover{ text-decoration: underline; }
.af-link-danger{ color: var(--danger); }
.af-link-danger:hover{ color: var(--danger); }
.af-cell-input{ padding: 7px 10px; font-size: 0.88rem; min-width: 110px; }
.af-cell-kind{ width: auto; }
.af-add-row td{ background: rgba(201,162,75,0.04); }
.af-table-empty{ padding: 6px 16px 8px; margin-top: 0; }

.af-kind{
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--surface-2);
}
.af-kind-flowers{ color: #cf9db2; border-color: rgba(207,157,178,0.4); background: rgba(207,157,178,0.1); }
.af-kind-food{ color: #c9a24b; border-color: rgba(201,162,75,0.4); background: rgba(201,162,75,0.1); }
.af-kind-donation{ color: #8fae86; border-color: rgba(143,174,134,0.4); background: rgba(143,174,134,0.1); }
.af-kind-help{ color: #93a7c4; border-color: rgba(147,167,196,0.4); background: rgba(147,167,196,0.1); }
.af-kind-other{ color: var(--text-dim); }

.af-notes-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 34px 0 14px;
}
.af-notes-head h2{ font-size: 1.25rem; }
.af-note-cards{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.af-note-card{ padding: 18px 18px 16px; }
.af-note-card-head{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.af-note-thanked{ margin-left: auto; padding: 0; font-size: 0.82rem; }
.af-note-card .af-hint{ margin: 0 0 8px; }
.af-note-text{
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  min-height: 120px;
}
.af-note-actions{
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.af-upgrade-card{
  padding: 22px 24px;
  margin-bottom: 20px;
  border-color: rgba(201,162,75,0.35);
  background: linear-gradient(180deg, rgba(201,162,75,0.1), rgba(201,162,75,0.03));
}
.af-upgrade-card h3{ margin-bottom: 6px; font-size: 1.05rem; }
.af-upgrade-card p{ margin-bottom: 14px; font-size: 0.92rem; max-width: 480px; }
.af-guarantee{ margin-top: 12px; margin-bottom: 0; font-size: 0.78rem; color: var(--text-faint); max-width: 480px; line-height: 1.5; }

/* Tip-credit note under a bundle buy button */
.af-credit-note{ margin: 8px 0 0; font-size: 0.82rem; color: var(--primary); }

/* "Unlock delivery" prompt (print / send / publish when the bundle is live).
   z-index 90: above the sticky header (40) and content, below the suite modal
   system (100) and toasts (200) — the sign-in modal and "nothing was charged"
   reassurance must never render underneath this overlay. */
.af-bundle-modal{ position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.af-bundle-backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.af-bundle-card{ position: relative; max-width: 400px; width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 22px 24px; text-align: center; }
.af-bundle-card h3{ margin: 0 0 8px; font-size: 1.15rem; }
.af-bundle-card p{ margin: 0 0 6px; color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }
.af-bundle-actions{ display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Print ---------- */
#af-print-root{ display: none; }

@media print{
  body.af-printing > *:not(#af-print-root){ display: none !important; }
  body.af-printing{ background: #fff !important; }
  #af-print-root{
    display: block;
    background: #fff;
    color: #111;
  }

  /* Program: the preview page, ink-friendly */
  #af-print-root .af-page{
    background: #fff;
    color: #111;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    font-family: Georgia, 'Times New Roman', serif;
  }
  #af-print-root .af-cover{ border-bottom-color: #bbb; }
  #af-print-root .af-cover-eyebrow{ color: #666; }
  #af-print-root .af-cover-name{ color: #111; }
  #af-print-root .af-cover-dates,
  #af-print-root .af-cover-service{ color: #444; }
  #af-print-root .af-portrait{ border-color: #999; color: #888; }
  #af-print-root .af-pv-sec h3{ color: #111; }
  #af-print-root .af-pv-sec p{ color: #333; }
  #af-print-root .af-pv-notes{ border-top-color: #bbb; }
  #af-print-root .af-pv-notes-label{ color: #666; }
  #af-print-root .af-pv-note{ color: #555; }

  /* Thank-you notes: one per block, generous room to hand-write from */
  #af-print-root .af-notes-print{ font-family: Georgia, 'Times New Roman', serif; }
  #af-print-root .af-notes-print-title{
    font-size: 14pt;
    font-weight: 600;
    margin-bottom: 24pt;
    color: #111;
  }
  #af-print-root .af-note-print{
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 18pt 0 30pt;
    margin-bottom: 24pt;
    border-bottom: 1px dashed #bbb;
  }
  #af-print-root .af-note-print:last-child{ border-bottom: none; }
  #af-print-root .af-note-print-to{
    font-size: 10pt;
    color: #666;
    margin-bottom: 10pt;
    font-family: Helvetica, Arial, sans-serif;
  }
  #af-print-root .af-note-print-detail{ color: #999; }
  #af-print-root .af-note-print-body{
    font-size: 12pt;
    line-height: 2;
    color: #222;
    white-space: pre-wrap;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px){
  /* Not enough room for builder + ideas + the fixed sheet → the preview drops
     to a full-width row below (sheet stays centered at its fixed size). */
  .af-program-grid.af-panel-open{ grid-template-columns: minmax(0, 1fr) 300px; }
  .af-program-grid.af-panel-open .af-preview-col{ grid-column: 1 / -1; }
}
@media (max-width: 980px){
  /* Closed state can no longer fit builder + the fixed sheet side by side. */
  .af-program-grid,
  .af-program-grid.af-panel-open{ grid-template-columns: minmax(0, 1fr); }
  .af-program-grid.af-panel-open .af-preview-col{ grid-column: auto; }
  .af-suggest{ position: static; max-height: none; order: -1; }
}
@media (max-width: 640px){
  .af-wrap{ padding: 20px 16px 60px; }
  .af-view-head{ flex-direction: column; align-items: stretch; }
  .af-head-actions .btn{ flex: 1 1 auto; }
  .af-toolbar{ align-items: stretch; flex-direction: column; gap: 12px; }
  .af-tradition{ min-width: 0; width: 100%; }
  .af-page{ padding: 26px 20px; }
  .af-pv-sections.af-pv-bifold{ columns: 1; }
  .af-tab{ padding: 12px 14px; font-size: 0.85rem; }
  .af-tab-panel{ padding: 16px 16px 0; }
  .af-obit-meta{ gap: 10px; }
  .af-note-cards{ grid-template-columns: 1fr; }
  .af-ty-bar{ width: 120px; }
}

/* ── Printables Pack ─────────────────────────────────────────────────── */
.af-view{ max-width: 1080px; }
.af-h2{ font-size: 1.4rem; margin: 0 0 6px; }
.af-sub{ color: var(--text-dim); margin: 0 0 18px; line-height: 1.5; }
.af-pb-fields{ display: grid; gap: 14px; padding: 16px 18px; margin-bottom: 18px; }
.af-field span{ display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px; }
.af-field textarea{ min-height: 80px; resize: vertical; }
.af-pb-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.af-pb-piece{ padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.af-pb-piece h3{ margin: 0; }
.af-pb-piece .btn{ align-self: flex-start; }
.af-pb-preview{ background: #f6f2e8; color: #201d18; border-radius: 8px; overflow: hidden; padding: 12px; max-height: 300px; }
.af-pb-scale > *{ transform: scale(0.55); transform-origin: top left; }

/* piece layouts (shared by preview + print) */
.af-pb-bookmark-sheet{ display: flex; gap: 14px; }
.af-pb-bookmark{ width: 2in; min-height: 6.5in; border: 1px solid #d8cfba; padding: 22px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; background: #fffdf7; }
.af-pb-flame{ margin-bottom: 14px; }
.af-pb-flame svg{ width: 22px; height: 22px; color: #b08d3f; }
.af-pb-name{ font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; margin: 0 0 4px; }
.af-pb-dates{ font-size: 0.8rem; color: #6d675c; margin: 0 0 14px; }
.af-pb-quote{ font-style: italic; font-size: 0.82rem; line-height: 1.5; margin: auto 0; }
.af-pb-foot{ font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8272; margin-top: auto; }
.af-pb-card-sheet{ display: flex; gap: 20px; }
.af-pb-card{ width: 3.6in; min-height: 5in; border: 1px solid #d8cfba; background: #fffdf7; padding: 30px 24px; text-align: center;
  display: flex; flex-direction: column; }
.af-pb-inmem{ font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #8a8272; margin: 0 0 12px; }
.af-pb-verse{ font-style: italic; font-size: 0.86rem; line-height: 1.6; margin: 16px 0; }
.af-pb-svc{ font-size: 0.8rem; color: #6d675c; margin-top: auto; }
.af-pb-register{ width: 7.4in; background: #fffdf7; border: 1px solid #d8cfba; padding: 36px 40px; }
.af-pb-line{ display: flex; gap: 24px; border-bottom: 1px solid #d8cfba; height: 30px; }
.af-pb-line span{ flex: 1; }
.af-pb-line-head{ border-bottom: 2px solid #b8ab8d; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a8272; align-items: flex-end; padding-bottom: 4px; height: auto; }
.af-pb-sign{ width: 9.5in; min-height: 6.8in; background: #fffdf7; border: 1px solid #d8cfba; padding: 60px;
  text-align: center; display: flex; flex-direction: column; justify-content: center; }
.af-pb-sign .af-pb-name{ font-size: 2.6rem; }
.af-pb-sign .af-pb-inmem{ font-size: 1rem; }
.af-pb-sign .af-pb-dates{ font-size: 1.1rem; }
.af-pb-sign .af-pb-svc{ font-size: 1rem; margin-top: 26px; }
.af-pb-sign .af-pb-foot{ margin-top: 30px; }
.af-gate{ padding: 18px; color: var(--text-dim); }

@media print {
  #af-print-root.af-pb-print{ background: #fff; color: #201d18; }
  #af-print-root.af-pb-print .af-pb-bookmark,
  #af-print-root.af-pb-print .af-pb-card,
  #af-print-root.af-pb-print .af-pb-register,
  #af-print-root.af-pb-print .af-pb-sign{ background: #fff; border-style: dashed; }
  /* The 9.5in welcome sign needs a landscape sheet. `page: landscape` only
     works if that named page is actually defined with a landscape size —
     without this rule it fell back to portrait letter and clipped. */
  @page landscape { size: letter landscape; margin: 0.3in; }
  #af-print-root.af-pb-print-sign{ page: landscape; }
}

/* In-app pay sheet (embedded Stripe checkout inside our modal) */
.af-pay-modal{ align-items: flex-start; overflow-y: auto; padding: 32px 16px; z-index: 2000; /* payment is topmost */ }
.af-pay-card{
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 20px 22px 16px;
}
.af-pay-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 24px 6px 0; }
.af-pay-head h3{ margin: 0; font-size: 1.15rem; }
.af-pay-price{ font-weight: 700; color: var(--primary); white-space: nowrap; }
.af-pay-items{ margin: 8px 0 12px; padding: 0 0 0 2px; list-style: none; }
.af-pay-items li{ font-size: 0.85rem; color: var(--text-dim); padding: 2px 0 2px 22px; position: relative; }
.af-pay-items li::before{ content: "✓"; position: absolute; left: 2px; color: var(--primary); }
.af-pay-mount{ min-height: 240px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.02); }
.af-pay-loading, .af-pay-confirm{ padding: 40px 12px; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.af-pay-err{ padding: 24px 12px; text-align: center; color: #b4554a; font-size: 0.9rem; }
.af-pay-close{ z-index: 2; }
@media (max-width: 640px){
  /* Full sheet on phones: the payment form needs every pixel. */
  .af-pay-modal{ padding: 0; }
  .af-pay-card{ max-width: none; min-height: 100%; border-radius: 0; border-left: 0; border-right: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
}

/* ── Printables: suggestion chips, portrait, photo toggle ────────────── */
.af-pb-chips{ display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.af-pb-chip{
  border: 1px solid var(--border); background: none; color: var(--text-dim);
  font-family: var(--font-sans); font-size: 0.76rem; border-radius: 999px;
  padding: 5px 11px; cursor: pointer; transition: border-color .15s, color .15s;
}
.af-pb-chip:hover{ border-color: var(--primary); color: var(--text); }
.af-pb-photo{ width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin: 0 auto 10px; }
.af-pb-photo img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.af-pb-photo-lg{ width: 110px; height: 110px; }
.af-pb-phototoggle{
  display: flex; align-items: center; gap: 8px; font-family: var(--font-sans);
  font-size: 0.84rem; color: var(--text-dim); cursor: pointer; margin-top: 2px;
}
.af-pb-photonote{ font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-faint); margin: 2px 0 0; }
.af-pb-photonote a{ color: var(--primary); }
@media print {
  #af-print-root.af-pb-print .af-pb-photo{ width: 0.9in; height: 0.9in; }
  #af-print-root.af-pb-print .af-pb-photo-lg{ width: 1.8in; height: 1.8in; }
  #af-print-root.af-pb-print .af-pb-flame svg{ color: #8a6d3b; }
}
