/* Engine: the public page (/@handle, .ep-*). */

/* ---------- Public page ---------- */
body.engine-page {
  margin: 0;
  min-height: 100vh;
  background: #f6f7f6;
  color: #1a1d1b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ep { max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 32px) 16px calc(env(safe-area-inset-bottom, 0px) + 32px); }
.ep [hidden] { display: none !important; }
.ep-loading { text-align: center; color: #7a837e; }
.ep-head { text-align: center; }
.ep-head.ep-author { display:flex; align-items:center; gap:11px; margin:14px 0 0; text-align:left; }
.ep-head.ep-author .ep-avatar { width:46px; height:46px; font-size:17px; flex:none; }
.ep-head.ep-author h1 { margin:0; font-size:16px; }
.ep-purpose { margin: 4px 0 0; color: #6b7570; font-size: 13px; line-height: 1.4; }
.ep-head h1 { margin: 12px 0 2px; font-size: 24px; font-weight: 750; letter-spacing: -.3px; }
.ep-handle { margin: 0; color: #7a837e; font-size: 14px; }
.ep-avatar {
  display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  color: #fff; background: #28735a center / cover no-repeat; font-size: 30px; font-weight: 750;
}
.ep-avatar.small { width: 48px; height: 48px; font-size: 18px; flex: none; }
.ep-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.ep-chips.center { justify-content: center; }
.ep-chip { padding: 5px 12px; border-radius: 999px; background: #f1f2f1; color: #3f4843; font-size: 13px; font-weight: 650; }
.ep-chip.plain { background: #f1f2f1; color: #3f4843; }
.ep-line { margin: 16px 0 6px; text-align: center; font-size: 18px; line-height: 1.45; color: #1f2924; }
.ep-block { display: block; margin: 12px 0 0; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); color: inherit; text-decoration: none; }
.ep-block h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.ep-body { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: #2d3530; }
.ep-namecard { display: flex; gap: 12px; align-items: center; }
.ep-namecard strong { display: block; font-size: 16px; }
.ep-namecard small { display: block; color: #6b7570; font-size: 13px; margin-top: 2px; }
.ep-namecard p { margin: 4px 0 0; font-size: 14px; color: #2d3530; }
.ep-link strong { display: block; font-size: 15px; }
.ep-link small { color: #6b7570; font-size: 13px; }
.ep-photos { margin: 0 -16px; }
.ep-block.ep-gallery { margin-top: 0; padding: 0; background: none; box-shadow: none; }
.ep-photo-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ep-photo-track::-webkit-scrollbar { display: none; }
.ep-photo { flex: 0 0 100%; padding: 0; border: 0; border-radius: 0; overflow: hidden; aspect-ratio: 4 / 5; background: #eef0ee; cursor: zoom-in; scroll-snap-align: start; }
.ep-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-photo-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 0; }
.ep-photo-dots i { width: 6px; height: 6px; border-radius: 999px; background: #c7cdca; }
.ep-photo-dots i.is-on { width: 16px; background: #1a1d1b; }
.ep-say { margin: 22px 0 0; text-align: center; }
.ep-button { display: inline-flex; align-items: center; justify-content: center; min-width: 160px; height: 46px; padding: 0 22px; border: 1px solid #d8dcda; border-radius: 999px; background: #fff; color: #1a1d1b; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; }
.ep-button.primary { border-color: #1a1d1b; background: #1a1d1b; color: #fff; }
.ep-button:disabled { opacity: .5; }
.ep-note { margin: 10px 0; color: #6b7570; font-size: 14px; line-height: 1.5; }
.ep-note a { color: #1f7a4d; font-weight: 650; }
.ep-error { margin: 6px 0 0; color: #b42318; font-size: 13px; }
.ep-foot { margin: 36px 0 0; text-align: center; color: #9aa29e; font-size: 12px; }
.ep-missing { text-align: center; padding-top: 12vh; }
.ep-missing h1 { font-size: 22px; }
.ep-missing p { color: #6b7570; }
.ep-viewer { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0,0,0,.92); }
.ep-viewer[hidden] { display: none; }
.ep-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ep-viewer-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 20px; }
.ep-sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; box-sizing: border-box; }
.ep-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(18,22,20,.38); cursor: pointer; }
.ep-sheet { position: relative; z-index: 1; width: min(560px, 100%); max-height: 86%; overflow: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 18px); border-radius: 22px 22px 0 0; background: #fff; color: #1a1d1b; animation: ep-sheet-in .22s ease-out; }
.ep-sheet h2 { margin: 0; font-size: 18px; }
.ep-q { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 650; }
.ep-q p { margin: 0; }
.ep-q textarea, .ep-yesno button, .ep-sheet .ep-button { font-family: inherit; }
.ep-q textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #d8dcda; border-radius: 14px; background: #fff; color: #1a1d1b; font-size: 16px; font-weight: 400; resize: vertical; scroll-margin: 24px; }
.ep-yesno { display: flex; gap: 8px; }
.ep-yesno button { flex: 1; height: 44px; border: 1px solid #d8dcda; border-radius: 14px; background: #fff; color: #1a1d1b; font-size: 16px; font-weight: 700; cursor: pointer; }
.ep-yesno button.is-on { border-color: #1a1d1b; background: #1a1d1b; color: #fff; }
.ep-sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.ep-sheet-actions .ep-button { width: 100%; }
@keyframes ep-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .ep-sheet { animation: none; } }
@media (prefers-color-scheme: dark) {
  .ep-sheet { background: #1b1f1c; color: #eef1ef; }
  .ep-q textarea { background: #121513; color: #eef1ef; border-color: #2f3531; }
  .ep-yesno button { background: #121513; color: #eef1ef; border-color: #2f3531; }
  .ep-yesno button.is-on { background: #eef1ef; color: #121513; border-color: #eef1ef; }
  .ep-sheet .ep-button { background: #121513; color: #eef1ef; border-color: #2f3531; }
  .ep-sheet .ep-button.primary { background: #eef1ef; color: #121513; border-color: #eef1ef; }
  .ep-sheet .ep-note { color: #9aa49e; }
}

