/* =====================================================================
   Kenya Obituaries — "Safari Njema" design system
   Palette: dusk cypress + Nairobi jacaranda + candle amber on cool limestone.
   Signature motifs (used sparingly): arched "window" portraits, the kanga
   stripe, and one clear headstone in a soft-focus graveyard.
   ===================================================================== */
@font-face { font-family: "Lora"; src: url("../fonts/Lora-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --night: #14201D;
  --slate: #1F3A34;
  --slate-2: #2B4A43;
  --paper: #F6F7F5;
  --mist: #ECEFEC;
  --stone: #D3D9D5;
  --granite: #5F6B66;
  --ink: #18211F;
  --jacaranda: #5B4B8A;
  --jacaranda-deep: #46396D;
  --jacaranda-wash: #EEEAF6;
  --candle: #E2A23B;
  --candle-wash: #FBF1DE;
  --danger: #A8423A;
  --ok: #2F6B4F;
  --wa: #1E7E47;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --arch: 999px 999px 10px 10px;
  --shadow: 0 1px 2px rgba(20, 32, 29, .06), 0 8px 24px rgba(20, 32, 29, .07);
  --kanga: repeating-linear-gradient(90deg, var(--jacaranda) 0 22px, var(--candle) 22px 30px, var(--slate) 30px 52px, var(--candle) 52px 60px);
  --step: clamp(1rem, .95rem + .25vw, 1.0625rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step)/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jacaranda-deep); text-underline-offset: 3px; }
