/* base reset (the artifact host supplied these before) */
*, *::before, *::after { box-sizing: border-box; }
:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: a quiet single-column memorial — portrait hero, photo grid, masonry memory wall; separate share, family and full-screen display views. */
:root {
  --bg: #F3F3F0; --surface: #FFFFFF; --fg: #20242A; --muted: #575D65; --line: #DCDCD6;
  --accent: #2E6B66; --accent-fg: #FFFFFF; --tint: #E3EAE7; --danger: #9A3B2E;
  --stage: #121416; --stage-fg: #F1F0EC; --stage-muted: #A8ADB3;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15181B; --surface: #1D2125; --fg: #ECEBE7; --muted: #A6ABB1; --line: #31363B;
  --accent: #74B9AF; --accent-fg: #0F201E; --tint: #22302D; --danger: #E08A7C; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #15181B; --surface: #1D2125; --fg: #ECEBE7; --muted: #A6ABB1; --line: #31363B;
  --accent: #74B9AF; --accent-fg: #0F201E; --tint: #22302D; --danger: #E08A7C; color-scheme: dark }

html, body { background: var(--bg); }
body { color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; }
.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg); font-weight: 500; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* header */
.top { padding-block: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.brand { font-family: var(--display); font-size: 22px; color: var(--fg); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-size: 15px; }
.nav a:not(.btn) { color: var(--fg); text-decoration: none; }

.notice { margin-block: 8px; padding: 12px 16px; border-radius: 12px; background: var(--tint); font-size: 14px; }

/* hero */
.hero { padding-block: 24px 56px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.portrait { flex: 1 1 300px; max-width: 420px; width: 100%; aspect-ratio: 4 / 5; border-radius: 20px; object-fit: cover; background: var(--tint); }
.portrait-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.hero-copy { flex: 1 1 340px; min-width: 0; gap: 18px; }
.hero h1 { font-size: clamp(44px, 7vw, 68px); line-height: 1.04; }
.years { font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tagline { font-family: var(--display); font-size: 22px; line-height: 1.5; max-width: 34ch; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }

.service { background: var(--surface); border-radius: 16px; padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: center; justify-content: space-between; }
.service .when { font-family: var(--display); font-size: 24px; }

section.block { padding-block: 0 64px; gap: 18px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.block-head h2 { font-size: 36px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--tint); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .by { position: absolute; left: 8px; bottom: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(18,20,22,0.7); color: #F1F0EC; font-size: 12px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 28px; border-radius: 16px; border: 1px dashed var(--line); color: var(--muted); }

.wall { columns: 300px 3; column-gap: 16px; }
.memory { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.memory p { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.memory .pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.memory .pics img, .memory .pics video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; display: block; }
.memory .pics.one { grid-template-columns: 1fr; }
.memory .pics.one img, .memory .pics.one video { aspect-ratio: 16 / 10; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--tint); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.who .name { font-weight: 500; font-size: 15px; line-height: 1.3; }
.who .rel { font-size: 13px; color: var(--muted); line-height: 1.3; }

.cta { background: var(--stage); color: var(--stage-fg); border-radius: 20px; padding: 32px; display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.cta h2 { font-size: 30px; }
.cta p { margin: 0; color: var(--stage-muted); max-width: 46ch; }
.cta .btn { background: var(--stage-fg); color: var(--stage); border-color: var(--stage-fg); }
.qrbox { display: flex; align-items: center; gap: 14px; }
.qr { width: 120px; height: 120px; padding: 8px; box-sizing: border-box; border-radius: 12px; background: #FFFFFF; flex: none; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; display: block; }

footer.foot { padding-block: 22px 48px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: 14px; color: var(--muted); }
footer.foot a { color: var(--muted); }

/* share form */
.form { max-width: 560px; margin: 0 auto; padding-block: 8px 64px; gap: 20px; }
.form h1 { font-size: 36px; line-height: 1.15; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lab, legend { font-size: 14px; font-weight: 600; }
.input { min-height: 48px; box-sizing: border-box; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
textarea.input { padding: 10px 12px; min-height: 140px; resize: vertical; line-height: 1.5; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pick { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--tint); }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick .x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(18,20,22,0.75); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.addtile { aspect-ratio: 1 / 1; border-radius: 10px; border: 1.5px dashed var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0 0 8px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.choice:has(input:checked) { border: 2px solid var(--accent); background: var(--surface); }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.choice .t { font-weight: 600; }
.choice .s { font-size: 13px; color: var(--muted); }
.err { color: var(--danger); font-size: 14px; margin: 0; }
.thanks { max-width: 560px; margin: 0 auto; padding-block: 40px 64px; gap: 16px; }
.thanks h1 { font-size: 40px; }

/* family */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--tint); border-radius: 12px; }
.tab { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 9px; background: transparent; padding: 0 14px; cursor: pointer; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--surface); font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border-radius: 14px; padding: 16px; display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; }
.item .body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.item .meta { font-size: 13px; color: var(--muted); }
.item p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.item .thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.item .thumbs img, .item .thumbs video { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.hiddenpill { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--tint); font-size: 12px; font-weight: 600; }
.ptile { display: flex; flex-direction: column; gap: 8px; }
.ptile .tile.dim { opacity: 0.4; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* display mode */
.stage { position: fixed; inset: 0; z-index: 50; background: var(--stage); color: var(--stage-fg); overflow: hidden; font-family: var(--body); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.slide.on { opacity: 1; }
.slide .blur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(36px) brightness(0.45); }
.slide .fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.slide.on .fg.kb { animation: kb 9s ease-out both; }
@keyframes kb { from { transform: scale(1.0); } to { transform: scale(1.05); } }
.slide .quote { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 8vh 12vw; }
.slide .quote p { margin: 0; font-family: var(--display); font-size: clamp(28px, 4.2vw, 64px); line-height: 1.3; white-space: pre-line; }
.slide .quote span { font-size: clamp(18px, 1.8vw, 28px); color: var(--stage-muted); }
.stage .title { position: absolute; top: calc(28px + env(safe-area-inset-top, 0px)); left: max(36px, env(safe-area-inset-left, 0px)); text-shadow: 0 2px 16px rgba(0,0,0,0.6); }
.stage .title .n { font-family: var(--display); font-size: clamp(28px, 3.4vw, 54px); line-height: 1; }
.stage .title .y { font-size: clamp(14px, 1.3vw, 20px); color: var(--stage-muted); }
.stage .cap { position: absolute; left: max(36px, env(safe-area-inset-left, 0px)); bottom: calc(32px + env(safe-area-inset-bottom, 0px)); padding: 6px 16px; border-radius: 999px; background: rgba(18,20,22,0.72); font-size: clamp(14px, 1.3vw, 20px); }
.stage .join { position: absolute; right: max(32px, env(safe-area-inset-right, 0px)); bottom: calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 18px; padding: 14px; border-radius: 18px; background: rgba(18,20,22,0.78); }
.stage .join .qr { width: clamp(96px, 9vw, 150px); height: clamp(96px, 9vw, 150px); }
.stage .join .t { font-size: clamp(16px, 1.6vw, 26px); font-weight: 500; max-width: 15ch; line-height: 1.3; }
.stage .join .u { font-size: clamp(12px, 1vw, 16px); color: var(--stage-muted); margin-top: 4px; overflow-wrap: anywhere; max-width: 22ch; }
.stage .ctrl { position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); display: flex; gap: 8px; transition: opacity 0.4s; }
.stage.idle .ctrl { opacity: 0; }
.stage .ctrl button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); background: rgba(18,20,22,0.7); color: var(--stage-fg); cursor: pointer; }
.stage .new { position: absolute; top: calc(28px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: clamp(13px, 1.2vw, 18px); }
.stage .waiting { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--stage-muted); font-size: 22px; padding: 24px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } .slide.on .fg.kb { animation: none; } }
@media (max-width: 640px) { .stage .join .t { display: none; } }

/* home feed — one dark, photo-first look */
html.homeview, html.homeview body { background: var(--stage); scroll-snap-type: y proximity; }
.home { color: var(--stage-fg); }
.home .eyebrow, .home .small { color: var(--stage-muted); }
.small { font-size: 13px; }
.btn.light { background: var(--stage-fg); color: var(--stage); border-color: var(--stage-fg); }
.cover { position: relative; height: 100svh; min-height: 520px; overflow: hidden; background: var(--stage); scroll-snap-align: start; }
.cover-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,12,0.35) 0%, rgba(10,11,12,0) 28%, rgba(10,11,12,0) 45%, rgba(10,11,12,0.9) 100%); }
.cover-copy { position: absolute; left: 0; right: 0; bottom: 0; max-width: 960px; box-sizing: border-box; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.cover h1 { font-size: clamp(56px, 11vw, 120px); line-height: 0.95; }
.cover .years, .cover .svc { font-size: 18px; color: var(--stage-muted); margin: 0; font-variant-numeric: tabular-nums; }
.cover .tagline { font-family: var(--display); font-size: clamp(19px, 2.2vw, 26px); line-height: 1.45; max-width: 36ch; margin: 0; }
.scrollhint { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(18,20,22,0.5); color: var(--stage-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.feed { display: flex; flex-direction: column; }
.post { position: relative; scroll-snap-align: start; background: var(--stage); border-top: 1px solid rgba(255,255,255,0.06); }
.mpost { height: 100svh; min-height: 480px; overflow: hidden; }
.carousel { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.frame { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; overflow: hidden; }
.frame .blur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(36px) brightness(0.4); }
.frame .fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.count, .mute { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); padding: 4px 12px; border-radius: 999px; background: rgba(18,20,22,0.72); color: var(--stage-fg); font-size: 13px; font-variant-numeric: tabular-nums; }
.count { right: max(16px, env(safe-area-inset-right, 0px)); }
.mute { left: max(16px, env(safe-area-inset-left, 0px)); min-height: 36px; border: 1px solid rgba(255,255,255,0.25); cursor: pointer; }
.arrow { position: absolute; top: 50%; margin-top: -24px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); background: rgba(18,20,22,0.6); color: var(--stage-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.arrow.prev { left: max(16px, env(safe-area-inset-left, 0px)); }
.arrow.next { right: max(16px, env(safe-area-inset-right, 0px)); }
@media (hover: none) { .arrow { display: none; } }
.caption { position: absolute; left: 0; right: 0; bottom: 0; padding-top: 110px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); background: linear-gradient(180deg, rgba(10,11,12,0) 0%, rgba(10,11,12,0.88) 55%); pointer-events: none; }
.caption-inner { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; pointer-events: auto; }
.caption p { margin: 0; font-family: var(--display); font-size: clamp(18px, 2vw, 22px); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.caption p.open { display: block; max-height: 45svh; overflow-y: auto; }
.more { align-self: flex-start; background: none; border: 0; padding: 0; min-height: 32px; color: var(--stage-muted); cursor: pointer; font-size: 14px; }
.home .avatar { background: rgba(255,255,255,0.14); color: var(--stage-fg); }
.home .who .rel { color: var(--stage-muted); }
.dots { display: flex; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.dots span.on { background: var(--stage-fg); }
.qpost { min-height: 100svh; display: flex; align-items: center; }
.q-inner, .end-inner { width: 100%; max-width: 820px; margin: 0 auto; box-sizing: border-box; padding-block: 14svh; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 26px; }
.q-inner .mark { font-family: var(--display); font-size: 110px; line-height: 0.5; height: 44px; color: #74B9AF; }
.q-inner p { margin: 0; font-family: var(--display); font-size: clamp(26px, 3.6vw, 44px); line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.endpost { min-height: 85svh; display: flex; align-items: center; }
.end-inner { gap: 18px; }
.end-inner h2 { font-size: clamp(30px, 4vw, 46px); }
.end-inner p { margin: 0; color: var(--stage-muted); max-width: 46ch; }
.endlinks { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--stage-muted); padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.12); }
.endlinks a { color: var(--stage-muted); }
.homebar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: rgba(18,20,22,0.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--stage-fg); transform: translateY(-110%); transition: transform 0.3s ease; }
.homebar.show { transform: none; }
.hb-brand { font-family: var(--display); font-size: 22px; background: none; border: 0; padding: 0; min-height: 44px; color: inherit; cursor: pointer; }
.hb-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 16px; }
.hb-link { color: var(--stage-fg); text-decoration: none; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
@media (prefers-reduced-motion: reduce) { .scrollhint { animation: none; } .homebar { transition: none; } }

/* hearts, comments, share prompts */
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acts { display: flex; gap: 2px; flex: none; }
.act { min-width: 44px; min-height: 44px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: none; color: var(--stage-fg); cursor: pointer; font-size: 15px; font-variant-numeric: tabular-nums; }
.act svg { width: 27px; height: 27px; transition: transform 0.15s ease; }
.act:active svg { transform: scale(0.85); }
.act.like.on svg { fill: #E8687F; stroke: #E8687F; }
.burst { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; opacity: 0; pointer-events: none; }
.burst svg { width: 100%; height: 100%; fill: rgba(255,255,255,0.94); stroke: none; filter: drop-shadow(0 4px 24px rgba(0,0,0,0.45)); }
.burst.go { animation: burst 0.9s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(0.4); } 20% { opacity: 1; transform: scale(1.06); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.sharepost { min-height: 72svh; display: flex; align-items: center; background: #172321; }
.sp-inner { width: 100%; max-width: 820px; margin: 0 auto; box-sizing: border-box; padding-block: 12svh; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }
.sp-inner h2 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; }
.sp-inner p { margin: 0; color: var(--stage-muted); max-width: 44ch; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--stage-fg); border-color: rgba(255,255,255,0.4); }
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.55); }
.sheet-panel { width: 100%; max-width: 560px; max-height: 80svh; display: flex; flex-direction: column; background: #1B1F22; color: var(--stage-fg); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sheet-head h2 { font-size: 22px; }
.close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.08); color: var(--stage-fg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.clist { flex: 1; min-height: 120px; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.cempty { margin: 0; color: var(--stage-muted); }
.citem { display: flex; gap: 10px; align-items: flex-start; }
.sheet .avatar { width: 32px; height: 32px; font-size: 13px; background: rgba(255,255,255,0.14); color: var(--stage-fg); }
.cbody { flex: 1; min-width: 0; }
.chead { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.chead .name { font-weight: 600; font-size: 14px; }
.ctime { font-size: 12px; color: var(--stage-muted); }
.citem p { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.cdel { flex: none; background: none; border: 0; color: var(--stage-muted); font-size: 13px; min-height: 36px; cursor: pointer; }
.cform { margin: 0; padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px; }
.cform textarea { width: 100%; box-sizing: border-box; min-height: 48px; max-height: 140px; resize: vertical; border-radius: 12px; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.06); color: var(--stage-fg); padding: 10px 12px; }
.cas { font-size: 12px; color: var(--stage-muted); overflow-wrap: anywhere; }

/* reporting */
.act.flag svg { width: 22px; height: 22px; opacity: 0.8; }
.flagform { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.fchoice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1px solid rgba(255,255,255,0.22); border-radius: 12px; cursor: pointer; }
.fchoice:has(input:checked) { border-color: var(--stage-fg); background: rgba(255,255,255,0.06); }
.fchoice input { width: 18px; height: 18px; accent-color: #74B9AF; flex: none; }
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #F1F0EC; color: #121416; font-size: 15px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.ptile.reported .tile { outline: 3px solid var(--danger); outline-offset: 2px; }
.flagnote { display: flex; flex-direction: column; font-size: 13px; color: var(--danger); line-height: 1.35; }

/* family stats */
.stiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stile { background: var(--surface); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.snum { font-family: var(--display); font-size: 40px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.slab { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--tint); }
.segb { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; cursor: pointer; }
.segb[aria-pressed="true"] { background: var(--surface); font-weight: 600; }
.srow { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.srank { width: 22px; flex: none; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.sthumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; background: var(--tint); }
.sbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sbar { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.sbar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.snums { font-size: 14px; font-variant-numeric: tabular-nums; }
.vwrap { overflow-x: auto; background: var(--surface); border-radius: 14px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.vtable th, .vtable td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vtable th { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.vtable tr:last-child td { border-bottom: 0; }
.vtable .num { text-align: right; font-variant-numeric: tabular-nums; }

/* smooth, Instagram-style feed: free momentum scrolling, no snapping, no per-post blur */
html.homeview, html.homeview body { scroll-snap-type: none; }
.home .post, .home .cover { scroll-snap-align: none; }
.mpost { height: auto; min-height: 0; overflow: visible; content-visibility: auto; contain-intrinsic-size: auto 920px; border-top: 0; }
.mpost .frame { position: relative; height: auto; flex: none; background: #0B0C0D; display: flex; justify-content: center; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.mpost .frame .fg { position: static; display: block; width: 100%; height: auto; max-height: 88svh; object-fit: contain; }
.mpost .frame img.fg:not([style*="aspect-ratio"]) { min-height: 40svh; }
.below { padding-top: 12px; padding-bottom: 36px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.below .caption-inner { max-width: 680px; margin: 0 auto; gap: 10px; }
.below p { margin: 0; font-family: var(--display); font-size: clamp(18px, 2vw, 21px); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.below p.open { display: block; }
.snd { position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(18,20,22,0.72); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.snd svg { width: 18px; height: 18px; }
.snd.flash { animation: sndflash 0.6s ease-out; }
@keyframes sndflash { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.qpost, .sharepost { min-height: 0; content-visibility: auto; contain-intrinsic-size: auto 600px; }

/* batch photo picking */
.pick .pst { position: absolute; left: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(18,20,22,0.72); color: #fff; display: flex; align-items: center; justify-content: center; }
.pick .pst svg { width: 16px; height: 16px; stroke-width: 2.4; }
.pick .ring { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pick.error img, .pick.error video { opacity: 0.4; }
.pick .retry { position: absolute; left: 6px; right: 6px; bottom: 6px; min-height: 34px; border: 0; border-radius: 8px; background: #FFFFFF; color: #121416; font-size: 13px; font-weight: 600; cursor: pointer; }
.picks.drag { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 12px; }
.pickcount { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dropnote { display: none; }
@media (hover: hover) and (pointer: fine) { .dropnote { display: inline; } }
.tips summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; font-size: 14px; }
#tipsBody { display: flex; flex-direction: column; gap: 8px; }
.tip { padding: 12px 14px; border-radius: 12px; background: var(--tint); font-size: 14px; line-height: 1.5; }
.tip ol { margin: 6px 0 0; padding-left: 20px; }
.tip p { margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .pick .ring { animation-duration: 2s; } }

/* sign-in sheet */
.authbody { padding: 16px 18px 22px; overflow-y: auto; }
.aform { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.afield { display: flex; flex-direction: column; gap: 6px; }
.afield label { font-size: 14px; font-weight: 600; }
.dinput { min-height: 48px; width: 100%; border-radius: 10px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); color: var(--stage-fg); padding: 0 12px; font-size: 16px; }
.dseg { align-self: flex-start; background: rgba(255,255,255,0.08); }
.dseg .segb { color: var(--stage-fg); }
.dseg .segb[aria-pressed="true"] { background: var(--stage-fg); color: var(--stage); }
.sheet .err { color: #F0A193; }
.authbody code, .notice code { font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface); }

/* upload progress ring */
.pick .ring.prog { border: 0; animation: none; background: conic-gradient(#FFFFFF calc(var(--p) * 1%), rgba(255,255,255,0.28) 0); -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); }

/* delete your own post */
.delrow { display: flex; flex-direction: column; gap: 8px; }
.delrow > .more { color: var(--stage-muted); }
.delconfirm { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.07); }
.delconfirm .row { gap: 8px; }

/* printable sign */
.signbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-block: 8px 20px; }
.signscroll { overflow-x: auto; padding: 0 16px 48px; }
.signsheet { width: 8.5in; margin: 0 auto; }
.page { width: 8.5in; height: 11in; background: #FFFFFF; color: #121416; box-shadow: 0 6px 30px rgba(0,0,0,0.18); overflow: hidden; display: flex; flex-direction: column; }
.sign { display: flex; overflow: hidden; font-family: var(--body); }
.sign .sphoto { object-fit: cover; background: #E3E6E4; display: block; }
.sign .stext { display: flex; flex-direction: column; align-items: center; text-align: center; }
.seyebrow { font-size: 11pt; letter-spacing: 0.14em; text-transform: uppercase; color: #5A6068; }
.sname { font-family: var(--display); line-height: 1; }
.syears { font-size: 13pt; color: #5A6068; }
.sask { font-weight: 600; color: #121416; }
.sqr img, .sqr canvas { width: 100% !important; height: 100% !important; display: block; image-rendering: pixelated; }
.shint { font-size: 10.5pt; color: #5A6068; }
.surl { font-weight: 600; letter-spacing: 0.02em; }
.sign.poster { flex-direction: column; height: 11in; }
.sign.poster .sphoto { width: 100%; height: 4.6in; object-position: center 30%; }
.sign.poster .stext { flex: 1; justify-content: center; gap: 0.12in; padding: 0.3in 0.6in 0.45in; }
.sign.poster .sname { font-size: 54pt; }
.sign.poster .sask { font-size: 20pt; margin-top: 0.1in; }
.sign.poster .sqr { width: 2.6in; height: 2.6in; margin-top: 0.08in; }
.sign.poster .surl { font-size: 15pt; }
.page.cards { justify-content: space-between; }
.sign.card { flex-direction: row; height: 5.45in; }
.sign.card .sphoto { width: 3.3in; height: 100%; object-position: center 30%; }
.sign.card .stext { flex: 1; justify-content: center; gap: 0.08in; padding: 0.3in 0.35in; }
.sign.card .sname { font-size: 36pt; }
.sign.card .sask { font-size: 14pt; margin-top: 0.06in; }
.sign.card .sqr { width: 1.9in; height: 1.9in; margin-top: 0.04in; }
.sign.card .surl { font-size: 12pt; }
.cut { height: 0; border-top: 1.5px dashed #A8ADB3; }
@media print {
  @page { size: letter; margin: 0; }
  html, body { background: #FFFFFF !important; }
  :root { padding: 0 !important; }
  body * { visibility: hidden; }
  .signsheet, .signsheet * { visibility: visible; }
  .signsheet { position: absolute; left: 0; top: 0; margin: 0; }
  .page { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* display mode on phones and portrait screens: keep "Shared by" clear of the QR panel */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
  .stage .cap { top: calc(84px + env(safe-area-inset-top, 0px)); bottom: auto; left: max(20px, env(safe-area-inset-left, 0px)); max-width: calc(100% - 40px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage .title { left: max(20px, env(safe-area-inset-left, 0px)); }
  .stage .join { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); gap: 14px; padding: 12px; }
  .stage .join .qr { width: 96px; height: 96px; }
  .stage .join .u { max-width: none; }
}

/* a memory shown with its photo in display mode */
.stage .memcap { position: absolute; left: max(36px, env(safe-area-inset-left, 0px)); bottom: calc(32px + env(safe-area-inset-bottom, 0px)); max-width: min(56%, 900px); padding: 18px 22px; border-radius: 16px; background: rgba(18,20,22,0.76); display: flex; flex-direction: column; gap: 8px; }
.stage .memcap p { margin: 0; font-family: var(--display); font-size: clamp(18px, 2vw, 32px); line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.stage .memcap span { font-size: clamp(14px, 1.2vw, 20px); color: var(--stage-muted); }
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
  .stage .memcap { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); max-width: none; bottom: calc(148px + env(safe-area-inset-bottom, 0px)); padding: 14px 16px; }
  .stage .memcap p { -webkit-line-clamp: 5; }
}

/* display name on the share form, per-photo notes, family filter */
.asme { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 15px; }
.asme .more { color: var(--accent); min-height: 44px; }
.notes summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; font-size: 14px; }
.notelist { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.noterow { display: flex; align-items: center; gap: 10px; }
.noterow img, .noterow video { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; background: var(--tint); }
.noterow input { flex: 1; min-width: 0; }
.pnote { margin: 0; font-size: 15px; line-height: 1.5; color: var(--stage-fg); white-space: pre-line; overflow-wrap: anywhere; }
.partof { font-size: 13px; color: var(--stage-muted); }

/* sharing waits for a confirmed email or phone */
#view-share.gated #shareForm, #view-share.gated #thanks { display: none; }

/* a gentle prompt to add words to photos */
.nudge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--tint); font-size: 14px; line-height: 1.45; }
.nudge img { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 8px; }
.nudge img:not([src]) { display: none; }

/* obituary */
.obitpost { min-height: 0; background: var(--stage); }
.obitpost .q-inner { padding-block: 72px 56px; gap: 14px; }
.obitname { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; }
.obitpost .years { color: var(--stage-muted); font-size: 17px; }
.obit { display: flex; flex-direction: column; gap: 14px; font-family: var(--display); font-size: clamp(18px, 2vw, 21px); line-height: 1.6; color: var(--stage-fg); }
.obit p { margin: 0; overflow-wrap: anywhere; }
.obitpost .more { color: #74B9AF; font-size: 15px; }

/* tribute import */
.tcheck { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; }
.tcheck input { width: 18px; height: 18px; accent-color: var(--accent); }
.trow { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: start; }
.trow input[type="checkbox"] { width: 20px; height: 20px; margin-top: 12px; accent-color: var(--accent); }
.trow .tfields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trow.off { opacity: 0.5; }
.trow textarea { min-height: 70px; }

/* family members */
.fmrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-radius: 12px; padding: 10px 14px; }
.invitebox { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--tint); }
.invitebox code { word-break: break-all; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface); user-select: all; }

/* feed markers and folded batches */
.feedmark { display: flex; align-items: center; gap: 14px; padding: 28px max(20px, env(safe-area-inset-left, 0px)); color: var(--stage-muted); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--stage); }
.feedmark::before, .feedmark::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.16); }
.seemorebar { display: flex; justify-content: center; padding: 8px 16px 36px; background: var(--stage); }
.seemore { color: var(--stage-fg); border-color: rgba(255,255,255,0.35); }