a:hover { color: var(--jacaranda); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); }
h3, .h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--candle); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }
.page-pad { padding-block: 1.5rem 4rem; }
.section { margin-block: 2.5rem; }
.center { text-align: center; }
.muted { color: var(--granite); }
.small { font-size: .875rem; }
.sr, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: .5rem; }
.hp { position: absolute; left: -5000px; }
.lede { font-size: 1.12em; color: var(--granite); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: .55em 1.1em; border-radius: var(--r-sm); border: 1px solid transparent; font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--jacaranda); color: #fff; }
.btn-primary:hover { background: var(--jacaranda-deep); color: #fff; }
.btn-dark { background: var(--slate); color: #fff; }
.btn-dark:hover { background: var(--night); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--stone); color: var(--ink); }
.btn-ghost:hover { border-color: var(--granite); color: var(--ink); }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-whatsapp:hover { background: #17663a; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: .35em .8em; font-size: .85rem; }
.btn-lg { min-height: 52px; padding: .7em 1.6em; font-size: 1.05rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--jacaranda-deep); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; }

/* ---------- Header ---------- */
.site-header { background: var(--slate); color: #fff; position: sticky; top: 0; z-index: 40; }
.header-bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark { width: 20px; height: 26px; color: var(--candle); }
.brand-name { font: 600 1.2rem/1 var(--serif); }
.nav { display: flex; gap: 1.1rem; }
.nav a { color: #DCE4E0; text-decoration: none; font-size: .95rem; }
.nav a:hover { color: #fff; text-decoration: underline; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.lang-switch { color: #DCE4E0; font-size: .9rem; }
.lang-switch:hover { color: #fff; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.25); border-radius: var(--r-sm); background: transparent; cursor: pointer; flex-direction: column; justify-content: center; gap: 6px; padding: 0 11px; }
.nav-toggle span { display: block; height: 2px; background: #fff; }
.site-banner { background: var(--candle-wash); color: var(--ink); font-size: .95rem; padding: .55rem 0; }
@media (max-width: 960px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--slate); flex-direction: column; padding: .5rem 1rem 1rem; gap: 0; }
  .nav.is-open { display: flex; }
  .nav a { padding: .75rem 0; border-top: 1px solid rgba(255,255,255,.1); }
  .nav-toggle { display: flex; }
}
@media (max-width: 520px) { .btn-post { padding-inline: .8em; font-size: .85rem; } .lang-switch { display: none; } .brand-name { font-size: 1.05rem; } }

/* ---------- Footer ---------- */
.kanga { height: 8px; background: var(--kanga); }
.site-footer { background: var(--night); color: #C9D3CE; margin-top: 4rem; font-size: .93rem; }
.site-footer a { color: #E7ECE9; text-decoration: none; display: block; padding: .2rem 0; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem; }
.footer-brand { font: 600 1.25rem var(--serif); color: #fff; }
.footer-h { color: #fff; font-weight: 600; margin-bottom: .5rem; }
.contact-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.footer-base { border-top: 1px solid rgba(255,255,255,.1); padding-block: 1rem 2rem; font-size: .85rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Hero + headstone scene (the one bold moment) ---------- */
.hero { background: linear-gradient(180deg, var(--slate) 0%, var(--slate-2) 100%); color: #fff; padding-block: 2.5rem 3rem; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lede { color: #CFDAD5; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .scene { order: -1; max-height: 340px; } .hero { padding-top: 1.25rem; } }

.scene { position: relative; aspect-ratio: 6 / 5.2; border-radius: 18px; overflow: hidden; background: #1B312C; box-shadow: 0 20px 50px rgba(0,0,0,.25); isolation: isolate; }
.scene-bg, .scene-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-photo { filter: blur(5px) saturate(.85) brightness(.85); transform: scale(1.06); }
.stone { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); width: min(62%, 300px); aspect-ratio: 3 / 3.4; border-radius: 999px 999px 6px 6px; text-decoration: none; z-index: 2;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .42 0 0 0 0 .41 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #C9CDC9 0%, #A9AFAA 55%, #8D948F 100%);
  box-shadow: inset -10px -14px 24px rgba(0,0,0,.25), inset 8px 8px 18px rgba(255,255,255,.25), 0 18px 30px rgba(0,0,0,.45); }
.stone::before { content: ""; position: absolute; inset: 7%; border-radius: inherit; border: 1.5px solid rgba(60,66,63,.35); box-shadow: 0 1px 0 rgba(255,255,255,.35); }
.stone-face { position: absolute; inset: 16% 10% 8%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: opacity .7s ease; }
.stone-face.is-fading { opacity: 0; }
.stone-face > span { color: #3B423F; text-shadow: 0 1px 0 rgba(255,255,255,.5), 0 -1px 0 rgba(0,0,0,.35); font-family: var(--serif); }
.stone-pre { font-style: italic; font-size: clamp(.7rem, .6rem + .4vw, .9rem); }
.stone-name { font-weight: 600; font-size: clamp(1rem, .8rem + 1.1vw, 1.45rem); line-height: 1.15; margin: .35em 0; overflow-wrap: anywhere; }
.stone-dates { font-size: clamp(.8rem, .7rem + .4vw, 1rem); letter-spacing: .08em; }
.stone-quote { font-style: italic; font-size: clamp(.68rem, .6rem + .3vw, .85rem); margin-top: .6em; max-width: 22ch; }
.plinth { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); width: min(72%, 350px); height: 5%; background: linear-gradient(#8E9590, #6B726D); border-radius: 3px; z-index: 1; box-shadow: 0 10px 20px rgba(0,0,0,.4); }
.candle { position: absolute; left: calc(50% + min(36%, 175px)); bottom: 10%; width: 14px; height: 30px; background: linear-gradient(90deg, #EDE6D6, #FFF8EA, #D9D0BD); border-radius: 3px; z-index: 3; }
.flame { position: absolute; left: 50%; bottom: 100%; width: 10px; height: 18px; margin-left: -5px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 75%, #FFF7D6 0 25%, #F6C04E 45%, #E2A23B 70%, transparent 72%); box-shadow: 0 0 22px 10px rgba(242,178,72,.35); animation: flicker 2.4s infinite ease-in-out; transform-origin: 50% 90%; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-1deg); } 40% { transform: scale(1.06, .94) rotate(2deg); } 70% { transform: scale(.95, 1.05) rotate(-2deg); } }

/* ---------- Finder (search) ---------- */
.finder { background: #fff; color: var(--ink); border-radius: var(--r); padding: .75rem; box-shadow: var(--shadow); margin-top: 1.5rem; }
.finder-main { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .5rem; }
.finder input, .finder select, .submit-form input, .submit-form select, .submit-form textarea, .stack-form input, .stack-form select, .stack-form textarea, .tribute-form textarea, .tribute-form input, .admin-filter input, .admin-filter select, .search-inline input, .card-form input, .card-form select, .card-form textarea {
  width: 100%; min-height: 46px; padding: .55rem .75rem; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--stone); border-radius: var(--r-sm); }
.finder input:focus, .finder select:focus, .submit-form input:focus, .submit-form select:focus, .submit-form textarea:focus, .stack-form input:focus, .tribute-form textarea:focus, .tribute-form input:focus { outline: none; border-color: var(--jacaranda); box-shadow: 0 0 0 3px var(--jacaranda-wash); }
.finder-name input { font-size: 1.05rem; }
.finder-more { margin-top: .5rem; }
.finder-more summary { cursor: pointer; color: var(--jacaranda-deep); font-size: .92rem; padding: .3rem .25rem; }
.finder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; padding-top: .75rem; }
.finder fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: .35rem; align-items: center; }
.finder legend, .finder .stack > span { font-size: .85rem; color: var(--granite); margin-bottom: .25rem; padding: 0; }
.finder .stack { display: flex; flex-direction: column; }
@media (max-width: 760px) { .finder-main { grid-template-columns: 1fr 1fr; } .finder-name { grid-column: 1 / -1; } .finder-main .btn { grid-column: 1 / -1; } .finder-grid { grid-template-columns: 1fr; } }
.search-inline { display: flex; gap: .5rem; max-width: 520px; margin: 1.5rem auto; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chips.wrapy { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: .4em; padding: .45em .9em; border-radius: 999px; border: 1px solid var(--stone); background: #fff; color: var(--ink); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.chip:hover { border-color: var(--jacaranda); color: var(--jacaranda-deep); }
.chip.is-active { background: var(--slate); border-color: var(--slate); color: #fff; }
.chip .count { color: var(--granite); font-size: .8em; }
.chip.is-active .count { color: #CFDAD5; }
.chip-quiet { border-style: dashed; }

/* ---------- Section heads, today strip ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.section-head a { font-size: .95rem; white-space: nowrap; }
.live-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--candle); margin-right: .5em; vertical-align: middle; box-shadow: 0 0 0 4px var(--candle-wash); }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.today-list a { display: flex; gap: .75rem; align-items: center; padding: .6rem; background: #fff; border-radius: var(--r); text-decoration: none; color: var(--ink); border: 1px solid var(--mist); }
.today-list a:hover { border-color: var(--stone); }
.today-list img { width: 48px; height: 64px; object-fit: cover; border-radius: var(--arch); flex: none; }
.today-list strong { display: block; font-family: var(--serif); }
.today-list small { color: var(--granite); }

/* ---------- Cards (arch portraits) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem 1.25rem; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr 1fr; gap: 1rem .75rem; } }
.card-link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); height: 100%; }
.arch { display: block; border-radius: var(--arch); overflow: hidden; background: var(--mist); aspect-ratio: 3 / 4; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--stone); }
.arch img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25); transition: filter .4s; }
.card-link:hover .arch img, .card-link:focus-visible .arch img { filter: none; }
.card-body { display: flex; flex-direction: column; gap: .15rem; padding: .9rem .1rem 0; }
.card-cat { font-size: .78rem; color: var(--jacaranda-deep); font-weight: 600; }
.card-name { font: 600 1.06rem/1.25 var(--serif); }
.card-life { font-size: .85rem; color: var(--granite); font-variant-numeric: tabular-nums; }
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; font-size: .84rem; color: var(--granite); margin-top: .25rem; }
.when-chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15em .55em; border-radius: 999px; background: var(--jacaranda-wash); color: var(--jacaranda-deep); }
.when-chip.is-today { background: var(--candle-wash); color: #7A4E0A; }
.card-archived .arch { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--mist); }

/* ---------- Home misc ---------- */
.notable-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; }
.notable-list li { background: #fff; border-left: 3px solid var(--candle); padding: .75rem 1rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; display: flex; flex-direction: column; gap: .15rem; }
.notable-list strong { font-family: var(--serif); }
.notable-list span, .notable-list small { color: var(--granite); font-size: .88rem; }
.help-band { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.help-col { background: #fff; border-radius: var(--r); padding: 1.5rem; }
.post-cta { background: var(--jacaranda-wash); border-radius: var(--r); padding: 1.5rem; margin-block: 2rem; }
.help-col.post-cta { margin: 0; }
.link-list { padding-left: 1.1rem; }
.link-list li { margin-bottom: .4rem; }
@media (max-width: 760px) { .help-band { grid-template-columns: 1fr; } }

/* ---------- Page heads, breadcrumbs, pager, empty ---------- */
.page-head { margin-bottom: 1.5rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0 0 .75rem; font-size: .85rem; color: var(--granite); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--stone); }
.crumbs a { color: inherit; }
.pager { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .75rem; border-radius: var(--r-sm); border: 1px solid var(--stone); text-decoration: none; color: var(--ink); background: #fff; }
.pager .current { background: var(--slate); color: #fff; border-color: var(--slate); }
.empty { text-align: center; padding: 3rem 1rem; background: #fff; border-radius: var(--r); }
.empty .btn { margin: .25rem; }
.related-links { margin-top: 3rem; }
.related-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; }
.result-count { margin: 1.25rem 0; color: var(--granite); }

/* ---------- Notes ---------- */
.note { border-radius: var(--r); padding: 1rem 1.25rem; margin-block: 1rem; background: #fff; border-left: 4px solid var(--stone); }
.note p:last-child { margin-bottom: 0; }
.note-ok { border-color: var(--ok); background: #EEF6F1; }
.note-error { border-color: var(--danger); background: #FBEEEC; }
.note-milestone { border-color: var(--candle); background: var(--candle-wash); }
.note-archive { border-color: var(--granite); background: var(--mist); }
.note-upgrade { border-color: var(--jacaranda); background: var(--jacaranda-wash); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.tag { display: inline-block; font-size: .75rem; padding: .1em .5em; border-radius: 4px; background: var(--mist); color: var(--granite); font-weight: 600; vertical-align: middle; }
.tag-warn { background: var(--candle-wash); color: #7A4E0A; }
.tag-ok { background: #EEF6F1; color: var(--ok); }

/* ---------- Notice page ---------- */
.notice-head { position: relative; color: #fff; padding-block: 2rem 2.5rem; background: var(--slate); overflow: hidden; isolation: isolate; }
.notice-head::before { content: ""; position: absolute; inset: -20px; background: var(--lq) center / cover no-repeat; filter: blur(24px) brightness(.5) saturate(.8); z-index: -1; }
.notice-head-grid { display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem; align-items: end; }
.notice-portrait .arch { box-shadow: 0 0 0 6px rgba(255,255,255,.9), 0 20px 40px rgba(0,0,0,.35); }
.notice-head .crumbs ol, .notice-head .crumbs a { color: #CFDAD5; }
.notice-pre { font: italic 1.05rem var(--serif); color: #E4DCF3; margin: 0; }
.notice-name { color: #fff; font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); margin: .1em 0 .2em; overflow-wrap: anywhere; }
.notice-life { font-size: 1.1rem; color: #E7ECE9; font-variant-numeric: tabular-nums; margin-bottom: .3rem; }
.notice-epitaph { font: italic 1.05rem var(--serif); color: #F3E4C3; }
.notice-facts { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.notice-facts li { font-size: .88rem; padding: .25em .7em; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 700px) {
  .notice-head-grid { grid-template-columns: 1fr; text-align: center; gap: 1.25rem; }
  .notice-portrait { width: 62%; max-width: 260px; margin: 0 auto; }
  .notice-facts, .crumbs ol { justify-content: center; }
}
.notice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; margin-top: 2rem; }
@media (max-width: 960px) { .notice-layout { grid-template-columns: 1fr; gap: 1rem; } }
.answer { font: 1.12rem/1.6 var(--serif); padding-left: 1rem; border-left: 3px solid var(--jacaranda); }
.block { margin-block: 2.5rem; }
.story { font: 1.06rem/1.75 var(--serif); max-width: 68ch; }
.story blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--stone); font-style: italic; }

.engage { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-block: 1.5rem; }
.engage-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn-candle, .flowers summary, .reactions button { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: .4em .9em; border-radius: 999px; border: 1px solid var(--stone); background: #fff; font: 600 .92rem var(--sans); color: var(--ink); cursor: pointer; list-style: none; }
.flowers summary::-webkit-details-marker { display: none; }
.btn-candle:hover, .flowers summary:hover, .reactions button:hover { border-color: var(--candle); }
.btn-candle.is-done { background: var(--candle-wash); border-color: var(--candle); }
.count { font-variant-numeric: tabular-nums; color: var(--granite); font-weight: 600; }
.mini-flame { width: 8px; height: 13px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 75%, #FFF7D6 0 25%, #F6C04E 45%, #E2A23B 72%); display: inline-block; }
.flowers { position: relative; }
.flower-pick { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 5; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--stone); border-radius: var(--r); padding: .35rem; box-shadow: var(--shadow); min-width: 170px; }
.flower-pick button { text-align: left; background: none; border: 0; padding: .55rem .6rem; border-radius: var(--r-sm); cursor: pointer; font: inherit; }
.flower-pick button:hover { background: var(--mist); }
.reactions { display: flex; flex-wrap: wrap; gap: .35rem; }
.reactions button { padding: .3em .7em; font-size: 1.05rem; }
.reactions button.is-mine { background: var(--jacaranda-wash); border-color: var(--jacaranda); }
.reactions .count { font-size: .8rem; }

.events { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.event { display: grid; grid-template-columns: 64px 1fr; gap: 1rem; background: #fff; border-radius: var(--r); padding: 1rem; border: 1px solid var(--mist); }
.event.is-past { opacity: .7; }
.event-date { text-align: center; border-radius: var(--arch); background: var(--slate); color: #fff; padding: .7rem .2rem .5rem; align-self: start; }
.event-date .d { display: block; font: 600 1.5rem/1 var(--serif); }
.event-date .m { font-size: .8rem; }
.event-body h3 { margin-bottom: .2rem; }
.event-body p { margin: 0 0 .3rem; }
.venue { font-weight: 600; }
.event-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.map-slot { margin-top: .75rem; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; background: var(--mist); }
.map-slot iframe { width: 100%; height: 100%; border: 0; }
.contrib { background: var(--candle-wash); border-radius: var(--r); padding: 1rem; margin-bottom: 1rem; }
.contrib-text { font-weight: 600; margin-bottom: .4rem; }
.contact-person { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.photo-grid img { border-radius: var(--r-sm); aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo-grid figure { margin: 0; }
.photo-grid figcaption { font-size: .8rem; color: var(--granite); margin-top: .25rem; }
.memory-form { margin-top: 1rem; }
.memory-form summary { list-style: none; display: inline-flex; }
.memory-form summary::-webkit-details-marker { display: none; }
.stack-form { display: grid; gap: .75rem; margin-top: .75rem; }
.stack-form label { display: grid; gap: .3rem; font-size: .92rem; font-weight: 600; }

.tribute-form { background: #fff; border-radius: var(--r); padding: 1rem; border: 1px solid var(--mist); display: grid; gap: .75rem; }
.chip-field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-field legend { font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-block; padding: .4em .85em; border: 1px solid var(--stone); border-radius: 999px; font-size: .88rem; cursor: pointer; background: #fff; }
.chip-radio input:checked + span { background: var(--slate); color: #fff; border-color: var(--slate); }
.chip-radio input:focus-visible + span { outline: 3px solid var(--candle); outline-offset: 2px; }
.tribute-send { display: flex; gap: .5rem; }
.tribute-send .btn { flex: none; }
.tribute-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .75rem; }
.tribute { background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; border: 1px solid var(--mist); }
.tribute.is-prayer { border-left: 3px solid var(--candle); }
.tribute.is-new { animation: arrive .6s ease; }
@keyframes arrive { from { background: var(--candle-wash); } to { background: #fff; } }
.tribute-msg { font-family: var(--serif); margin-bottom: .35rem; }
.tribute-by { font-size: .85rem; color: var(--granite); margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tribute-by strong { color: var(--ink); }

.timeline { list-style: none; padding: 0 0 0 1.25rem; margin: 0; border-left: 2px solid var(--stone); }
.timeline li { position: relative; padding: .2rem 0 .9rem .5rem; }
.timeline li::before { content: ""; position: absolute; left: -1.62rem; top: .55rem; width: 10px; height: 10px; border-radius: 50%; background: var(--slate); border: 2px solid var(--paper); }
.timeline li.is-future::before { background: var(--candle); }
.timeline time { display: block; font-size: .85rem; color: var(--granite); font-variant-numeric: tabular-nums; }
.faq h3 { margin-top: 1.25rem; }
.notice-foot { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; border-top: 1px solid var(--stone); padding-top: 1.25rem; font-size: .92rem; }
.report summary { cursor: pointer; color: var(--granite); }

.notice-side > * + * { margin-top: 1.5rem; }
.share-card { position: sticky; top: 80px; background: #fff; border-radius: var(--r); padding: 1.25rem; border: 1px solid var(--mist); display: grid; gap: .6rem; }
.share-card h2 { font-size: 1.1rem; margin: 0; }
.share-row { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; }
.share-row a, .share-row button { background: none; border: 0; padding: .3rem 0; color: var(--jacaranda-deep); font: inherit; cursor: pointer; text-decoration: underline; }
.side-related h2 { font-size: 1.05rem; }
.side-related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.side-related a { display: flex; gap: .65rem; align-items: center; text-decoration: none; color: var(--ink); }
.side-related img { width: 44px; height: 58px; object-fit: cover; border-radius: var(--arch); }
.side-related small { display: block; color: var(--granite); font-size: .8rem; }
.side-related span { font-family: var(--serif); }
.sticky-actions { display: none; }
@media (max-width: 760px) {
  .is-listing main { padding-bottom: 64px; }
  .sticky-actions { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--night); padding-bottom: env(safe-area-inset-bottom); }
  .sticky-actions a, .sticky-actions button { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 56px; color: #fff; background: none; border: 0; font: 600 .92rem var(--sans); text-decoration: none; cursor: pointer; }
  .sticky-actions > * + * { border-left: 1px solid rgba(255,255,255,.1); }
  .share-card { position: static; }
}

/* ---------- Forms: submit & edit ---------- */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; padding: 0; margin: 0 0 1.5rem; counter-reset: s; }
.stepper li { counter-increment: s; font-size: .82rem; color: var(--granite); padding-top: .6rem; border-top: 4px solid var(--stone); }
.stepper li::before { content: counter(s) ". "; font-weight: 600; }
.stepper li.is-done { border-color: var(--slate); color: var(--ink); }
.stepper li.is-current { border-color: var(--jacaranda); color: var(--ink); font-weight: 600; }
.step { border: 0; padding: 0; margin: 0 0 2rem; min-width: 0; }
.step > legend { font: 600 1.45rem var(--serif); margin-bottom: 1rem; padding: 0; }
.js .submit-form:not(.is-edit) .step { display: none; }
.js .submit-form:not(.is-edit) .step.is-current { display: block; }
.field { margin-bottom: 1.1rem; display: block; }
.label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.req { color: var(--danger); }
.hint { font-size: .86rem; color: var(--granite); margin: .35rem 0 0; }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; margin: .35rem 0 0; }
.has-error input, .has-error select, .has-error textarea, .has-error .editor, [aria-invalid="true"] { border-color: var(--danger) !important; }
.check.has-error { color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.choice-cards, .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.choice, .plan { position: relative; display: block; cursor: pointer; }
.choice input, .plan input { position: absolute; opacity: 0; }
.choice span, .plan > span { display: block; height: 100%; padding: .9rem 1rem; border: 1px solid var(--stone); border-radius: var(--r); background: #fff; }
.choice input:checked + span, .plan input:checked + span { border: 2px solid var(--jacaranda); background: var(--jacaranda-wash); padding: calc(.9rem - 1px) calc(1rem - 1px); }
.choice input:focus-visible + span, .plan input:focus-visible + span { outline: 3px solid var(--candle); outline-offset: 2px; }
.plan .price { float: right; font-weight: 600; }
.plan small { display: block; color: var(--granite); margin-top: .35rem; clear: both; }
.plans-lg .plan > span { padding: 1.5rem; }
.photo-drop { display: flex; gap: 1.25rem; align-items: center; padding: 1rem; border: 2px dashed var(--stone); border-radius: var(--r); background: #fff; }
.photo-drop.is-over { border-color: var(--jacaranda); background: var(--jacaranda-wash); }
.arch-preview { width: 120px; flex: none; }
.editor { border: 1px solid var(--stone); border-radius: var(--r-sm); background: #fff; }
.editor-bar { display: flex; gap: .2rem; padding: .3rem; border-bottom: 1px solid var(--mist); flex-wrap: wrap; }
.editor-bar button { min-width: 38px; min-height: 36px; border: 0; background: none; border-radius: 4px; cursor: pointer; font: 600 .9rem var(--sans); color: var(--ink); }
.editor-bar button:hover { background: var(--mist); }
.editor-area { min-height: 220px; padding: .75rem .9rem; font: 1rem/1.7 var(--serif); outline: none; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--granite); }
.editor-sm { min-height: 120px; }
.editor-lg { min-height: 420px; }
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.thumb { display: grid; gap: .2rem; font-size: .8rem; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); }
.event-row { background: #fff; border: 1px solid var(--mist); border-radius: var(--r); padding: 1rem 1rem .5rem; margin-bottom: .75rem; }
.event-row .field { margin-bottom: .6rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .75rem 0; }
.check input { width: 20px; height: 20px; margin-top: .2rem; flex: none; accent-color: var(--jacaranda); }
.preview { background: var(--mist); border-radius: var(--r); padding: 1rem; margin-block: 1.25rem; }
.preview-card { display: flex; gap: 1rem; align-items: center; }
.preview-card .arch { width: 100px; flex: none; }
.preview-pre { font: italic .9rem var(--serif); color: var(--granite); margin: 0; }
.preview-name { font: 600 1.35rem/1.2 var(--serif); margin: .1rem 0; }
.preview-life { color: var(--granite); margin: 0; font-size: .9rem; }
.preview-epitaph { font: italic .92rem var(--serif); margin: .3rem 0 0; }
.step-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.save-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; border-top: 1px solid var(--stone); padding-top: 1rem; }
.copy-field { width: min(100%, 420px); min-height: 40px; padding: .4rem .6rem; border: 1px solid var(--stone); border-radius: var(--r-sm); font: .85rem var(--sans); }
.edit-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.is-edit h2 { margin-top: 2rem; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.mod-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); }
.mod-pending { outline: 2px solid var(--candle); outline-offset: 4px; border-radius: var(--r-sm); }
.mod-hidden { opacity: .55; }
.mod-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.mod-list li { background: #fff; padding: .75rem; border-radius: var(--r-sm); }
.mod-list li.mod-pending { outline: 0; border-left: 3px solid var(--candle); }
.inline-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.danger-zone { border: 1px solid #E8C7C3; background: #FBF3F2; border-radius: var(--r); padding: 1rem; }
.card-form { background: #fff; border-radius: var(--r); padding: 1.25rem; margin-bottom: 1.5rem; border: 1px solid var(--mist); }
.code-box { background: #fff; border: 2px dashed var(--jacaranda); border-radius: var(--r); padding: 1.25rem; margin: 1.5rem auto; max-width: 440px; }
.code { font: 600 1.5rem var(--sans); letter-spacing: .06em; margin: .3rem 0; user-select: all; }

/* ---------- Directory, guides, messages ---------- */
.fh-tools { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.fh-list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.fh { background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; border: 1px solid var(--mist); }
.fh h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.fh p { margin: 0 0 .5rem; color: var(--granite); }
.distance { margin-left: .5rem; font-weight: 600; color: var(--jacaranda-deep); }
.fh-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.post-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.post-list a { display: block; background: #fff; border-radius: var(--r); padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink); border: 1px solid var(--mist); }
.post-list a:hover { border-color: var(--stone); }
.post-list strong { display: block; font: 600 1.15rem var(--serif); margin-bottom: .25rem; }
.post-list span { color: var(--granite); font-size: .95rem; }
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote { margin: 1.25rem 0; padding: 1rem 1.25rem; background: #fff; border-left: 3px solid var(--jacaranda); border-radius: 0 var(--r) var(--r) 0; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--stone); padding: .5rem; text-align: left; }
.messages { list-style: none; padding: 0; display: grid; gap: .6rem; }
.messages li { background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; border: 1px solid var(--mist); }
.messages p { font-family: var(--serif); margin-bottom: .4rem; }
.msg-actions { display: flex; gap: 1.25rem; font-size: .88rem; }
.relation-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.relation-grid a { display: block; padding: .8rem 1rem; background: #fff; border-radius: var(--r-sm); text-decoration: none; border: 1px solid var(--mist); color: var(--ink); }
.relation-grid a:hover { border-color: var(--jacaranda); }
.contact-cards { list-style: none; padding: 0; display: grid; gap: .5rem; }
.contact-cards li { background: #fff; border-radius: var(--r); padding: 1rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.contact-cards span { color: var(--granite); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--night); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r); z-index: 99; box-shadow: var(--shadow); font-size: .95rem; max-width: calc(100% - 2rem); }

/* ---------- Admin ---------- */
.admin { background: var(--mist); }
.admin-bar { background: var(--night); color: #fff; }
.admin-bar .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; min-height: 52px; font-size: .9rem; }
.admin-bar a { color: #C9D3CE; text-decoration: none; }
.admin-bar a[aria-current] { color: #fff; text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.stat-grid div { background: #fff; padding: 1rem; border-radius: var(--r); }
.stat-grid span { display: block; color: var(--granite); font-size: .85rem; }
.stat-grid strong { font-size: 1.4rem; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--mist); vertical-align: top; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.admin-actions form { margin: 0; }
.admin-filter { display: flex; gap: .5rem; margin-bottom: 1rem; max-width: 600px; }
@media (max-width: 760px) { .admin-table { display: block; overflow-x: auto; } }

/* ---------- Print: a clean notice ---------- */
@media print {
  .site-header, .site-footer, .engage, .notice-side, .tribute-form, .memory-form, .notice-foot, .sticky-actions, .event-actions, .map-slot, .chips { display: none !important; }
  body { background: #fff; }
  .notice-head { background: #fff; color: #000; padding: 0; }
  .notice-head::before { display: none; }
  .notice-name, .notice-pre, .notice-life, .notice-epitaph, .notice-facts li { color: #000; background: none; }
  .notice-layout { display: block; }
  .notice-portrait { width: 200px; }
}

/* =====================================================================
   v3 additions: CTA, 2-step form, Moments tray, lightbox, payment, famous deaths
   ===================================================================== */
.btn-cta { background: var(--candle); color: var(--night); font-weight: 700; }
.btn-cta:hover { background: #F0B54E; color: var(--night); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0 0; color: #CFDAD5; }
@media (max-width: 640px) { .hero-cta { flex-direction: column; align-items: stretch; text-align: center; } .hero-cta .btn { width: 100%; } }
.side-cta { background: var(--candle-wash); border-radius: var(--r); padding: 1.1rem 1.25rem; }
.side-cta p { margin-bottom: .6rem; font-size: .95rem; }

.stepper-2 { grid-template-columns: 1fr 1fr; }
.type-chips { display: grid; gap: .5rem; }
.type-chip { position: relative; cursor: pointer; display: block; }
.type-chip input { position: absolute; opacity: 0; }
.type-chip > span { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .9rem; border: 1px solid var(--stone); border-radius: var(--r); background: #fff; }
.type-chip small { color: var(--granite); font-size: .85rem; }
.type-chip input:checked + span { border: 2px solid var(--jacaranda); background: var(--jacaranda-wash); padding: calc(.7rem - 1px) calc(.9rem - 1px); }
.type-chip input:focus-visible + span { outline: 3px solid var(--candle); outline-offset: 2px; }
@media (min-width: 720px) { .type-chips { grid-template-columns: repeat(3, 1fr); } }
.example { background: var(--mist); border-radius: var(--r-sm); padding: .5rem .8rem; margin: .5rem 0 .75rem; font-size: .92rem; }
.example summary { cursor: pointer; color: var(--jacaranda-deep); font-weight: 600; }
.example p { font-family: var(--serif); margin: .6rem 0 0; }
.more-options { border: 1px dashed var(--stone); border-radius: var(--r); padding: .75rem 1rem; margin: 1rem 0; background: #fff; }
.more-options summary { cursor: pointer; font-weight: 600; color: var(--jacaranda-deep); }
.more-options[open] summary { margin-bottom: 1rem; }
.price s { color: var(--granite); font-weight: 400; margin-right: .3rem; }
.save-badge { display: inline-block; margin-top: .35rem; font-size: .78rem; font-weight: 700; padding: .15em .55em; border-radius: 999px; background: var(--candle-wash); color: #7A4E0A; }
.copy-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.moments { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; padding: .5rem; border-radius: var(--r); border: 2px dashed transparent; transition: border-color .15s, background .15s; }
.moments.is-over { border-color: var(--jacaranda); background: var(--jacaranda-wash); }
@media (max-width: 480px) { .moments { grid-template-columns: repeat(3, 1fr); } }
.slot { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: #fff; border: 1px dashed var(--stone); }
.slot.has-photo { border-style: solid; }
.slot-add { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.slot-plus { font: 300 2rem/1 var(--sans); color: var(--granite); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has-photo .slot-plus { display: none; }
.slot-x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(20,32,29,.75); color: #fff; font-size: 1.1rem; line-height: 30px; text-align: center; cursor: pointer; z-index: 2; }
.slot.is-removed img { opacity: .25; }
.slot.is-removed .slot-x { background: var(--danger); }

html.lb-open { overflow: hidden; }
.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(10,16,14,.94); color: #fff; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(10,16,14,.94); }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; overflow: auto; }
.lightbox img { max-width: 94vw; max-height: 82vh; object-fit: contain; cursor: zoom-in; touch-action: pinch-zoom; }
.lightbox img.is-zoomed { max-width: none; max-height: none; width: 180vw; cursor: zoom-out; }
.lightbox figcaption { padding: .6rem 1rem; font-size: .9rem; color: #DCE4E0; text-align: center; }
.lb-close, .lb-prev, .lb-next { position: fixed; z-index: 2; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; } }
.notice-portrait a, .photo-grid a { display: block; cursor: zoom-in; }

.pay-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(246,247,245,.92); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.pay-overlay[hidden] { display: none; }
.pay-box { max-width: 360px; text-align: center; display: grid; justify-items: center; gap: 1rem; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--jacaranda-wash); border-top-color: var(--jacaranda); animation: spin .9s linear infinite; display: inline-block; }
.spinner-lg { width: 64px; height: 64px; border-width: 5px; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-wait { padding-top: 1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.tips { text-align: left; display: inline-block; margin: 0 auto 1.25rem; }
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

.fd-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem; }
.fd-item a { display: flex; gap: .85rem; align-items: flex-start; padding: .8rem .9rem; background: #fff; border-radius: var(--r); border: 1px solid var(--mist); text-decoration: none; color: var(--ink); height: 100%; }
.fd-item a:hover { border-color: var(--stone); }
.fd-year { flex: none; font: 600 .95rem var(--serif); color: #fff; background: var(--slate); border-radius: var(--arch); padding: .55rem .45rem .45rem; min-width: 3.4rem; text-align: center; }
.fd-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.fd-body strong { font-family: var(--serif); }
.fd-body small { color: var(--granite); font-size: .85rem; }
.fd-meta { font-variant-numeric: tabular-nums; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.month-grid details { background: #fff; border-radius: var(--r); padding: .6rem .9rem; border: 1px solid var(--mist); }
.month-grid summary { cursor: pointer; font-weight: 600; }
.day-links { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; margin-top: .6rem; }
.day-links a { text-align: center; padding: .35rem 0; border-radius: 4px; text-decoration: none; color: var(--ink); background: var(--mist); font-size: .88rem; }
.day-links a:hover { background: var(--jacaranda-wash); }
.day-nav { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; font-size: .95rem; }
.fact-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin: 0 0 1.5rem; }
.fact-box div { background: #fff; border-radius: var(--r); padding: .75rem 1rem; border: 1px solid var(--mist); }
.fact-box dt { font-size: .82rem; color: var(--granite); }
.fact-box dd { margin: 0; font: 600 1.05rem var(--serif); }
.notice-pre-dark { font: italic 1rem var(--serif); color: var(--granite); margin: 0; }
.sample-badge { display: inline-block; background: var(--candle); color: var(--night); font-weight: 700; font-size: .78rem; padding: .2em .6em; border-radius: 4px; }

/* small-screen polish */
@media (max-width: 480px) {
  .wrap, .narrow { width: calc(100% - 1.5rem); }
  .page-pad { padding-top: 1rem; }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn { width: 100%; }
  .event { grid-template-columns: 52px 1fr; padding: .85rem; }
  .tribute-send { flex-direction: column; }
  .notice-foot { flex-direction: column; }
}

/* ===== v4: paper previews, verses, budget ===== */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.paper-card { display: flex; flex-direction: column; gap: .6rem; text-decoration: none; color: var(--ink); }
.paper-preview { display: block; aspect-ratio: 3 / 4; background: #fff; padding: 1.1rem 1rem; font: .74rem/1.55 var(--serif); color: #444; overflow: hidden; box-shadow: var(--shadow); border-top: 4px solid var(--jacaranda); position: relative; }
.paper-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, #fff); }
.paper-preview strong { display: block; text-align: center; font-size: 1rem; color: var(--jacaranda-deep); margin-bottom: .6rem; }
.paper-label { font: 600 1.05rem var(--serif); }
.paper-card:hover .paper-preview { box-shadow: 0 0 0 2px var(--jacaranda), var(--shadow); }
.paper-sheet { background: #fff; box-shadow: var(--shadow); padding: clamp(1.25rem, 4vw, 2.5rem); font: 1.04rem/1.75 var(--serif); border-top: 5px solid var(--jacaranda); margin: 1.5rem 0; }
.paper-sheet-title { text-align: center; font-weight: 600; font-size: 1.3rem; color: var(--jacaranda-deep); }
.btn-row.left { justify-content: flex-start; }
.messages.cards li.is-sw { border-left: 3px solid var(--candle); }
.verse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; margin-bottom: 2rem; }
.verse-card { margin: 0; background: #fff; border-radius: var(--r); padding: 1.25rem 1.25rem 1rem; border: 1px solid var(--mist); display: flex; flex-direction: column; gap: .6rem; }
.verse-card blockquote { margin: 0; font: italic 1.02rem/1.6 var(--serif); }
.verse-card figcaption { font-weight: 600; color: var(--jacaranda-deep); font-size: .92rem; }
.verse-card figcaption.top { order: -1; }
.verse-card.crescent { border-left: 3px solid #1F6B4F; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.budget-summary div { background: #fff; border-radius: var(--r); padding: .8rem 1rem; }
.budget-summary span { display: block; font-size: .82rem; color: var(--granite); }
.budget-summary strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.budget-summary .is-short strong { color: var(--danger); }
.budget-bar { height: 10px; background: var(--stone); border-radius: 999px; margin: .75rem 0 1.25rem; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: var(--ok); width: 0; transition: width .3s; }
.budget-row { display: grid; grid-template-columns: 1fr 130px 44px; gap: .4rem; margin-bottom: .4rem; }
.budget-row input { min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--stone); border-radius: var(--r-sm); font: inherit; }
.budget-row button { border: 1px solid var(--stone); background: #fff; border-radius: var(--r-sm); cursor: pointer; font-size: 1.1rem; }
@media (max-width: 480px) { .budget-summary { grid-template-columns: 1fr; } .budget-row { grid-template-columns: 1fr 100px 44px; } }
@media print { .budget .btn, .budget [data-del], .budget-bar { display: none !important; } .budget-row input { border: 0; } }

.tool-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; margin-bottom: 2rem; }
.tool-grid a { display: block; height: 100%; background: #fff; border-radius: var(--r); padding: 1rem 1.1rem; border: 1px solid var(--mist); border-top: 3px solid var(--candle); text-decoration: none; color: var(--ink); }
.tool-grid a:hover { border-color: var(--stone); border-top-color: var(--jacaranda); }
.tool-grid strong { display: block; font-family: var(--serif); margin-bottom: .2rem; }
.tool-grid span { color: var(--granite); font-size: .9rem; }
