/* Remember-me.ph — minimal, mobile-first styles. */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f5f2;
  --ink: #29200a;
  --text: #3b3941;
  --muted: #6b6872;
  --line: #e5e2dd;
  --line-strong: #cfcbc4;
  --accent: #7f5a1c;
  --accent-dark: #57370d;
  --accent-tint: #fbf3dc;
  --gold: linear-gradient(135deg, #ffe998 0%, #dcb95f 50%, #b98c3f 100%);
  --gold-hover: linear-gradient(135deg, #fff0b3 0%, #e4c56f 50%, #c69a4a 100%);
  --on-gold: #33210a;

  --error: #a3333f;
  --error-bg: #fbf1f2;
  --success: #2c6b4f;
  --success-bg: #eff6f2;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --radius: 6px;
  --header-h: 64px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font: 400 16px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); margin: 0 0 .5em; line-height: 1.2; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; }
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.fine-print { font-size: .85rem; color: var(--muted); margin: 16px 0 0; }
.icon { width: 1.2em; height: 1.2em; flex: none; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 1.25em;
  font: 500 .95rem/1 var(--sans);
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 .9em; font-size: .9rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions-center { justify-content: center; }
.text-link { font-weight: 500; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid transparent; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; object-fit: contain; }
.brand-text { font: 600 1.15rem/1 var(--serif); color: var(--ink); white-space: nowrap; }

.header-mobile { display: flex; align-items: center; gap: 8px; }
.scan-fab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 500; font-size: .9rem; text-decoration: none; }
.scan-fab:hover { color: #fff; background: var(--accent-dark); }
.menu-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); cursor: pointer; }
.menu-toggle .icon { width: 20px; height: 20px; }
.menu-toggle .icon-close, .menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.main-nav {
  /* absolute rather than fixed so it sits under the sticky header */
  position: absolute; top: 100%; left: 0; right: 0; z-index: 49;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  display: none; flex-direction: column; gap: 8px;
  padding: 8px var(--gutter) 32px; background: var(--bg); border-top: 1px solid var(--line); overflow-y: auto;
}
.main-nav.is-open { display: flex; }
.nav-links, .nav-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nav-links a, .nav-link {
  display: block; padding: 14px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font: 400 1.05rem/1.3 var(--sans); text-decoration: none; text-align: left;
}
.nav-links a[aria-current="page"], .nav-link[aria-current="page"] { color: var(--accent); }
.nav-button { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nav-actions .btn { margin-top: 16px; }
.inline-form { margin: 0; }

@media (min-width: 900px) {
  .header-mobile { display: none; }
  .main-nav { position: static; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex: 1; height: auto; padding: 0 0 0 40px; border: 0; overflow: visible; }
  .nav-links, .nav-actions { flex-direction: row; align-items: center; gap: 28px; }
  .nav-links a, .nav-link { padding: 6px 0; border: 0; font-size: .95rem; color: var(--text); }
  .nav-links a:hover, .nav-link:hover { color: var(--ink); }
  .nav-links a[aria-current="page"], .nav-link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
  .nav-button { width: auto; border: 0; }
  .nav-actions { gap: 22px; }
  .nav-actions .btn { margin: 0; }
}

/* Messages */
.flash-stack { padding-top: 16px; display: grid; gap: 8px; }
.alert { padding: 12px 14px; border-radius: var(--radius); border-left: 3px solid; font-size: .95rem; }
.alert p { margin: 0; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--accent-tint); color: var(--accent-dark); }
.notice { padding: 12px 14px; margin: 0 0 32px; background: var(--bg-alt); border-radius: var(--radius); font-size: .92rem; color: var(--text); }

/* Sections */
.section { padding: 64px 0; }
.section-flush { padding-top: 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font: 600 clamp(1.6rem, 4vw, 2.1rem)/1.2 var(--serif); margin-bottom: 32px; letter-spacing: -.01em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.section-head .section-title { margin: 0; }
.page-head { padding: 48px 0 32px; }
.page-title { font: 600 clamp(2rem, 6vw, 2.8rem)/1.15 var(--serif); letter-spacing: -.015em; }
.page-lead { font-size: 1.08rem; color: var(--muted); max-width: 40em; margin: 0; }

/* Hero */
.hero { padding: 40px 0 56px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-title { font: 600 clamp(2.5rem, 8vw, 4rem)/1.05 var(--serif); letter-spacing: -.025em; margin-bottom: 20px; }
.hero-lead { font-size: 1.12rem; max-width: 32em; margin: 0; }
.hero-media { margin: 0; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; }
.hero-media img { width: 100%; height: auto; }
@media (min-width: 900px) {
  .hero { padding: 72px 0; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 72px; }
}

/* Steps and columns */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.steps li { border-top: 1px solid var(--ink); padding-top: 16px; }
.step-num { display: block; font: 500 .85rem/1 var(--sans); color: var(--muted); margin-bottom: 12px; letter-spacing: .04em; }
.steps p, .columns p { margin: 0; color: var(--muted); }
.columns { display: grid; gap: 32px; }
.columns > div { border-top: 1px solid var(--line-strong); padding-top: 16px; }
@media (min-width: 760px) {
  .steps, .columns { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .columns-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) { .columns-4 { grid-template-columns: repeat(4, 1fr); } }

/* Products */
.product-grid { display: grid; gap: 40px 28px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product-link { display: block; color: inherit; text-decoration: none; }
.product-media { aspect-ratio: 4 / 3; background: #efede9; border-radius: var(--radius); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding-top: 16px; }
.product-name { font: 600 1.15rem/1.3 var(--serif); margin-bottom: 4px; }
.product-link:hover .product-name { text-decoration: underline; text-underline-offset: 3px; }
.product-tagline { color: var(--muted); font-size: .95rem; margin-bottom: 10px; }
.price { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.price-note { font-weight: 400; font-size: .8rem; color: var(--muted); margin-left: 6px; }
.price-lg { font-size: 1.4rem; margin: 4px 0 20px; }

.breadcrumb { padding: 24px 0; font-size: .9rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.product-detail { display: grid; gap: 32px; padding-bottom: 32px; }
.product-detail-media { background: #efede9; border-radius: var(--radius); overflow: hidden; align-self: start; }
.product-detail-media img { width: 100%; height: auto; }
.product-detail-info .page-title { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 8px; }
.detail-heading { font: 600 .8rem/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 32px 0 12px; }
.plain-list { margin: 0; padding-left: 1.1em; }
.plain-list li { margin-bottom: 6px; }
.spec-list { margin: 0 0 20px; border-top: 1px solid var(--line); }
.spec-list div { display: grid; grid-template-columns: minmax(100px, 35%) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--muted); font-size: .92rem; }
.spec-list dd { margin: 0; color: var(--ink); }
@media (min-width: 900px) { .product-detail { grid-template-columns: 1fr 1fr; gap: 64px; } }

/* Call to action */
.section-cta { border-top: 1px solid var(--line); }
.cta { display: grid; gap: 8px; }
.cta .section-title { margin-bottom: 8px; }
.cta p { margin: 0; max-width: 36em; }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; align-items: end; gap: 40px; } .cta .actions { margin: 0; } }

/* Forms */
.form { display: grid; gap: 18px; margin-top: 24px; }
.form-title { font: 600 1.8rem/1.2 var(--serif); margin-bottom: 6px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .label-row label { font-weight: 500; font-size: .92rem; color: var(--ink); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field input[type=text], .field input[type=search], .field input[type=email], .field input[type=password], .field textarea, .manual-form input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus, .manual-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--error); }
.field-error { margin: 0; color: var(--error); font-size: .86rem; }
.field-hint { margin: 0; color: var(--muted); font-size: .85rem; }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: 10px; }
.field-check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.field-check label { font-weight: 400; color: var(--text); }
.field-check .field-error { grid-column: 1 / -1; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 10px; border: 0; background: none; color: var(--muted); font: 500 .85rem var(--sans); cursor: pointer; }
.password-toggle:hover { color: var(--ink); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn.is-loading { pointer-events: none; }

.contact-grid { display: grid; gap: 40px; }
.contact-info .spec-list { margin: 0; }
.form-panel .form { margin-top: 0; }
.form-panel > .alert { margin-bottom: 18px; }
.form-success { padding: 8px 0; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.6fr; gap: 72px; } }

.auth { padding: 48px var(--gutter) 80px; }
.auth-panel { max-width: 420px; margin: 0 auto; }
.auth-panel > .alert, .auth-panel > .notice { margin: 20px 0 0; }
.auth-panel > .muted:last-child { margin-top: 20px; }

.account-grid { display: grid; gap: 40px; }
.account-grid .detail-heading { margin-top: 0; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1fr 1fr; gap: 72px; } }

/* Scan */
.scan-grid { display: grid; gap: 40px; align-items: start; }
.scanner-view { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: #221b09; }
.scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 16%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 8px; opacity: 0; pointer-events: none; }
.scanner-view.is-scanning .scanner-frame { opacity: 1; }
.scanner-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: #e2d4b4; background: #221b09; }
.scanner-overlay[hidden] { display: none; }
.scanner-overlay p { margin: 0; font-size: .92rem; max-width: 22em; }
.scanner-icon { width: 48px; height: 48px; color: #8e8a98; }
.spinner { width: 28px; height: 28px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.scanner-status { margin-top: 12px; }
.scanner-status[hidden] { display: none; }
.scanned-text { margin-top: 4px !important; font-size: .82rem; word-break: break-all; opacity: .85; }
.scanner-controls { display: grid; gap: 12px; margin-top: 12px; justify-items: center; }
.scanner-controls .btn[hidden] { display: none; }
.file-link { cursor: pointer; font-size: .92rem; }
.scan-side .detail-heading:first-child { margin-top: 0; }
.numbered { margin: 0; padding-left: 1.2em; }
.numbered li { margin-bottom: 8px; }
.manual-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
@media (min-width: 900px) { .scan-grid { grid-template-columns: 1fr 1fr; gap: 72px; } .scanner { max-width: 480px; } }

/* Prose and errors */
.prose h2 { font: 600 1.3rem/1.3 var(--serif); margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.error-page { padding: 96px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 24px; font-size: .92rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; }
.footer-about { margin: 12px 0 0; max-width: 26em; }
.footer-contact { color: var(--muted); }
.footer-contact .fine-print { margin: 0; font-style: italic; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; } }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (min-width: 640px) { :root { --gutter: 32px; } }

/* Sign up options and social sign-in */
.auth-panel-wide { max-width: 560px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.segmented a { padding: 11px 8px; text-align: center; font-weight: 500; font-size: .95rem; color: var(--text); text-decoration: none; }
.segmented a + a { border-left: 1px solid var(--line-strong); }
.segmented a:hover { background: var(--bg-alt); color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--ink); color: #fff; }
.type-note { font-size: .92rem; color: var(--muted); margin: 0 0 8px; }
.optional { font-weight: 400; color: var(--muted); }
.field-status { margin: 0; font-size: .86rem; }
.field-status:empty { display: none; }
.field-status.is-ok { color: var(--success); }
.field-status.is-bad { color: var(--error); }
@media (min-width: 640px) { .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.divider { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.social-buttons { display: grid; gap: 10px; }
.btn-social .icon { width: 18px; height: 18px; }
.step-label { margin: 8px 0 0; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.verified-qr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #cfe3d8; background: var(--success-bg); border-radius: var(--radius); }
.verified-qr strong { display: block; color: var(--success); font-size: .95rem; }
.verified-qr span { font-size: .9rem; color: var(--text); }
.file-link.center { justify-self: center; }
.inline-scanner { display: grid; gap: 10px; }
.inline-scanner[hidden] { display: none; }
.inline-scanner .scanner-view { max-width: 360px; width: 100%; justify-self: center; }

/* Public page of a registered QR code */
.profile-page { padding: 72px 0 96px; }
.profile-initial { width: 96px; height: 96px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-alt); border: 1px solid var(--line); font: 600 2.4rem/1 var(--serif); color: var(--ink); }
.profile-label { margin: 0 0 6px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.profile-soon { margin-top: 32px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.profile-page .notice { margin-top: 32px; }

/* Profile, family and memories */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-alt); border: 1px solid var(--line); }
.avatar-initial { display: inline-grid; place-items: center; font: 600 1rem/1 var(--serif); color: var(--ink); }
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2.6rem; margin: 0 auto 16px; display: grid; }
img.avatar-xl { display: block; }
.account-head { display: flex; align-items: center; gap: 20px; }
.account-head .page-title { margin-bottom: 2px; }
.account-head .muted { margin: 0; }
.account-tabs { display: flex; gap: 24px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.account-tabs a { padding: 10px 0; white-space: nowrap; color: var(--text); text-decoration: none; font-size: .95rem; }
.account-tabs a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.photo-row { display: flex; gap: 16px; align-items: flex-start; }
.photo-row .field { flex: 1; }
.inline-fields { display: flex; align-items: flex-start; gap: 10px; margin-top: 0; }
.field select, .field input[type=date] { width: 100%; min-height: 46px; padding: 10px 12px; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.field select:focus, .field input[type=date]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field input[type=file] { font: 400 .92rem var(--sans); max-width: 100%; }
.people { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.person strong { display: block; color: var(--ink); font-weight: 500; }
.person small { display: block; }
a.person:hover strong { text-decoration: underline; }
.decide { display: flex; gap: 6px; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: 400 .88rem var(--sans); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--error); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 12px; font: .85rem ui-monospace, Menlo, monospace; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-alt); }
.actions form { margin: 0; display: flex; align-items: center; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.feature-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-strong); }
.lock { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 760px) { .feature-list { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
.member-details { text-align: left; margin-top: 32px; }
.memorial-links { text-align: left; }
.memories-title { margin-top: 56px; }
.memory-form { margin: 0 0 32px; }
.memories { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.memories li { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.memory-meta { margin: 0 0 4px; font-size: .9rem; color: var(--muted); }
.memory-meta strong { color: var(--ink); font-weight: 500; }
.memory-body { margin: 0; white-space: normal; }
.form.left { text-align: left; }
.photo-form { margin-bottom: 36px; }
.section-alt .notice { background: var(--bg); }
.form + .detail-heading { margin-top: 36px; }

/* ---------- My Account (premium) ---------- */
.account-hero { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); border-bottom: 1px solid var(--line); padding: 40px 0 32px; }
.account-hero-inner { display: grid; grid-template-columns: auto 1fr; gap: 20px 24px; align-items: center; }
.avatar-form { margin: 0; position: relative; }
.avatar-pick { position: relative; display: block; width: 112px; height: 112px; border-radius: 50%; cursor: pointer; }
.avatar-hero { width: 112px; height: 112px; font-size: 2.6rem; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line-strong); display: grid; }
img.avatar-hero { display: block; }
.avatar-overlay { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(41,32,10, .55); color: #fff; font-size: .78rem; font-weight: 500; letter-spacing: .02em; opacity: 0; transition: opacity .15s; text-align: center; padding: 8px; }
.avatar-pick:hover .avatar-overlay, .avatar-pick:focus-within .avatar-overlay, .avatar-form.is-uploading .avatar-overlay { opacity: 1; }
.avatar-form input:focus-visible + p + .field, .avatar-form input:focus-visible ~ .avatar-pick { outline: 2px solid var(--accent); }
@media (hover: none) { .avatar-overlay { opacity: 1; inset: auto 0 0 0; height: 32px; border-radius: 0 0 56px 56px; padding: 0; font-size: .72rem; } }
.avatar-error .field-error { position: absolute; left: 0; top: calc(100% + 6px); width: 260px; }
.account-name { font: 600 clamp(1.7rem, 4vw, 2.3rem)/1.15 var(--serif); margin: 0 0 4px; letter-spacing: -.01em; }
.account-email { margin: 0 0 12px; color: var(--muted); font-size: .95rem; word-break: break-all; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); white-space: nowrap; }
.badge-pill.is-ok { color: var(--success); border-color: #c6dfd1; background: var(--success-bg); }
.badge-pill.is-warn { color: #8a5a00; border-color: #ecd9b0; background: #fdf7ea; }
.badge-pill.is-accent { color: var(--accent-dark); border-color: #ece3ce; background: var(--accent-tint); }
.account-logout { grid-column: 1 / -1; margin: 0; }
@media (min-width: 760px) {
  .account-hero { padding: 56px 0 40px; }
  .account-hero-inner { grid-template-columns: auto 1fr auto; gap: 32px; }
  .account-logout { grid-column: auto; align-self: start; }
}
.account-tabs { position: sticky; top: var(--header-h); z-index: 20; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin: 0; }
.account-tabs .container { display: flex; gap: 28px; overflow-x: auto; }
.account-tabs a { padding: 14px 0; white-space: nowrap; color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.account-tabs a:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.account-body { padding: 32px var(--gutter) 80px; display: grid; gap: 24px; }
.account-body > .notice { margin: 0; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 24px 20px; scroll-margin-top: calc(var(--header-h) + 64px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-title { font: 600 1.45rem/1.2 var(--serif); margin: 0 0 8px; }
.panel-head .panel-title { margin: 0; }
.panel-grid { display: grid; gap: 28px; margin-top: 12px; }
.panel-grid .detail-heading:first-child { margin-top: 8px; }
@media (min-width: 640px) { .panel { padding: 32px; } }
@media (min-width: 900px) { .panel-grid { grid-template-columns: 1fr 1fr; gap: 48px; } }
.form.compact { margin-top: 0; gap: 14px; }
.inline-fields { display: flex; gap: 8px; }
.inline-fields input { flex: 1; }
.memorial-cards { display: grid; gap: 16px; margin-top: 16px; }
.memorial-card { display: flex; gap: 18px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, var(--bg), var(--bg-alt)); }
.memorial-portrait { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-alt); border: 1px solid var(--line); display: grid; place-items: center; font: 600 2rem/1 var(--serif); color: var(--ink); }
.memorial-card h3 { font: 600 1.3rem/1.2 var(--serif); margin: 0 0 4px; }
.memorial-card p { margin: 0 0 2px; }
.memorial-card .actions { margin-top: 12px; }
.item-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.item-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-list strong { font-weight: 500; color: var(--ink); }
.item-list p { margin: 2px 0 0; }
.break { word-break: break-all; }

/* ---------- Memorial editor ---------- */
.editor-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.editor-head .page-title { margin-bottom: 4px; }
.editor-head .muted { margin: 0; }
.eyebrow-plain { margin: 0 0 8px; font-size: .85rem; color: var(--muted); }
.eyebrow-plain a { color: var(--muted); }
.editor { display: grid; gap: 24px; padding-bottom: 80px; }
.editor-nav { display: flex; gap: 20px; overflow-x: auto; border-bottom: 1px solid var(--line); position: sticky; top: var(--header-h); z-index: 20; background: rgba(255,255,255,.95); }
.editor-nav a { padding: 12px 0; white-space: nowrap; color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
.editor-nav a:hover { color: var(--ink); }
.editor-main { display: grid; gap: 24px; }
@media (min-width: 1000px) {
  .editor { grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
  .editor-nav { flex-direction: column; gap: 2px; border: 0; top: calc(var(--header-h) + 24px); background: none; }
  .editor-nav a { padding: 8px 12px; border-radius: 6px; }
  .editor-nav a:hover { background: var(--bg-alt); }
}
.portrait-row { display: flex; gap: 20px; align-items: center; }
.portrait-pick { position: relative; width: 120px; height: 120px; flex: none; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px dashed var(--line-strong); background: var(--bg-alt); display: grid; place-items: center; }
.portrait-pick img { width: 100%; height: 100%; object-fit: cover; }
.portrait-empty { font-size: .85rem; color: var(--muted); text-align: center; padding: 8px; }
.pick-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; background: rgba(41,32,10,.6); color: #fff; font-size: .75rem; text-align: center; }
.grow { flex: 1; }
.form-row-year { grid-template-columns: 120px 1fr !important; }
@media (max-width: 639px) { .form-row-year { grid-template-columns: 1fr !important; } }
.drop { display: grid; gap: 4px; place-items: center; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--bg-alt); cursor: pointer; text-align: center; transition: border-color .15s, background-color .15s; }
.drop:hover { border-color: var(--accent); background: var(--accent-tint); }
.drop-title { font-weight: 600; color: var(--ink); }
.drop-hint { font-size: .85rem; color: var(--muted); }
.form.is-uploading .drop { opacity: .7; pointer-events: none; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.thumb-grid figure { margin: 0; }
.thumb-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb-grid figcaption { font-size: .82rem; color: var(--muted); margin: 6px 0 2px; }
.field input[type=datetime-local] { width: 100%; min-height: 46px; padding: 10px 12px; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); }

/* ---------- Public memorial page ---------- */
.memorial-hero { padding: 64px 0 40px; background: linear-gradient(180deg, var(--bg-alt), var(--bg)); border-bottom: 1px solid var(--line); }
.memorial-hero-portrait { width: 168px; height: 168px; object-fit: cover; border-radius: 50%; margin: 0 auto 20px; box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line-strong); }
.memorial-name { font: 600 clamp(2.2rem, 7vw, 3.4rem)/1.1 var(--serif); letter-spacing: -.015em; margin: 0 0 6px; }
.memorial-years { font: 400 1.3rem/1.3 var(--serif); color: var(--text); margin: 0 0 6px; letter-spacing: .04em; }
.memorial-hero .muted { margin: 0 0 4px; }
.memorial-body { padding-top: 8px; }
.memorial-section { padding: 40px 0 8px; }
.memorial-heading { font: 600 1.5rem/1.2 var(--serif); margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.memorial-bio { font-size: 1.05rem; line-height: 1.8; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .92rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-year { font: 600 1.05rem/1.4 var(--serif); color: var(--accent); }
.timeline strong { font-weight: 500; color: var(--ink); }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.memorial-wide .container { max-width: 720px; }
.year-strip { display: flex; gap: 16px; overflow-x: auto; padding: 4px max(var(--gutter), calc((100vw - 720px) / 2)) 16px; scroll-snap-type: x mandatory; }
.year-strip figure { margin: 0; flex: 0 0 200px; scroll-snap-align: start; }
.year-strip img { width: 200px; height: 240px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.year-strip figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.year-strip figcaption strong { display: block; font: 600 1.1rem/1.2 var(--serif); color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; transition: opacity .15s; }
.gallery a:hover img { opacity: .85; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.place-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .place-grid { grid-template-columns: 1fr 1fr; } }
.place-card { border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.place-card h3 { font: 600 .8rem/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.place-card p { margin: 0 0 6px; }
.place-card .actions { margin-top: 12px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.memories li .grow { min-width: 0; }

[hidden] { display: none !important; }

/* Bigger profile photo with Save / Cancel */
.avatar-form { display: grid; justify-items: center; gap: 10px; }
.avatar-pick, .avatar-hero { width: 160px; height: 160px; }
.avatar-hero { font-size: 3.6rem; }
.avatar-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.avatar-actions { display: flex; gap: 8px; }
.avatar-error .field-error { position: static; width: auto; max-width: 220px; text-align: center; }
@media (max-width: 759px) {
  .account-hero-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .badges { justify-content: center; }
  .account-logout { justify-self: center; }
}
.achievements { list-style: none; margin: 0; padding: 0; }
.achievements li { padding: 12px 0 12px 18px; border-bottom: 1px solid var(--line); position: relative; }
.achievements li::before { content: ''; position: absolute; left: 0; top: 21px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.achievements strong { font-weight: 500; color: var(--ink); }
.achievements p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.memorial-epitaph { font: italic 400 1.35rem/1.3 var(--serif); color: var(--text); margin: 0 0 8px; }
.memorial-card-epitaph { font: italic 400 1rem/1.3 var(--serif); color: var(--text); margin: 0 0 4px !important; }

/* ---------- Photo viewer and slideshow ---------- */
.heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.heading-row h2 { font: inherit; margin: 0; }
.slideshow-link { color: var(--accent); }
.gallery a { position: relative; display: block; overflow: hidden; border-radius: 6px; background: var(--bg-alt); cursor: zoom-in; }
.gallery img { transition: transform .4s ease, opacity .2s; }
.gallery a:hover img { transform: scale(1.04); opacity: 1; }
.year-strip a { cursor: zoom-in; display: block; }
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto; background: #191306; color: #f8f5ee; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.viewer-count { font-size: .9rem; color: #e4cc95; letter-spacing: .05em; }
.viewer-tools { display: flex; gap: 8px; }
.viewer-btn { height: 38px; padding: 0 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: transparent; color: #fff; font: 500 .88rem var(--sans); cursor: pointer; }
.viewer-btn:hover { background: rgba(255,255,255,.1); }
.viewer-close { width: 38px; padding: 0; font-size: 1rem; }
.viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 56px; }
.viewer-figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; justify-items: center; gap: 12px; min-height: 0; }
.viewer-figure img { max-width: min(1400px, 100%); max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.5); opacity: 0; transition: opacity .35s ease; }
.viewer-figure img.is-in { opacity: 1; }
.viewer-figure figcaption { font: italic 400 1.1rem/1.4 var(--serif); color: #ede4d0; text-align: center; max-width: 60ch; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px; }
.viewer-nav:hover { background: rgba(255,255,255,.18); }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }
.viewer.single .viewer-nav, .viewer.single [data-v=play] { display: none; }
.viewer-progress { height: 3px; background: rgba(255,255,255,.08); }
.viewer-progress span { display: block; height: 100%; width: 0; background: #e0d1ae; }
@media (max-width: 639px) {
  .viewer-stage { padding: 0 8px; }
  .viewer-nav { top: auto; bottom: 8px; transform: none; }
  .viewer-prev { left: 25%; } .viewer-next { right: 25%; }
  .viewer-figure img { max-height: calc(100dvh - 220px); }
}
/* Crossfade between photos */
.viewer-frame { display: grid; place-items: center; min-height: 0; }
.viewer-frame img { grid-area: 1 / 1; transition: opacity 1.4s ease-in-out; }
.viewer-figure figcaption { opacity: 0; }
.viewer-figure figcaption.is-in { animation: caption-in 1.4s ease-in-out forwards; }
@keyframes caption-in { from { opacity: 0; } to { opacity: 1; } }
.avatar-md { width: 48px; height: 48px; font-size: 1.1rem; }
.memory-meta .badge-pill { padding: 1px 8px; font-size: .72rem; }
.memory-meta a { color: var(--ink); }

/* ---------- Albums and photo cards ---------- */
.gallery-toolbar { display: flex; justify-content: flex-end; margin: -6px 0 16px; }
.album { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: linear-gradient(180deg, var(--bg), var(--bg-alt)); margin-bottom: 18px; }
.album-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.album-title { font: 600 1.2rem/1.2 var(--serif); margin: 0 0 2px; }
.photo-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 1px 2px rgba(41,32,10,.05), 0 6px 18px rgba(41,32,10,.06); transition: transform .2s ease, box-shadow .2s ease; overflow: hidden; }
.photo-card img { border-radius: 6px; display: block; }
a.photo-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(41,32,10,.06), 0 12px 28px rgba(41,32,10,.12); }
.gallery { gap: 12px; }
.gallery .photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery a.photo-card:hover img { transform: none; }
.year-strip figure.photo-card { padding: 8px 8px 10px; flex: 0 0 216px; }
.year-strip figure.photo-card img { width: 200px; height: 240px; border: 0; }
.year-strip figure.photo-card figcaption { padding: 0 4px; }
@media (max-width: 639px) { .album { padding: 12px; } .gallery { gap: 8px; } .photo-card { padding: 4px; } }
/* Editor */
.album-create { margin-bottom: 20px; }
.album-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; background: var(--bg); scroll-margin-top: calc(var(--header-h) + 64px); }
.album-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.album-card-head .muted { margin-right: auto; }
.album-card-title { font: 600 1.1rem/1.2 var(--serif); margin: 0; }
.album-rename { display: flex; align-items: center; gap: 8px; }
.album-rename input { font: 600 1.05rem var(--serif); color: var(--ink); border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; background: transparent; min-width: 0; width: 220px; }
.album-rename input:hover, .album-rename input:focus { border-color: var(--line-strong); background: #fff; outline: none; }
.link-button.danger:hover { color: var(--error); }
.thumb-grid .photo-card { padding: 5px; }
.thumb-grid .photo-card img { border: 0; }

/* ---------- Facebook-style album folders ---------- */
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 18px; margin-top: 8px; }
@media (min-width: 640px) { .album-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .panel .album-grid { grid-template-columns: repeat(4, 1fr); } }
.album-tile { display: grid; gap: 2px; color: inherit; text-decoration: none; align-content: start; }
.album-cover { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 5px; box-shadow: 0 1px 2px rgba(41,32,10,.05), 0 6px 16px rgba(41,32,10,.07); margin-bottom: 10px; transition: transform .2s ease, box-shadow .2s ease; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
/* Stacked look for albums with several photos */
.album-cover.is-stack::before, .album-cover.is-stack::after { content: ''; position: absolute; left: 8px; right: 8px; height: 100%; border-radius: 10px; background: #fff; border: 1px solid var(--line); z-index: -1; }
.album-cover.is-stack::before { top: -6px; left: 12px; right: 12px; }
.album-cover.is-stack::after { top: -11px; left: 18px; right: 18px; background: var(--bg-alt); }
.album-tile { isolation: isolate; padding-top: 11px; }
a.album-tile:hover .album-cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(41,32,10,.06), 0 14px 30px rgba(41,32,10,.13); }
.album-name { font-weight: 600; color: var(--ink); font-size: .98rem; line-height: 1.3; }
a.album-tile:hover .album-name { text-decoration: underline; text-underline-offset: 3px; }
.album-count { font-size: .85rem; color: var(--muted); }
.album-empty { display: grid; place-items: center; height: 100%; border-radius: 6px; background: var(--bg-alt); color: var(--muted); font-size: .85rem; text-align: center; }
.album-new { gap: 8px; }
.album-cover-new { display: grid; place-items: center; font-size: 2.6rem; font-weight: 300; color: var(--muted); border-style: dashed; box-shadow: none; background: var(--bg-alt); margin-bottom: 4px; }
.album-new input { width: 100%; min-height: 38px; padding: 6px 10px; font: 400 .92rem var(--sans); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.album-new input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.back-link { display: inline-block; margin-bottom: 14px; font-size: .92rem; font-weight: 500; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* New album button tile and dialog */
button.album-tile { background: none; border: 0; padding: 11px 0 0; text-align: left; font: inherit; cursor: pointer; }
button.album-tile:hover .album-cover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.modal { width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 0; box-shadow: 0 24px 60px rgba(41,32,10,.25); }
.modal::backdrop { background: rgba(25,19,6,.55); }
.modal-form { padding: 24px; margin: 0; }
.modal-form .panel-title { margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Yearly photos: one card per year, 1–3 photos ---------- */
.year-strip figure.year-card { flex: 0 0 236px; padding: 8px 8px 10px; }
.year-photos { display: grid; gap: 4px; width: 220px; height: 260px; border-radius: 6px; overflow: hidden; }
.year-photos a { display: block; min-height: 0; cursor: zoom-in; }
.year-photos img, .year-strip figure.year-card .year-photos img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; display: block; }
.year-photos.n2 { grid-template-rows: 1fr 1fr; }
.year-photos.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 3fr 2fr; }
.year-photos.n3 a:first-child { grid-column: 1 / -1; }
.year-card figcaption { display: grid; gap: 2px; margin-top: 8px; font-size: .88rem; color: var(--muted); padding: 0 4px; }
.year-card figcaption strong { font: 600 1.15rem/1.2 var(--serif); color: var(--ink); }
/* Editor list */
.year-list { margin-top: 20px; display: grid; gap: 14px; }
.year-row { border-top: 1px solid var(--line); padding-top: 12px; }
.year-row-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.year-row-head strong { font: 600 1.15rem/1 var(--serif); color: var(--ink); }
.year-row .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 160px)); margin: 0; }

/* ---------- New album window (refined) ---------- */
.modal { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 0; border-radius: 16px; padding: 0; overflow: hidden; box-shadow: 0 30px 80px rgba(38,30,10,.35), 0 0 0 1px rgba(38,30,10,.06); }
.modal[open] { animation: modal-in .22s cubic-bezier(.2,.8,.2,1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal::backdrop { background: rgba(34,26,8,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-form { display: grid; padding: 0; margin: 0; max-height: inherit; }
.modal-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-tint), var(--bg)); }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.modal-icon svg { width: 22px; height: 22px; }
.modal-title { font: 600 1.35rem/1.2 var(--serif); margin: 0; color: var(--ink); }
.modal-sub { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.modal-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; align-self: start; }
.modal-x:hover { background: var(--bg-alt); color: var(--ink); }
.modal-body { display: grid; gap: 18px; padding: 22px 24px; overflow-y: auto; }
.field-label { font-weight: 500; font-size: .92rem; color: var(--ink); }
.modal-drop { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--bg-alt); cursor: pointer; text-align: center; transition: border-color .15s, background-color .15s; }
.modal-drop:hover { border-color: var(--accent); background: var(--accent-tint); }
.modal-drop-icon { width: 34px; height: 34px; color: var(--accent); }
.modal-drop-title { font-weight: 600; color: var(--ink); }
.modal-drop-hint { font-size: .82rem; color: var(--muted); }
.modal-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; margin-top: 4px; }
.modal-previews img, .modal-more { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.modal-more { display: grid; place-items: center; font-weight: 600; color: var(--muted); background: var(--bg-alt); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--bg-alt); }
@media (max-width: 480px) { .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; } .modal-foot .btn { flex: 1; } }

/* ---------- Bulk select and delete ---------- */
.bulk-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); }
.bulk-bar.has-selection { border-color: #f0c9cf; background: var(--error-bg); }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.bulk-all input, .tile-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.bulk-count { margin-right: auto; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #8a2733; color: #fff; }
.btn-danger[disabled] { background: var(--line-strong); color: #fff; opacity: 1; cursor: not-allowed; }
.album-tile-wrap { position: relative; }
.tile-check { position: absolute; top: 18px; left: 8px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; }
.photo-card.selectable { position: relative; }
.photo-card.selectable .tile-check { top: 10px; left: 10px; }
.album-tile-wrap.is-selected .album-cover, .photo-card.is-selected { outline: 3px solid var(--error); outline-offset: 2px; }

/* Small line icons in the main navigation */
.nav-links a, .nav-link { display: flex; align-items: center; gap: 8px; }
.nav-icon { width: 18px; height: 18px; stroke-width: 1.5; color: var(--muted); flex: none; transition: color .15s, transform .15s; }
.nav-links a:hover .nav-icon, .nav-link:hover .nav-icon { color: var(--accent); transform: translateY(-1px); }
.nav-links a[aria-current="page"] .nav-icon, .nav-link[aria-current="page"] .nav-icon { color: var(--accent); }
@media (min-width: 900px) {
  .nav-links a, .nav-link { gap: 6px; }
  .nav-icon { width: 16px; height: 16px; }
}

/* Nav icons: a bit bigger and bolder, and each one moves on hover (desktop) or tap (phone) */
.nav-icon, .nav-links a .nav-icon, .nav-link .nav-icon { width: 20px; height: 20px; stroke-width: 2; color: var(--ink); opacity: .75; transform-origin: 50% 60%; }
@media (min-width: 900px) { .nav-icon { width: 20px; height: 20px; } }
.nav-links a:hover .nav-icon, .nav-link:hover .nav-icon,
.nav-links a:focus-visible .nav-icon, .nav-link:focus-visible .nav-icon,
.nav-links a:active .nav-icon, .nav-link:active .nav-icon { color: var(--accent); opacity: 1; transform: none; }
.nav-links a[aria-current="page"] .nav-icon, .nav-link[aria-current="page"] .nav-icon { color: var(--accent); opacity: 1; }

@keyframes ni-bounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-4px); } 60% { transform: translateY(0); } 80% { transform: translateY(-1.5px); } }
@keyframes ni-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } }
@keyframes ni-tilt { 0%, 100% { transform: rotate(0) translateX(0); } 40% { transform: rotate(-10deg) translateX(-1px); } 70% { transform: rotate(6deg) translateX(1px); } }
@keyframes ni-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2px) rotate(-6deg); } 40% { transform: translateX(2px) rotate(6deg); } 60% { transform: translateX(-1px); } 80% { transform: translateX(1px); } }
@keyframes ni-pop { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.22); } 70% { transform: scale(.95); } }
@keyframes ni-slide { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

.nav-links a:is(:hover, :focus-visible, :active) .ni-home { animation: ni-bounce .6s ease; }
.nav-links a:is(:hover, :focus-visible, :active) .ni-bag { animation: ni-wiggle .6s ease; }
.nav-links a:is(:hover, :focus-visible, :active) .ni-map { animation: ni-tilt .6s ease; }
.nav-links a:is(:hover, :focus-visible, :active) .ni-handshake { animation: ni-pop .6s ease; }
.nav-links a:is(:hover, :focus-visible, :active) .ni-mail { animation: ni-tilt .6s ease; }
.nav-link:is(:hover, :focus-visible, :active) .ni-lock { animation: ni-shake .5s ease; }
.nav-link:is(:hover, :focus-visible, :active) .ni-user, .nav-link:is(:hover, :focus-visible, :active) .ni-user-plus { animation: ni-pop .5s ease; }
.nav-link:is(:hover, :focus-visible, :active) .ni-log-out { animation: ni-slide .6s ease; }
/* On phones there is no hover: play the same animation when the menu opens, one after another. */
@media (max-width: 899px) {
  .main-nav.is-open .nav-links li:nth-child(1) .nav-icon { animation: ni-bounce .6s ease .15s; }
  .main-nav.is-open .nav-links li:nth-child(2) .nav-icon { animation: ni-wiggle .6s ease .25s; }
  .main-nav.is-open .nav-links li:nth-child(3) .nav-icon { animation: ni-tilt .6s ease .35s; }
  .main-nav.is-open .nav-actions .nav-link .nav-icon { animation: ni-pop .5s ease .45s; }
}
@media (prefers-reduced-motion: reduce) { .nav-icon { animation: none !important; } }

/* ---------- Memorial hero: large photo left, details right ---------- */
.memorial-hero { padding: 48px 0 44px; text-align: left; background: radial-gradient(120% 90% at 0% 0%, var(--accent-tint), transparent 60%), linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.memorial-hero-grid { display: grid; gap: 28px; align-items: center; max-width: 1000px; }
.memorial-photo { margin: 0; justify-self: center; width: min(320px, 78vw); aspect-ratio: 4 / 5; border-radius: 18px; background: #fff; padding: 8px; box-shadow: 0 2px 6px rgba(41,32,10,.06), 0 24px 60px rgba(41,32,10,.16); }
.memorial-photo a { display: block; height: 100%; cursor: zoom-in; overflow: hidden; border-radius: 12px; }
.memorial-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; transition: transform .6s ease; }
.memorial-photo a:hover img { transform: scale(1.04); }
.memorial-photo-initial { display: grid; place-items: center; height: 100%; border-radius: 12px; background: linear-gradient(160deg, var(--accent-tint), var(--bg-alt)); font: 600 6rem/1 var(--serif); color: var(--accent); }
.memorial-intro { text-align: center; }
.memorial-intro .profile-label { letter-spacing: .14em; }
.memorial-intro .memorial-name { font-size: clamp(2.4rem, 7vw, 3.8rem); }
.memorial-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 22px 0 6px; text-align: left; }
.memorial-facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.8); }
.memorial-facts dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 3px; }
.memorial-facts dd { margin: 0; color: var(--ink); font-weight: 500; font-size: .95rem; }
.memorial-intro .actions { justify-content: center; }
@media (min-width: 820px) {
  .memorial-hero { padding: 72px 0 64px; }
  .memorial-hero-grid { grid-template-columns: 340px 1fr; gap: 56px; }
  .memorial-photo { width: 340px; }
  .memorial-intro { text-align: left; }
  .memorial-intro .actions { justify-content: flex-start; }
}

/* Entrance animation when the page opens, staggered */
.reveal-in { opacity: 0; transform: translateY(14px); animation: reveal-in .7s cubic-bezier(.2,.7,.2,1) forwards; }
.memorial-photo.reveal-in { transform: translateY(14px) scale(.97); }
.reveal-in.d0 { animation-delay: 0ms; } .reveal-in.d1 { animation-delay: 120ms; } .reveal-in.d2 { animation-delay: 200ms; }
.reveal-in.d3 { animation-delay: 280ms; } .reveal-in.d4 { animation-delay: 340ms; } .reveal-in.d5 { animation-delay: 420ms; } .reveal-in.d6 { animation-delay: 500ms; }
@keyframes reveal-in { to { opacity: 1; transform: none; } }
/* Sections fade up while scrolling */
.js-reveal-scroll .reveal-on-scroll { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js-reveal-scroll .reveal-on-scroll.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-in { opacity: 1; transform: none; animation: none; } }

/* Sections below: soft cards */
.memorial-body .memorial-section { padding: 28px; margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 1px 2px rgba(41,32,10,.04), 0 8px 24px rgba(41,32,10,.05); }
.memorial-body .memorial-section .memorial-heading { margin-top: 0; }
@media (max-width: 639px) { .memorial-body .memorial-section { padding: 18px; } }
.memorial-hero-grid { margin-left: auto; margin-right: auto; }

/* ---------- Background music ---------- */
.music-player { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; justify-items: end; gap: 10px; }
.music-toggle { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 500 .95rem var(--sans); cursor: pointer; box-shadow: 0 10px 28px rgba(158,123,40,.35); transition: transform .2s ease, background-color .2s; }
.music-toggle:hover { background: var(--accent-dark); transform: translateY(-2px); }
.music-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 16px; height: 14px; }
.music-eq i { display: block; width: 3px; height: 4px; border-radius: 2px; background: #fff; }
.music-player.is-playing .music-eq i { animation: music-eq .9s ease-in-out infinite; }
.music-player.is-playing .music-eq i:nth-child(2) { animation-delay: .2s; }
.music-player.is-playing .music-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes music-eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.music-card { width: min(320px, calc(100vw - 36px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(41,32,10,.2); overflow: hidden; }
.music-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.music-note { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); font-size: .9rem; }
.music-title { flex: 1; min-width: 0; font-size: .9rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.music-frame iframe { display: block; width: 100%; border: 0; }
@media (max-width: 639px) { .music-player { right: 12px; bottom: 12px; } .music-toggle { height: 42px; } }
@media (prefers-reduced-motion: reduce) { .music-player.is-playing .music-eq i { animation: none; height: 10px; } }
/* Editor */
.music-current { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); }
.music-current strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.music-current audio { width: 100%; max-width: 360px; height: 36px; }
.music-badge { flex: none; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: #fff; background: var(--accent); }
.music-badge.music-youtube { background: #c4302b; }
.music-badge.music-spotify { background: #1db954; }
.music-tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.music-tabs button { border: 0; background: var(--bg); padding: 8px 14px; font: 500 .9rem var(--sans); color: var(--text); cursor: pointer; }
.music-tabs button + button { border-left: 1px solid var(--line-strong); }
.music-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

/* ---------- Simple memorial layout (photo, name, dates, tabs) ---------- */
.memorial-simple .ms-head { padding: 40px 0 26px; background: radial-gradient(90% 80% at 50% 0%, var(--accent-tint), transparent 70%), linear-gradient(180deg, var(--bg-alt), var(--bg)); text-align: center; }
.ms-photo { margin: 0 auto 18px; width: 190px; aspect-ratio: 4 / 5; padding: 7px; background: #fff; border-radius: 6px; box-shadow: 0 2px 4px rgba(41,32,10,.08), 0 18px 40px rgba(41,32,10,.18); transform: rotate(-1.2deg); }
.ms-photo a { display: block; height: 100%; overflow: hidden; border-radius: 3px; cursor: zoom-in; }
.ms-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ms-photo a:hover img { transform: scale(1.05); }
.ms-photo-initial { display: grid; place-items: center; height: 100%; border-radius: 3px; background: linear-gradient(160deg, var(--accent-tint), var(--bg-alt)); font: 600 4.5rem/1 var(--serif); color: var(--accent); }
.ms-label { margin: 0 0 4px; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ms-name { font: 600 clamp(1.9rem, 6vw, 2.6rem)/1.15 var(--serif); margin: 0 0 6px; letter-spacing: -.01em; }
.ms-dates { margin: 0; font-size: 1rem; color: var(--text); letter-spacing: .02em; }
.ms-epitaph { margin: 10px 0 0; font: italic 400 1.15rem/1.4 var(--serif); color: var(--text); }
.ms-head .btn { margin-top: 14px; }

.ms-tabs { position: sticky; top: var(--header-h); z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ms-tabs-inner { display: flex; justify-content: center; gap: 8px; max-width: 720px; margin: 0 auto; padding: 10px var(--gutter); overflow-x: auto; }
.ms-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; background: var(--bg); box-shadow: 0 1px 2px rgba(41,32,10,.08), 0 3px 10px rgba(41,32,10,.06); transition: background-color .2s, color .2s, transform .2s; white-space: nowrap; }
.ms-tabs a:hover { color: var(--ink); transform: translateY(-1px); }
.ms-tabs a.is-active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(158,123,40,.3); }
.ms-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-tint); color: var(--accent); font-size: .7rem; letter-spacing: 0; }
.ms-tabs a.is-active .ms-count { background: rgba(255,255,255,.25); color: #fff; }

/* With JavaScript only the chosen tab shows */
.js-tabs .ms-panel { display: none; }
.js-tabs .ms-panel.is-active { display: block; animation: ms-fade .35s ease; }
@keyframes ms-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.memorial-simple .memorial-body { padding-top: 4px; padding-bottom: 56px; }
@media (max-width: 639px) { .ms-photo { width: 160px; } .ms-tabs a { padding: 8px 14px; font-size: .8rem; } }

/* Music: the actual player stays out of sight; only the button shows. */
.music-hidden { position: fixed; left: -10000px; top: 0; width: 300px; height: 160px; overflow: hidden; opacity: 0; pointer-events: none; }
.music-hidden iframe { width: 300px; height: 160px; border: 0; }
.music-text { display: grid; text-align: left; line-height: 1.15; }
.music-song { font-size: .72rem; opacity: .8; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-toggle { height: auto; min-height: 46px; padding: 6px 18px 6px 14px; }
.ms-panel.is-loading { opacity: .5; transition: opacity .2s; }

/* Memorial editor inside My Account */
.memorial-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.memorial-switch a { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .9rem; color: var(--text); text-decoration: none; }
.memorial-switch a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.memorial-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); }
.memorial-bar-name { display: block; font: 600 1.25rem/1.2 var(--serif); color: var(--ink); }
.editor-embedded { padding-bottom: 0; }
.editor-embedded .editor-main > .panel { box-shadow: none; }
@media (min-width: 1000px) { .editor-embedded { grid-template-columns: 180px 1fr; gap: 32px; } .editor-embedded .editor-nav { top: calc(var(--header-h) + 64px); } }
/* Memorial photo size (a bit larger than the original 190px) */
.ms-photo { width: min(240px, 60vw); padding: 8px; }
@media (min-width: 640px) { .ms-photo { width: 250px; } }

/* ---------- Photos tab: editorial style ----------
   Small uppercase section labels, a horizontal timeline for years, and a clean album grid
   (cover photo + small caption), like a photo app. */
.ms-panel[data-panel="photos"] .memorial-section { border: 0; box-shadow: none; background: none; padding: 26px 0 6px; margin-top: 0; }
.ms-panel[data-panel="photos"] .memorial-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; margin: 0 0 18px; text-align: left; }
.ms-panel[data-panel="photos"] .memorial-heading h2 { font: 600 .74rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin: 0; }
.ms-panel[data-panel="photos"] .memorial-heading .muted { font-size: .76rem; letter-spacing: .02em; }
.ms-panel[data-panel="photos"] .gallery-toolbar { justify-content: flex-start; margin: -6px 0 18px; }
.ms-panel[data-panel="photos"] .gallery-toolbar .btn { min-height: 32px; padding: 0 14px; font-size: .8rem; border-radius: 999px; background: var(--ink); }
.ms-panel[data-panel="photos"] .gallery-toolbar .btn::before { content: '▶'; font-size: .62rem; margin-right: 2px; }
.ms-panel[data-panel="photos"] .back-link { font-size: .82rem; margin-bottom: 12px; }

/* Albums: 2 columns on phones, 3 on larger screens; square covers, caption below */
.ms-panel[data-panel="photos"] #photos-albums .album-grid,
.ms-panel[data-panel="photos"] .album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
@media (min-width: 640px) { .ms-panel[data-panel="photos"] .album-grid { grid-template-columns: repeat(3, 1fr); gap: 22px 18px; } }
.ms-panel[data-panel="photos"] .album-tile-wrap { width: auto; max-width: none; }
.ms-panel[data-panel="photos"] .album-tile { padding-top: 0; text-align: left; gap: 0; }
.ms-panel[data-panel="photos"] .album-cover { padding: 0; border: 0; border-radius: 10px; background: var(--bg-alt); box-shadow: none; margin-bottom: 8px; overflow: hidden; }
.ms-panel[data-panel="photos"] .album-cover img { border-radius: 10px; transition: transform .5s ease; }
.ms-panel[data-panel="photos"] .album-cover.is-stack::before,
.ms-panel[data-panel="photos"] .album-cover.is-stack::after { display: none; }
.ms-panel[data-panel="photos"] a.album-tile:hover .album-cover { transform: none; box-shadow: none; }
.ms-panel[data-panel="photos"] a.album-tile:hover .album-cover img { transform: scale(1.04); }
.ms-panel[data-panel="photos"] .album-name { font: 600 .86rem/1.3 var(--sans); color: var(--ink); margin: 0; }
.ms-panel[data-panel="photos"] a.album-tile:hover .album-name { text-decoration: none; color: var(--accent); }
.ms-panel[data-panel="photos"] .album-count { font-size: .74rem; color: var(--muted); }

/* Years: a horizontal timeline */
.ms-panel[data-panel="photos"] #years .album-grid { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; position: relative; }
.ms-panel[data-panel="photos"] #years .album-tile-wrap { flex: 0 0 104px; scroll-snap-align: start; }
.ms-panel[data-panel="photos"] #years .album-cover { width: 104px; height: 104px; aspect-ratio: auto; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(41,32,10,.1); margin: 0 auto 8px; }
.ms-panel[data-panel="photos"] #years .album-cover img { border-radius: 50%; }
.ms-panel[data-panel="photos"] #years .album-tile { text-align: center; }
.ms-panel[data-panel="photos"] #years .album-name { font: 600 .95rem/1.2 var(--serif); }
.ms-panel[data-panel="photos"] #years .album-tile-wrap { position: relative; }
/* A short line joins each year to the next (none after the last one). */
.ms-panel[data-panel="photos"] #years .album-tile-wrap:not(:last-child)::after { content: ''; position: absolute; top: 52px; left: 100%; width: 14px; height: 2px; background: var(--line-strong); }

/* Photos inside an album or year: tight, clean grid */
.ms-panel[data-panel="photos"] .gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ms-panel[data-panel="photos"] .gallery .photo-card { padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none; }
.ms-panel[data-panel="photos"] .gallery .photo-card img { border-radius: 4px; }
.ms-panel[data-panel="photos"] .gallery a.photo-card:hover { transform: none; box-shadow: none; opacity: .9; }

/* Photo gallery albums: same row style as "Through the years", but square covers */
.ms-panel[data-panel="photos"] #gallery .album-grid { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.ms-panel[data-panel="photos"] #gallery .album-tile-wrap { flex: 0 0 112px; scroll-snap-align: start; }
.ms-panel[data-panel="photos"] #gallery .album-tile { text-align: center; }
.ms-panel[data-panel="photos"] #gallery .album-cover { width: 112px; height: 112px; aspect-ratio: auto; border-radius: 16px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(41,32,10,.1); margin: 0 auto 8px; }
.ms-panel[data-panel="photos"] #gallery .album-cover img { border-radius: 13px; }
.ms-panel[data-panel="photos"] #gallery .album-name { font: 600 .84rem/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-panel[data-panel="photos"] #gallery .album-tile-wrap { position: relative; }
.ms-panel[data-panel="photos"] #gallery .album-tile-wrap:not(:last-child)::after { content: ''; position: absolute; top: 56px; left: 100%; width: 16px; height: 2px; background: var(--line-strong); }

/* My Account: registered QR codes with copy / share / download */
.qr-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.qr-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.qr-thumb { flex: 0 0 72px; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; object-fit: contain; }
.qr-info { flex: 1; min-width: 0; }
.qr-info strong { font-weight: 500; color: var(--ink); }
.qr-info p { margin: 2px 0 0; }
.qr-link-row { margin-top: 10px; }
.qr-link-row input { min-height: 38px; font-size: .78rem; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qr-actions .btn, .qr-link-row .btn { display: inline-flex; align-items: center; gap: 6px; }
.qr-actions .icon, .qr-link-row .icon { width: 16px; height: 16px; }
@media (max-width: 480px) { .qr-thumb { flex-basis: 56px; width: 56px; height: 56px; } }

/* Memorial photo: oval cameo frame, same size */
.ms-photo { border-radius: 50%; transform: none; }
.ms-photo a, .ms-photo-initial { border-radius: 50%; }
.ms-photo { aspect-ratio: 9 / 10; }
.qr-panel { max-width: 640px; }
.ms-photo { aspect-ratio: 19 / 20; }
.qr-thumb { flex-basis: 132px; width: 132px; height: 132px; padding: 6px; }
@media (max-width: 480px) { .qr-thumb { flex-basis: 96px; width: 96px; height: 96px; } }

/* Typing effect on About & Memories */
.is-typing::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: var(--accent); animation: caret-blink .7s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.pop-wait { opacity: 0; transform: translateY(6px) scale(.96); }
.pop-in { opacity: 1; transform: none; transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1); }

/* Family: search, picked person, history */
.family-search { position: relative; }
.family-results { position: absolute; left: 0; right: 0; top: calc(100% - 22px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(41,32,10,.14); max-height: 340px; overflow-y: auto; }
.family-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; color: inherit; }
button.family-person { cursor: pointer; }
button.family-person:hover, button.family-person:focus-visible { background: var(--bg-alt); }
.family-person > span:not(.avatar) { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.family-person .avatar { flex: 0 0 auto; }
.family-person strong { font-weight: 500; color: var(--ink); }
.family-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-picked .family-person { border: 1px solid var(--line-strong); padding: 10px 12px; }
.family-log { list-style: none; margin: 0 0 16px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.family-log li { position: relative; display: grid; gap: 2px; padding: 8px 0; font-size: .88rem; }
.family-log li::before { content: ''; position: absolute; left: -20px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); border: 2px solid #fff; }
.family-log li.log-approved::before { background: #2f8f5b; }
.family-log li.log-declined::before, .family-log li.log-removed::before { background: #c0504d; }
.family-log li.log-requested::before { background: var(--accent); }

/* Notifications */
.notif-link { position: relative; }
.notif-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #d64545; color: #fff; font: 600 .68rem/1 var(--sans); }
.notif-mobile { position: relative; display: none; place-items: center; width: 40px; height: 40px; color: var(--ink); }
.notif-mobile .icon { width: 22px; height: 22px; }
.notif-mobile .notif-badge { position: absolute; top: 2px; right: 0; margin: 0; }
.notif-list { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.notif { display: flex; align-items: center; gap: 12px; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.notif.is-unread { background: var(--accent-tint); }
.notif-text { margin: 0; color: var(--ink); }
.notif .muted { margin: 2px 0 0; }
@media (max-width: 899px) { .notif-mobile { display: grid; } }
@media (min-width: 900px) { .notif-link .notif-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .notif-link .nav-icon { margin-right: 0; } }
.field input[type=search] { -webkit-appearance: none; appearance: none; }

/* Family Tree: relationship history window */
.history-open { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.history-open .icon { width: 16px; height: 16px; }
.history-modal .modal-icon .icon { width: 22px; height: 22px; }
.history-cards { list-style: none; margin: 0; max-height: min(60vh, 520px); gap: 12px; background: var(--bg-alt); }
.history-card { position: relative; display: grid; gap: 6px; padding: 14px 16px 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(41,32,10,.05); opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .2s; }
.history-card.is-shown { opacity: 1; transform: none; }
.history-card:hover { box-shadow: 0 8px 20px rgba(41,32,10,.1); transform: translateY(-2px); }
.history-card::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.history-card.is-approved::before { background: #2f8f5b; }
.history-card.is-declined::before, .history-card.is-removed::before { background: #c0504d; }
.history-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; font: 600 .7rem/1.6 var(--sans); letter-spacing: .04em; text-transform: uppercase; background: var(--accent-tint); color: var(--accent); }
.is-approved .history-tag { background: #e6f4ec; color: #2f7a50; }
.is-declined .history-tag, .is-removed .history-tag { background: #fbeaea; color: #a33d3a; }
.history-text { margin: 0; min-height: 1.4em; color: var(--ink); font-size: .95rem; }
.history-time { font-size: .8rem; color: var(--muted); }

/* My Account: birthday inline under the badges */
.birth-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.birth-inline label { font-size: .85rem; color: var(--muted); }
.birth-inline input[type=date] { min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: .85rem; background: #fff; }
.birth-inline .field-error { flex-basis: 100%; }

/* Family Tree diagram */
.tree-open { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px; }
.tree-open .icon, .tree-modal .modal-icon .icon { width: 18px; height: 18px; }
.tree-modal { width: min(980px, calc(100vw - 24px)); }
.ftree { display: grid; justify-items: center; gap: 0; padding: 28px 20px 32px; overflow: auto; max-height: min(72vh, 760px); background: radial-gradient(circle at 50% 0, var(--accent-tint), var(--bg-alt) 70%); }
.ftree-gen { position: relative; display: grid; justify-items: center; gap: 10px; padding-top: 34px; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s cubic-bezier(.2,.7,.2,1); }
.ftree-gen.is-shown { opacity: 1; transform: none; }
.ftree-gen:first-child { padding-top: 0; }
/* vertical line joining one generation to the next */
.ftree-gen + .ftree-gen::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 26px; background: var(--line-strong); transform: translateX(-1px); }
.ftree-label { font: 600 .68rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ftree-row { position: relative; display: inline-flex; gap: 16px; padding-top: 16px; }
/* horizontal line across a generation, with a short stem down to each card */
.ftree-row::before { content: ''; position: absolute; top: 0; left: 66px; right: 66px; height: 2px; background: var(--line-strong); }
.ftree-row > .ftree-card::before, .ftree-couple > .ftree-card:first-child::before { content: ''; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px; background: var(--line-strong); transform: translateX(-1px); }
.ftree-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; width: 132px; padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; text-decoration: none; color: inherit; box-shadow: 0 4px 14px rgba(41,32,10,.07); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
a.ftree-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(41,32,10,.14); border-color: var(--accent); }
.ftree-card.is-me { border: 2px solid var(--accent); box-shadow: 0 10px 26px rgba(158,123,40,.22); }
.ftree-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
.ftree-name { font-weight: 600; font-size: .86rem; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.ftree-role { padding: 2px 9px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font: 600 .66rem/1.6 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.is-me .ftree-role { background: var(--accent); color: #fff; }
.ftree-couple { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.ftree-heart { color: #d0577a; font-size: 1.1rem; }
.ftree-relatives { margin-top: 18px; padding-top: 26px; border-top: 1px dashed var(--line-strong); width: 100%; }
.ftree-relatives::before { display: none; }
.ftree-relatives .ftree-row::before, .ftree-relatives .ftree-card::before { display: none; }
.ftree-relatives .ftree-row { flex-wrap: wrap; justify-content: center; padding-top: 0; }
@media (max-width: 560px) {
  .ftree { justify-items: start; }
  .ftree-gen { justify-self: center; }
  .ftree-card { width: 108px; padding: 12px 8px 10px; }
  .ftree-avatar { width: 46px; height: 46px; }
  .ftree-row::before { left: 54px; right: 54px; }
}
.ftree-me-row.is-single::before { display: none; }
/* the sibling line ends at "You", not at the spouse */
.ftree-me-row.has-spouse::before { right: 226px; }
@media (max-width: 560px) { .ftree-me-row.has-spouse::before { right: 190px; } }

/* ---------- Family Tree: portrait-node style ---------- */
.ftree {
  --tree-line: #efe5cd;
  background:
    radial-gradient(circle at 50% -10%, rgba(214,177,90,.18), transparent 55%),
    radial-gradient(#f3edde 1px, transparent 1.2px) 0 0 / 20px 20px,
    linear-gradient(180deg, #fbfaff, #faf8f3);
  padding: 36px 24px 40px;
}
.ftree-gen { padding-top: 44px; gap: 14px; }
.ftree-gen + .ftree-gen::before { height: 44px; width: 2px; background: linear-gradient(var(--tree-line), var(--tree-line)); }
/* generation name as a small pill sitting on the line */
.ftree-label { position: relative; z-index: 1; padding: 5px 12px; border: 1px solid #f3eee1; border-radius: 999px; background: #fff; color: var(--accent); font-size: .62rem; letter-spacing: .14em; box-shadow: 0 2px 6px rgba(158,123,40,.08); }
.ftree-row { gap: 22px; padding-top: 22px; }
.ftree-row::before { height: 2px; background: var(--tree-line); border-radius: 2px; }
.ftree-row > .ftree-card::before, .ftree-couple > .ftree-card:first-child::before { top: -22px; height: 22px; background: var(--tree-line); }
/* small dot where a stem meets the line */
.ftree-row > .ftree-card::after { content: ''; position: absolute; top: -26px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--tree-line); }
.ftree-relatives .ftree-card::after, .ftree-me-row.is-single .ftree-card::after { display: none; }

/* person: round portrait with a ring, name and role underneath (no box) */
.ftree-card { width: 124px; padding: 0; gap: 8px; border: 0; background: none; box-shadow: none; }
a.ftree-card:hover { transform: translateY(-4px); box-shadow: none; border: 0; }
.ftree-avatar { width: 76px; height: 76px; font-size: 1.6rem; border: 4px solid #fff; box-shadow: 0 0 0 2px #f5eedc, 0 10px 24px rgba(120,93,30,.16); background: linear-gradient(160deg, #fbf8f0, #f7f1e4); color: var(--accent); transition: box-shadow .25s ease, transform .25s ease; }
a.ftree-card:hover .ftree-avatar { box-shadow: 0 0 0 3px var(--accent), 0 14px 30px rgba(120,93,30,.25); }
.ftree-name { font-size: .88rem; }
.ftree-role { background: #fff; border: 1px solid #f3eee1; }
/* you: bigger, gradient ring and a soft glow */
.ftree-card.is-me { width: 140px; border: 0; box-shadow: none; }
.is-me .ftree-avatar { width: 100px; height: 100px; font-size: 2rem; border-width: 5px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 10px rgba(214,177,90,.14), 0 18px 40px rgba(120,93,30,.3); }
.is-me .ftree-name { font-size: .98rem; }
.is-me .ftree-role { border-color: var(--accent); }
.ftree-heart { display: grid; place-items: center; width: 30px; height: 30px; margin-top: -40px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(208,87,122,.25); font-size: .9rem; }
.ftree-couple { gap: 10px; align-items: flex-start; }
.ftree-couple .ftree-heart { align-self: center; }
.ftree-me-row.has-spouse::before { right: 226px; }
.ftree-relatives { border-top: 1px dashed #ede5d1; }
@media (max-width: 560px) {
  .ftree-card { width: 100px; }
  .ftree-card.is-me { width: 116px; }
  .ftree-avatar { width: 62px; height: 62px; }
  .is-me .ftree-avatar { width: 82px; height: 82px; }
  .ftree-row::before { left: 50px; right: 50px; }
  .ftree-me-row.has-spouse::before { right: 188px; }
}
.ftree-row::before { left: 62px; right: 62px; }
.ftree-me-row::before { right: 70px; }
.ftree-me-row.has-spouse::before { right: 236px; }
@media (max-width: 560px) {
  .ftree-row::before { left: 50px; right: 50px; }
  .ftree-me-row::before { right: 58px; }
  .ftree-me-row.has-spouse::before { right: 200px; }
}

/* Family Tree: details panel on the left */
.tree-modal { width: min(1120px, calc(100vw - 24px)); }
.tree-layout { display: grid; grid-template-columns: 300px 1fr; min-height: 0; max-height: min(74vh, 780px); }
.tree-layout .ftree { max-height: none; }
.ftree-side { position: relative; overflow-y: auto; padding: 24px 22px; border-right: 1px solid var(--line); background: #fff; }
.ftree-side-empty { display: grid; justify-items: center; gap: 12px; height: 100%; align-content: center; text-align: center; color: var(--muted); font-size: .9rem; }
.ftree-side-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); animation: side-pulse 2.4s ease-in-out infinite; }
.ftree-side-icon .icon { width: 28px; height: 28px; }
@keyframes side-pulse { 50% { box-shadow: 0 0 0 10px rgba(214,177,90,.12); } }
.ftree-side-body.is-in .side-person > * { animation: side-in .45s cubic-bezier(.2,.7,.2,1) both; }
.ftree-side-body.is-in .side-person > :nth-child(2) { animation-delay: .05s; }
.ftree-side-body.is-in .side-person > :nth-child(3) { animation-delay: .1s; }
.ftree-side-body.is-in .side-person > :nth-child(4) { animation-delay: .15s; }
.ftree-side-body.is-in .side-person > :nth-child(n+5) { animation-delay: .2s; }
@keyframes side-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.side-person { display: grid; justify-items: center; gap: 8px; text-align: center; }
.side-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--accent), 0 16px 36px rgba(120,93,30,.25); }
.side-initial { display: grid; place-items: center; background: linear-gradient(160deg, #fbf8f0, #f7f1e4); color: var(--accent); font: 600 3rem/1 var(--serif); }
.side-name { margin: 8px 0 0; font: 600 1.3rem/1.2 var(--serif); color: var(--ink); }
.side-role { padding: 2px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font: 600 .66rem/1.7 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.side-line { margin: 4px 0 0; font-size: .88rem; color: var(--text); }
.side-line span { margin-right: 6px; color: var(--muted); }
.side-memorial { display: grid; gap: 4px; width: 100%; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt); text-align: left; }
.side-kicker { font: 600 .62rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.side-mname { font: 600 1.05rem/1.25 var(--serif); color: var(--ink); }
.side-dates, .side-epitaph { margin: 0; font-size: .84rem; color: var(--muted); }
.side-epitaph { font-style: italic; }
.side-bio { margin: 6px 0 0; font-size: .86rem; line-height: 1.55; color: var(--text); }
.side-link { justify-self: start; margin-top: 4px; font-size: .84rem; }
.side-open { margin-top: 12px; }
.ftree-card.is-active .ftree-avatar { box-shadow: 0 0 0 3px var(--accent), 0 14px 30px rgba(120,93,30,.25); }
@media (max-width: 760px) {
  .tree-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ftree-side { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .ftree-side-empty { padding: 6px 0; }
  .ftree-side-icon { width: 44px; height: 44px; }
  .side-photo { width: 96px; height: 96px; }
}

/* Family Tree on phones: details slide up as a bottom card */
.ftree-side-close { display: none; }
.only-touch { display: none; }
@media (hover: none) { .only-hover { display: none; } .only-touch { display: inline; } }
@media (max-width: 760px) {
  .tree-modal .modal-form { position: relative; }
  .tree-layout { grid-template-columns: 1fr; grid-template-rows: 1fr; max-height: calc(100dvh - 120px); }
  .ftree-side { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 70%; padding: 26px 18px 20px; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -16px 40px rgba(41,32,10,.22); transform: translateY(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .ftree-side::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
  .ftree-side.is-open { transform: none; }
  .ftree-side-empty { display: none; }
  .ftree-side-close { display: grid; place-items: center; position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg-alt); color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .side-person { grid-template-columns: auto 1fr; justify-items: start; column-gap: 14px; text-align: left; }
  .side-photo { grid-row: span 3; width: 84px; height: 84px; }
  .side-name { margin: 0; align-self: end; font-size: 1.15rem; }
  .side-memorial, .side-open { grid-column: 1 / -1; }
  .side-open { justify-self: stretch; text-align: center; }
}
.side-facts { display: grid; width: 100%; margin: 10px 0 0; border-top: 1px solid var(--line); text-align: left; }
.side-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.side-facts dt { color: var(--muted); }
.side-facts dd { margin: 0; color: var(--ink); text-align: right; }
.side-facts small { color: var(--muted); }
@media (max-width: 760px) { .side-facts { grid-column: 1 / -1; } }
.side-none { margin: 12px 0 0; text-align: center; }
div.ftree-card { cursor: default; }
@media (max-width: 760px) { .side-none { grid-column: 1 / -1; } }

/* Family Tree: draggable canvas with zoom */
.ftree-wrap { position: relative; min-width: 0; min-height: 0; display: grid; }
.ftree { display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.ftree.is-dragging { cursor: grabbing; }
.ftree.is-dragging .ftree-card { pointer-events: none; }
.ftree-canvas { display: grid; justify-items: center; width: max-content; min-width: 100%; margin: 0 auto; padding: 0 24px; }
.ftree-card img { -webkit-user-drag: none; }
.ftree-tools { position: absolute; right: 16px; bottom: 16px; z-index: 4; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 6px 18px rgba(41,32,10,.12); }
.ftree-tools button { width: 36px; height: 34px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ftree-tools button:last-child { border-bottom: 0; font-size: .95rem; }
.ftree-tools button:hover { background: var(--accent-tint); color: var(--accent); }
@media (max-width: 760px) { .ftree-tools { right: 10px; bottom: 10px; } }
.ftree-wrap { overflow: hidden; } .tree-layout .ftree { height: 100%; max-height: min(74vh, 780px); overflow: auto; }
.tree-layout { height: min(74vh, 780px); }
@media (max-width: 760px) { .tree-layout { height: calc(100dvh - 140px); } }

/* Family Tree: summary card with both buttons */
.family-hub { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 26px; padding: 16px 18px; border: 1px solid #f3eee1; border-radius: 14px; background: linear-gradient(120deg, #fdfbf5, #fff 60%); }
.family-hub-faces { display: flex; }
.hub-face { width: 42px; height: 42px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(41,32,10,.12); font-size: .95rem; }
.hub-face + .hub-face { margin-left: -12px; }
.hub-more { display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 .78rem/1 var(--sans); }
.family-hub-text { display: grid; flex: 1; min-width: 140px; line-height: 1.3; }
.family-hub-text strong { font: 600 1.02rem/1.3 var(--serif); color: var(--ink); }
.family-hub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.family-hub-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.family-hub-actions .icon { width: 16px; height: 16px; }
@media (max-width: 560px) { .family-hub-actions { width: 100%; } .family-hub-actions .btn { flex: 1; justify-content: center; } }

/* Family Tree: add-member window and full-width lists */
.family-lists { display: grid; gap: 8px; }
@media (min-width: 900px) { .family-lists > div { max-width: 760px; } }
.hub-add span { font-size: 1.15rem; line-height: 1; margin-right: 2px; }
.add-modal { overflow: visible; }
.add-modal .modal-form, .add-modal .modal-body { overflow: visible; }
.add-modal .modal-body { padding-bottom: 26px; }
.add-modal .family-results { position: static; margin-top: 6px; box-shadow: none; }
.add-modal [data-family-form] > div:last-child .btn { width: 100%; }
.field-status.is-error { color: var(--error); }

/* Add-family popup: same look as the History window */
.add-modal .modal-body { background: var(--bg-alt); gap: 12px; }
.add-modal [data-family-form] { display: grid; gap: 12px; }
.add-step { position: relative; display: grid; gap: 10px; padding: 16px 16px 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(41,32,10,.05); animation: side-in .35s cubic-bezier(.2,.7,.2,1) both; }
.add-step.is-rel { animation-delay: .08s; }
.add-step::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.add-step.is-rel::before { background: #2f8f5b; }
.add-step.is-rel .history-tag { background: #e6f4ec; color: #2f7a50; }
.add-step .field { margin: 0; }
.add-step label { font-size: .9rem; }
.add-modal .field-error, .add-modal .field-status { font-size: .82rem; }
.add-modal [data-family-form] > div:last-child { margin-top: 2px; }

/* Add-family popup, v2: rounded like History, search bar, relationship pills */
.add-modal { overflow: hidden; border-radius: 16px; }
.add-modal .modal-form { overflow: hidden; }
.add-modal .add-body { background: #fff; gap: 22px; padding: 22px 24px 8px; overflow-y: auto; max-height: calc(100dvh - 220px); }
.add-label { display: block; margin: 0 0 8px; padding: 0; font: 600 .78rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.add-search { position: relative; }
.add-search-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.add-search input { width: 100%; min-height: 50px; padding: 12px 14px 12px 42px; border: 1.5px solid transparent; border-radius: 12px; background: var(--bg-alt); font: inherit; color: var(--ink); transition: border-color .15s, background-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.add-search input:focus { outline: 0; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
.add-search input[aria-invalid="true"] { border-color: var(--error); }
.add-modal .family-results { position: static; margin: 8px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 22px rgba(41,32,10,.08); }
.add-modal .family-picked .family-person { padding: 10px 12px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent-tint); }
.add-modal .field-status { min-height: 0; margin: 6px 0 0; font-size: .82rem; }
.add-rel { margin: 0; padding: 0; border: 0; min-width: 0; }
.rel-pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.rel-pill { position: relative; cursor: pointer; }
.rel-pill input { position: absolute; opacity: 0; pointer-events: none; }
.rel-pill span { display: block; padding: 11px 10px; border: 1.5px solid var(--line); border-radius: 999px; text-align: center; font-size: .9rem; font-weight: 500; color: var(--text); background: #fff; transition: border-color .15s, background-color .15s, color .15s, transform .15s; }
.rel-pill:hover span { border-color: var(--accent); color: var(--accent); }
.rel-pill input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(158,123,40,.25); }
.rel-pill input:focus-visible + span { box-shadow: 0 0 0 4px rgba(214,177,90,.25); }
.add-detail { margin-top: 10px; animation: side-in .3s ease both; }
.add-detail input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; }
.add-detail input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
.add-modal .modal-foot { border-top: 1px solid var(--line); background: #fff; }
.add-search:has(input[hidden]) { display: none; }
.add-select { position: relative; }
.add-select::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.add-select select { width: 100%; min-height: 50px; padding: 12px 40px 12px 14px; border: 1.5px solid transparent; border-radius: 12px; background: var(--bg-alt); font: inherit; color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.add-select select:focus { outline: 0; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
.add-select select[aria-invalid="true"] { border-color: var(--error); }

/* ---------- Memorial editor: Background music (refined) ---------- */
#music .music-current { display: flex; align-items: center; gap: 16px; margin: 18px 0 22px; padding: 18px 18px 18px 16px; border: 1px solid #f3eee1; border-radius: 16px; background: linear-gradient(120deg, #fcf9f1, #fff 70%); box-shadow: 0 6px 18px rgba(120,93,30,.06); }
.np-disc { flex: 0 0 auto; display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 54px; height: 54px; padding: 15px 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(214,177,90,.15); }
.np-disc i { display: block; width: 4px; height: 8px; border-radius: 2px; background: #fff; animation: np-bar 1s ease-in-out infinite; }
.np-disc i:nth-child(2) { animation-delay: .15s; } .np-disc i:nth-child(3) { animation-delay: .3s; } .np-disc i:nth-child(4) { animation-delay: .45s; }
@keyframes np-bar { 50% { height: 22px; } }
@media (prefers-reduced-motion: reduce) { .np-disc i { animation: none; height: 14px; } }
.np-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font: 600 .68rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#music .music-current strong { display: block; font: 600 1.08rem/1.3 var(--serif); color: var(--ink); }
#music .music-current a.small { font-size: .84rem; }
#music .music-current audio { width: 100%; max-width: 360px; height: 34px; margin-top: 8px; }
#music .music-badge { padding: 3px 9px; border-radius: 999px; font-size: .62rem; letter-spacing: .06em; }
/* tabs as a pill switch */
#music .music-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border: 0; border-radius: 999px; background: var(--bg-alt); }
#music .music-tabs button { padding: 9px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 .88rem var(--sans); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
#music .music-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(41,32,10,.1); }
/* soft rounded inputs */
#music .field input[type=text] { min-height: 48px; padding: 12px 14px; border: 1.5px solid transparent; border-radius: 12px; background: var(--bg-alt); transition: border-color .15s, background-color .15s, box-shadow .15s; }
#music .field input[type=text]:focus { outline: 0; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
#music .field label { font-size: .9rem; }
#music .modal-drop { border-radius: 14px; }
#music .form .btn-primary { border-radius: 10px; }
#music .music-help { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--bg-alt); }
@media (max-width: 560px) { #music .music-tabs { display: flex; } #music .music-tabs button { flex: 1; padding: 9px 10px; } }

/* ---------- Memorial editor: album folders (refined) ---------- */
.editor .bulk-bar { display: inline-flex; gap: 12px; margin: 4px 0 18px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(41,32,10,.05); }
.editor .bulk-bar.has-selection { border-color: #f0c9cf; background: #fff7f8; }
.editor .bulk-all { font-size: .85rem; }
.editor .bulk-count { margin-right: 6px; font-size: .82rem; }
.editor .bulk-bar [data-bulk-submit] { border-radius: 999px; padding: 6px 14px; min-height: 0; font-size: .82rem; }
.editor .bulk-bar [data-bulk-submit]:disabled { display: none; }
.editor .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 18px; }
.editor .album-tile { padding-top: 10px; gap: 3px; }
.editor .album-cover { padding: 0; border: 0; border-radius: 16px; overflow: visible; background: var(--bg-alt); box-shadow: 0 1px 2px rgba(41,32,10,.06), 0 10px 24px rgba(41,32,10,.10); }
.editor .album-cover img { border-radius: 16px; }
.editor .album-cover.is-stack::before, .editor .album-cover.is-stack::after { border: 0; border-radius: 16px; box-shadow: 0 2px 6px rgba(41,32,10,.08); }
.editor .album-cover.is-stack::before { top: -6px; left: 10px; right: 10px; background: #f6f2e8; }
.editor .album-cover.is-stack::after { top: -11px; left: 20px; right: 20px; background: #fbf8f2; }
.editor .album-tile:hover .album-cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(41,32,10,.06), 0 16px 32px rgba(41,32,10,.16); }
.editor .album-name { font: 600 .98rem/1.3 var(--serif); }
.editor .album-count { justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--bg-alt); font-size: .72rem; }
/* round check in the corner */
.editor .tile-check { top: 20px; left: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.editor .tile-check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; transition: background-color .15s, border-color .15s; }
.editor .tile-check input:checked { border-color: var(--error); background: var(--error) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.editor .album-tile-wrap.is-selected .album-cover { outline: 3px solid var(--error); outline-offset: 3px; }
/* "New album" tile */
.editor .album-cover-new { border: 2px dashed #ede5d1; background: linear-gradient(160deg, #faf8ff, #fbf8f0); box-shadow: none; color: var(--accent); font-size: 2.4rem; }
.editor .album-new:hover .album-cover-new { border-color: var(--accent); background: var(--accent-tint); }

/* ---------- Gallery videos ---------- */
.video-add { display: grid; gap: 10px; margin-top: 22px; padding: 18px; border: 1px solid #f3eee1; border-radius: 16px; background: linear-gradient(120deg, #fdfbf5, #fff 70%); }
.video-add-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.video-add-head strong { font: 600 1.02rem/1.3 var(--serif); color: var(--ink); }
.video-meter { height: 8px; border-radius: 999px; background: #f6f1e6; overflow: hidden; }
.video-meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #dcbd75); transition: width .3s ease; }
.video-meter .w0 { width: 0%; }
.video-meter .w5 { width: 5%; }
.video-meter .w10 { width: 10%; }
.video-meter .w15 { width: 15%; }
.video-meter .w20 { width: 20%; }
.video-meter .w25 { width: 25%; }
.video-meter .w30 { width: 30%; }
.video-meter .w35 { width: 35%; }
.video-meter .w40 { width: 40%; }
.video-meter .w45 { width: 45%; }
.video-meter .w50 { width: 50%; }
.video-meter .w55 { width: 55%; }
.video-meter .w60 { width: 60%; }
.video-meter .w65 { width: 65%; }
.video-meter .w70 { width: 70%; }
.video-meter .w75 { width: 75%; }
.video-meter .w80 { width: 80%; }
.video-meter .w85 { width: 85%; }
.video-meter .w90 { width: 90%; }
.video-meter .w95 { width: 95%; }
.video-meter .w100 { width: 100%; }
.video-drop { padding: 20px 16px; }
.video-add .field-status { margin: 0; font-size: .84rem; }
.video-add .field-status.is-error { color: var(--error); }
.photo-card.is-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #111; border-radius: inherit; }
.editor .photo-card.is-video video { aspect-ratio: 1; }
.video-size { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; pointer-events: none; }
a.photo-card.is-video { position: relative; }
.play-badge, .album-video-badge { position: absolute; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,.25); pointer-events: none; }
.play-badge { left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding-left: 3px; font-size: 1.05rem; }
.album-tile { position: relative; }
.album-video-badge { top: 18px; right: 8px; width: 26px; height: 26px; padding-left: 2px; font-size: .66rem; }
.album-cover video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; background: #111; }
.viewer-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 6px; z-index: 2; }

/* ---------- Memorial editor: Links (refined) ---------- */
.link-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 16px 0 18px; padding: 0; }
.link-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(41,32,10,.05); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.link-card:hover { transform: translateY(-2px); border-color: #ede5d1; box-shadow: 0 10px 22px rgba(41,32,10,.09); }
.link-card-icon { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); }
.link-card-icon .icon { width: 18px; height: 18px; }
.link-card-text { display: grid; flex: 1; min-width: 0; text-decoration: none; color: inherit; line-height: 1.3; }
.link-card-text strong { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-text small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card .inline-form button { font-size: .8rem; }
.link-add { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--bg-alt); }
.link-add-fields { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 12px; align-items: end; }
.link-add .field { margin: 0; }
.link-add .field label { font-size: .85rem; }
.link-add input[type=text] { min-height: 46px; padding: 11px 14px; border: 1.5px solid transparent; border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.link-add input[type=text]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
.link-add-btn { min-height: 46px; border-radius: 12px; white-space: nowrap; }
.link-add-btn span { font-size: 1.1rem; line-height: 1; margin-right: 2px; }
@media (max-width: 700px) { .link-add-fields { grid-template-columns: 1fr; } .link-add-btn { width: 100%; } }

/* Links: YouTube thumbnails */
.link-card-thumb { position: relative; flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 4px 12px rgba(41,32,10,.15); }
.link-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.link-card-thumb i { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 28px; height: 28px; margin: -14px 0 0 -14px; padding-left: 2px; border-radius: 50%; background: rgba(255,255,255,.92); color: #e02424; font: normal .62rem/1 var(--sans); }
.link-card:hover .link-card-thumb img { transform: scale(1.06); }
/* the whole card opens the link on the memorial page */
.public-links .link-card { position: relative; }
.public-links .link-card-text::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.public-links .link-card.has-thumb { flex-direction: column; align-items: stretch; padding: 10px; }
.public-links .link-card.has-thumb .link-card-thumb { width: 100%; }
.public-links .link-card.has-thumb .link-card-thumb i { width: 46px; height: 46px; margin: -23px 0 0 -23px; font-size: 1rem; }
.public-links .link-card.has-thumb .link-card-text { padding: 2px 4px 2px; }
.char-count { margin: 6px 2px 0; text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count span { font-weight: 600; color: var(--ink); }
.char-count.is-near span { color: var(--error); }
.bio-box { position: relative; }
.bio-box textarea { padding-bottom: 14px; }
.bio-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.bio-tools .char-count { margin: 0; }
.char-count.is-full { color: var(--error); }
.emoji-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.15rem; cursor: pointer; transition: transform .15s, border-color .15s; }
.emoji-toggle:hover, .emoji-toggle[aria-expanded="true"] { border-color: var(--accent); transform: scale(1.06); }
.emoji-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: min(380px, 100%); padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(41,32,10,.16); animation: side-in .2s ease both; }
.emoji-panel button { display: grid; place-items: center; aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 1.2rem; cursor: pointer; }
.emoji-panel button:hover { background: var(--accent-tint); transform: scale(1.12); }
@media (max-width: 480px) { .emoji-panel { grid-template-columns: repeat(8, 1fr); } }
.bio-format { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bio-format button { display: grid; place-items: center; width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: 1rem var(--serif); cursor: pointer; transition: border-color .15s, background-color .15s; }
.bio-format button:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
.bio-format .small { margin-left: 6px; }
.memorial-bio strong { font-weight: 700; color: var(--ink); }
.memorial-bio em { font-style: italic; }
/* Biography: live bold / italic box */
.bio-editor { min-height: 220px; max-height: 480px; overflow-y: auto; padding: 12px 14px; font: 400 1rem/1.6 var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; outline: none; transition: border-color .15s, box-shadow .15s; }
.bio-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214,177,90,.15); }
.bio-editor.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.bio-editor b, .bio-editor strong { font-weight: 700; }
.bio-format button.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ---------- Memorial page backgrounds (wallpapers) ---------- */
/* All light, so the dark text and the white cards stay easy to read. Drawn with CSS: no images to store. */
.wp-plain { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }
.wp-lavender { background: radial-gradient(120% 60% at 50% 0%, #e9e2fb, transparent 70%), linear-gradient(180deg, #f6f2fe, #fbfaff 60%, #f4f0fd); }
.wp-dawn { background: radial-gradient(100% 55% at 50% 0%, #ffe0cf, transparent 70%), linear-gradient(180deg, #fff3ec, #fffaf6 55%, #fdeff0); }
.wp-sky { background: radial-gradient(40% 18% at 20% 12%, rgba(255,255,255,.9), transparent 70%), radial-gradient(35% 14% at 78% 22%, rgba(255,255,255,.85), transparent 70%), linear-gradient(180deg, #dcebf8, #f2f8fd 55%, #f8fbfe); }
.wp-garden { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23a9c3a0' stroke-width='1.2' opacity='.45'%3E%3Cpath d='M14 30c6-10 18-12 24-6-6 6-18 8-24 6z'/%3E%3Cpath d='M14 30l24-6'/%3E%3Cpath d='M50 66c4-8 14-10 19-5-5 5-14 7-19 5z'/%3E%3Cpath d='M50 66l19-5'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 80px 80px, linear-gradient(180deg, #edf4ea, #f7faf5 60%, #f1f6ee); }
.wp-rose { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='%23e8b4bf' opacity='.35'%3E%3Cellipse cx='20' cy='22' rx='5' ry='9' transform='rotate(30 20 22)'/%3E%3Cellipse cx='66' cy='60' rx='4' ry='8' transform='rotate(-25 66 60)'/%3E%3Cellipse cx='60' cy='18' rx='3' ry='6' transform='rotate(60 60 18)'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 90px 90px, linear-gradient(180deg, #fbecef, #fff7f8 60%, #fbf0f2); }
.wp-linen { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ccircle cx='2' cy='2' r='.9' fill='%23c9b99e' opacity='.45'/%3E%3C/svg%3E") 0 0 / 14px 14px, linear-gradient(180deg, #f6efe4, #fbf8f2 60%, #f5eee3); }
.wp-stars { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23e3ca90' opacity='.5'%3E%3Ccircle cx='14' cy='20' r='1.3'/%3E%3Ccircle cx='70' cy='12' r='.9'/%3E%3Ccircle cx='100' cy='54' r='1.5'/%3E%3Ccircle cx='40' cy='76' r='1'/%3E%3Ccircle cx='86' cy='100' r='1.1'/%3E%3Cpath d='M30 40l1.5 3.5L35 45l-3.5 1.5L30 50l-1.5-3.5L25 45l3.5-1.5z'/%3E%3Cpath d='M96 22l1 2.4 2.4 1-2.4 1L96 29l-1-2.6-2.4-1 2.4-1z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px, radial-gradient(120% 70% at 50% 0%, #f7f0e0, transparent 70%), linear-gradient(180deg, #f9f5ed, #fefcf8); }
.wp-marble { background: radial-gradient(60% 40% at 15% 20%, rgba(234,224,200,.55), transparent 60%), radial-gradient(50% 35% at 85% 45%, rgba(237,229,209,.5), transparent 60%), radial-gradient(70% 40% at 40% 85%, rgba(240,233,216,.55), transparent 60%), linear-gradient(135deg, #fbf9f4, #fdfdfe 50%, #f9f7f0); }
/* on the memorial page the wallpaper covers the whole page; the header area goes see-through */
.memorial-simple[class*=" wp-"] { background-attachment: fixed; min-height: 100vh; }
.memorial-simple[class*=" wp-"] .ms-head { background: transparent; }
.memorial-simple[class*=" wp-"] .ms-tabs { background: rgba(255,255,255,.82); }
@media (max-width: 760px) { .memorial-simple[class*=" wp-"] { background-attachment: scroll; } }

/* picker */
.wp-modal { width: min(640px, calc(100vw - 24px)); }
.wp-modal .modal-icon { font-size: 1.3rem; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.wp-option { display: grid; gap: 6px; cursor: pointer; }
.wp-option input { position: absolute; opacity: 0; pointer-events: none; }
.wp-swatch { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.wp-option:hover .wp-swatch { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(41,32,10,.12); }
.wp-option input:checked + .wp-swatch { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(214,177,90,.2); }
.wp-option input:checked + .wp-swatch::after { content: '✓'; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .75rem; }
.wp-option input:focus-visible + .wp-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.wp-sample { display: grid; justify-items: center; gap: 4px; width: 62%; padding: 8px 6px; border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(41,32,10,.08); }
.wp-sample b { font: 600 .95rem/1 var(--serif); color: var(--ink); }
.wp-sample i { display: block; width: 80%; height: 4px; border-radius: 2px; background: #ebe2cc; }
.wp-sample i + i { width: 55%; }
.wp-name { font-size: .86rem; font-weight: 500; text-align: center; color: var(--ink); }
.memorial-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bio-tools { justify-content: flex-end; }
.bio-format .emoji-toggle { width: 34px; height: 32px; border-radius: 8px; font-size: 1rem; }
.bio-box .emoji-panel { top: 44px; }

/* more wallpapers */
.wp-sunset { background: radial-gradient(110% 60% at 50% 0%, #ffd9c2, transparent 70%), linear-gradient(180deg, #fff0e8, #fff8f4 50%, #f9f6ee); }
.wp-mint { background: radial-gradient(110% 60% at 50% 0%, #d4f1e6, transparent 70%), linear-gradient(180deg, #ecf8f3, #f8fdfb 60%, #eef8f4); }
.wp-candle { background: radial-gradient(60% 45% at 50% 6%, rgba(255,214,140,.55), transparent 70%), linear-gradient(180deg, #fff6e6, #fffbf4 60%, #fbf3e6); }
.wp-ocean { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cpath d='M0 20c15-10 30-10 45 0s30 10 45 0 30-10 45 0' fill='none' stroke='%239cc4dc' stroke-width='1.3' opacity='.45'/%3E%3C/svg%3E") 0 0 / 120px 40px, linear-gradient(180deg, #e6f2f9, #f6fbfd 60%, #edf6fa); }
.wp-sakura { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' viewBox='0 0 110 110'%3E%3Cg fill='%23f2b8c9' opacity='.45'%3E%3Cg transform='translate(26 28)'%3E%3Ccircle cx='0' cy='-5' r='3.6'/%3E%3Ccircle cx='4.8' cy='-1.5' r='3.6'/%3E%3Ccircle cx='3' cy='4' r='3.6'/%3E%3Ccircle cx='-3' cy='4' r='3.6'/%3E%3Ccircle cx='-4.8' cy='-1.5' r='3.6'/%3E%3C/g%3E%3Cg transform='translate(80 76) scale(.75)'%3E%3Ccircle cx='0' cy='-5' r='3.6'/%3E%3Ccircle cx='4.8' cy='-1.5' r='3.6'/%3E%3Ccircle cx='3' cy='4' r='3.6'/%3E%3Ccircle cx='-3' cy='4' r='3.6'/%3E%3Ccircle cx='-4.8' cy='-1.5' r='3.6'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%23f7d9a8' opacity='.7'%3E%3Ccircle cx='26' cy='28' r='1.4'/%3E%3Ccircle cx='80' cy='76' r='1.1'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 110px 110px, linear-gradient(180deg, #fdeef3, #fff8fa 60%, #fcf0f4); }
.wp-meadow { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg opacity='.5'%3E%3Ccircle cx='18' cy='22' r='2' fill='%23e9c46a'/%3E%3Ccircle cx='64' cy='40' r='1.6' fill='%23e0cfa7'/%3E%3Ccircle cx='40' cy='78' r='1.8' fill='%23f4a7b9'/%3E%3Ccircle cx='86' cy='84' r='1.5' fill='%239fcfa8'/%3E%3Cpath d='M18 24v8M64 42v7M40 80v8' stroke='%23a8c69f' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 100px 100px, linear-gradient(180deg, #f3f8ec, #fbfdf7 60%, #f4f8ee); }
.wp-feather { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23dfcfaa' stroke-width='1.1' opacity='.5' stroke-linecap='round'%3E%3Cpath d='M20 50c10-18 26-24 34-22-6 10-20 22-34 22z'/%3E%3Cpath d='M20 50l24-16'/%3E%3Cpath d='M80 102c8-14 20-18 27-17-5 8-16 17-27 17z'/%3E%3Cpath d='M80 102l19-12'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px, linear-gradient(180deg, #faf7f1, #fbfaff 60%, #f9f6f0); }
.wp-lace { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cpath d='M0 20a10 10 0 0 1 20 0a10 10 0 0 1 20 0' fill='none' stroke='%23d8cbb4' stroke-width='1' opacity='.5'/%3E%3C/svg%3E") 0 0 / 40px 20px, linear-gradient(180deg, #fbf7ef, #fffdf9 60%, #f8f3ea); }
.wp-watercolor { background: radial-gradient(35% 30% at 18% 18%, rgba(196,181,240,.35), transparent 70%), radial-gradient(30% 28% at 82% 30%, rgba(250,190,200,.32), transparent 70%), radial-gradient(40% 30% at 30% 78%, rgba(170,214,230,.32), transparent 70%), radial-gradient(35% 28% at 78% 82%, rgba(255,222,170,.3), transparent 70%), #fdfcff; }
.wp-clouds { background: radial-gradient(30% 12% at 15% 10%, #fff, transparent 70%), radial-gradient(26% 10% at 70% 18%, #fff, transparent 70%), radial-gradient(34% 12% at 40% 40%, rgba(255,255,255,.9), transparent 70%), radial-gradient(28% 10% at 85% 60%, rgba(255,255,255,.9), transparent 70%), linear-gradient(180deg, #e3eefa, #f3f8fd 60%, #f7fafe); }
.wp-modal .modal-body { max-height: min(62vh, 640px); overflow-y: auto; }

/* ---------- Memorial details (editor) ---------- */
.details-form { display: grid; gap: 16px; }
.dgroup { position: relative; margin: 0; padding: 18px 18px 8px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 2px 8px rgba(41,32,10,.04); min-width: 0; }
.dgroup::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.dgroup.is-wake::before { background: #d39b3a; }
.dgroup.is-interment::before { background: #4f9a6b; }
.dgroup legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; margin-left: -6px; font: 600 1.05rem/1 var(--serif); color: var(--ink); }
.dgroup-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-alt); font-size: .95rem; }
.dgroup-auto { margin: -4px 0 14px; padding: 8px 12px; border-radius: 10px; background: var(--bg-alt); font-size: .88rem; }
.dgroup-auto strong { color: var(--ink); }
.gps-more { margin: 0 0 12px; }
.gps-more summary { cursor: pointer; font-size: .88rem; color: var(--accent); margin-bottom: 10px; }
.gps-more .btn { margin-bottom: 6px; }
.details-save .btn { min-width: 220px; }

/* ---------- Memorial details card (public page) ---------- */
.dc-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .dc-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.dc-block { position: relative; padding: 16px 16px 14px 18px; border-radius: 14px; background: var(--bg-alt); overflow: hidden; }
.dc-block::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.dc-block.is-wake::before { background: #d39b3a; }
.dc-block.is-interment::before { background: #4f9a6b; }
.dc-block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 600 1rem/1.2 var(--serif); color: var(--ink); }
.dc-block dl { display: grid; gap: 10px; margin: 0; }
.dc-block dl > div { display: grid; gap: 2px; }
.dc-block dt { font: 600 .66rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dc-block dd { margin: 0; font-size: .93rem; color: var(--ink); line-height: 1.45; }
.dc-sub { display: block; font-size: .84rem; color: var(--muted); }
.dc-tribute { font: italic 500 1.05rem/1.35 var(--serif); }
.dc-note { padding: 8px 10px; border-radius: 8px; background: #fff; font-size: .88rem; }
.dc-pill { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: #fbeed6; color: #8a5a12; font-size: .72rem; font-weight: 600; vertical-align: 1px; }
.dc-map { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }
.dc-map .icon { width: 16px; height: 16px; }
.place-search { position: relative; }
.place-search .add-search input { background: var(--bg-alt); }
.place-results { list-style: none; margin: 8px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 10px 24px rgba(41,32,10,.1); max-height: 280px; overflow-y: auto; }
.place-results button { display: grid; gap: 2px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; cursor: pointer; }
.place-results button:hover, .place-results button:focus-visible { background: var(--accent-tint); }
.place-results strong { font-weight: 600; color: var(--ink); }
.place-results small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.place-search .field-status.is-error { color: var(--error); }
.place-search .add-search input { padding-left: 42px; }

/* ---------- Memorial editor: tabs at the top ---------- */
.editor-embedded.has-tabs, .editor-embedded { grid-template-columns: 1fr !important; gap: 18px; }
.editor-embedded .editor-nav { position: sticky; top: calc(var(--header-h) + 52px); z-index: 25; flex-direction: row; gap: 6px; padding: 6px; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(41,32,10,.06); overflow-x: auto; scrollbar-width: none; }
.editor-embedded .editor-nav::-webkit-scrollbar { display: none; }
.editor-embedded .editor-nav a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; font-size: .86rem; color: var(--muted); transition: background-color .15s, color .15s; }
.editor-embedded .editor-nav a:hover { background: var(--bg-alt); color: var(--ink); }
.editor-embedded .editor-nav a.is-active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(158,123,40,.25); }
.editor.has-tabs .editor-main > .panel { animation: side-in .3s ease both; }
@media (max-width: 760px) { .editor-embedded .editor-nav { border-radius: 14px; top: calc(var(--header-h) + 46px); } }
.editor-embedded .editor-nav a { display: inline-flex; align-items: center; gap: 6px; }
/* Photos & Media: small tabs inside */
.media-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.media-subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .84rem; font-weight: 500; text-decoration: none; transition: border-color .15s, color .15s, background-color .15s; }
.media-subnav a:hover { border-color: var(--accent); color: var(--accent); }
.media-subnav a.is-active { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
/* no account tabs bar any more: the editor tabs stick right under the header */
.editor-embedded .editor-nav { top: calc(var(--header-h) + 8px); }
@media (max-width: 760px) { .editor-embedded .editor-nav { top: calc(var(--header-h) + 6px); } }
/* My Account tabs (one section at a time) */
.account-tabs .container { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.account-tabs a { padding: 8px 16px; border-radius: 999px; transition: background-color .15s, color .15s; }
.account-tabs a:hover { box-shadow: none; background: var(--bg-alt); color: var(--ink); }
.account-tabs a.is-active { background: var(--ink); color: #fff; }
.editor-embedded .editor-nav { top: calc(var(--header-h) + 60px); }
@media (max-width: 760px) { .editor-embedded .editor-nav { top: calc(var(--header-h) + 58px); } }
.account-tabs a { display: inline-flex; align-items: center; gap: 6px; }

/* One merged tab row: memorial tabs + Family Tree + QR codes */
.editor-nav.is-merged { position: sticky; top: calc(var(--header-h) + 8px); z-index: 25; display: flex; flex-direction: row; gap: 6px; margin: 0 0 18px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(41,32,10,.06); overflow-x: auto; scrollbar-width: none; }
.editor-nav.is-merged::-webkit-scrollbar { display: none; }
.editor-nav.is-merged a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: .86rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s; }
.editor-nav.is-merged a:hover { background: var(--bg-alt); color: var(--ink); }
.editor-nav.is-merged a.is-active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(158,123,40,.25); }
.editor-nav.is-merged a.is-account.is-active { background: var(--ink); box-shadow: 0 4px 12px rgba(41,32,10,.2); }
.editor-nav.is-merged.on-account a:not(.is-account).is-active { background: none; color: var(--muted); box-shadow: none; }
.nav-sep { flex: 0 0 1px; align-self: stretch; margin: 6px 4px; background: var(--line-strong); }
.account-merged .account-body { padding-top: 20px; }
@media (max-width: 760px) { .editor-nav.is-merged { border-radius: 14px; top: calc(var(--header-h) + 6px); } }
/* Memorial details: room under the last field of each group */
.dgroup { padding-bottom: 22px; }
.dgroup > .field:last-child, .dgroup > details:last-child { margin-bottom: 0; }
.dgroup-auto { margin: 4px 0 16px; }

/* ---------- Public memorial tabs: same pill row as the editor ---------- */
.ms-tabs { background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 8px 0; }
.ms-tabs-inner { justify-content: flex-start; gap: 6px; max-width: min(860px, calc(100% - 2 * var(--gutter))); width: max-content; margin: 0 auto; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(41,32,10,.06); scrollbar-width: none; }
.ms-tabs-inner::-webkit-scrollbar { display: none; }
.ms-tabs a { padding: 8px 14px; font-size: .86rem; font-weight: 500; letter-spacing: 0; text-transform: none; background: none; box-shadow: none; }
.ms-tabs a:hover { background: var(--bg-alt); transform: none; }
.ms-tabs a.is-active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(158,123,40,.25); }
.memorial-simple[class*=" wp-"] .ms-tabs { background: transparent; }
@media (max-width: 639px) { .ms-tabs-inner { border-radius: 14px; width: auto; } .ms-tabs a { padding: 8px 12px; font-size: .8rem; } }

/* Family tree on the memorial page */
.public-ftree { max-height: none; margin-top: 12px; padding: 24px 12px 28px; border-radius: 16px; overflow-x: auto; cursor: default; user-select: auto; }
.public-ftree .ftree-canvas { padding: 0 12px; }
.public-ftree a.ftree-card { cursor: pointer; }
.public-ftree div.ftree-card { cursor: default; }

/* ---------- Gold theme: filled buttons and selected tabs use the gold gradient with dark text ---------- */
.btn-primary, .btn-primary:disabled { background: var(--gold); color: var(--on-gold); border-color: transparent; box-shadow: 0 2px 8px rgba(127,90,28,.22); }
.btn-primary:hover { background: var(--gold-hover); color: var(--on-gold); box-shadow: 0 6px 16px rgba(127,90,28,.3); }
.ms-tabs a.is-active, .ms-tabs a.is-active:hover,
.editor-embedded .editor-nav a.is-active, .editor-nav.is-merged a.is-active, .editor-nav.is-merged a.is-account.is-active { background: var(--gold); color: var(--on-gold); box-shadow: 0 4px 12px rgba(127,90,28,.28); }
.ms-tabs a.is-active .ms-count { background: rgba(51,33,10,.14); color: var(--on-gold); }
.account-tabs a.is-active { background: var(--gold); color: var(--on-gold); }
.music-toggle, .music-toggle:hover { background: var(--gold); color: var(--on-gold); box-shadow: 0 10px 28px rgba(127,90,28,.32); }
.music-toggle:hover { background: var(--gold-hover); }
.music-eq i { background: var(--on-gold); }
.modal-icon, .np-disc, .slideshow-fab { background: var(--gold); color: var(--on-gold); }
.np-disc i { background: var(--on-gold); }
.rel-pill input:checked + span, .is-me .ftree-role, .hub-more { background: var(--gold); color: var(--on-gold); }
.video-meter span { background: var(--gold); }
.bio-format button.is-on { background: var(--gold); border-color: #b98c3f; color: var(--on-gold); }

/* ---------- Top banner: deep bronze with gold ---------- */
.site-header, .site-header.is-scrolled { background: linear-gradient(100deg, #2e1c06 0%, #4a2f0c 45%, #6f4d17 100%); border-bottom: 1px solid #b98c3f; box-shadow: 0 4px 16px rgba(46,28,6,.22); }
.site-header .brand-text { color: #ffe998; }
.site-header .brand-mark { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.menu-toggle { background: rgba(255,233,152,.1); border-color: rgba(255,233,152,.4); color: #ffe998; }
.notif-mobile { color: #ffe998; }
.scan-fab, .scan-fab:hover { background: var(--gold); color: var(--on-gold); }
@media (min-width: 900px) {
  .site-header .nav-links a, .site-header .nav-link, .site-header .nav-link.nav-button { color: #f8ecd0; }
  .site-header .nav-links a:hover, .site-header .nav-link:hover { color: #ffe998; }
  .site-header .nav-links a .nav-icon, .site-header .nav-link .nav-icon { color: #e6c66e; }
  .site-header .nav-links a:hover .nav-icon, .site-header .nav-link:hover .nav-icon,
  .site-header .nav-links a[aria-current="page"] .nav-icon, .site-header .nav-link[aria-current="page"] .nav-icon { color: #ffe998; }
  .site-header .nav-links a[aria-current="page"], .site-header .nav-link[aria-current="page"] { color: #ffe998; box-shadow: inset 0 -2px 0 #ffe998; }
}
@media (min-width: 900px) { .site-header .main-nav { background: transparent; } }

/* Top banner, brighter: light gold to rich gold with dark text */
.site-header, .site-header.is-scrolled { background: linear-gradient(100deg, #fff0b8 0%, #f3d98b 40%, #dcb95f 75%, #c9a24d 100%); border-bottom: 1px solid #b98c3f; box-shadow: 0 4px 14px rgba(127,90,28,.22); }
.site-header .brand-text { color: #33210a; }
.site-header .brand-mark { filter: none; }
.menu-toggle { background: rgba(255,255,255,.35); border-color: rgba(51,33,10,.35); color: #33210a; }
.notif-mobile { color: #33210a; }
.scan-fab, .scan-fab:hover { background: #3a2508; color: #ffe998; }
.site-header .btn-primary, .site-header .btn-primary:hover { background: #3a2508; color: #ffe998; box-shadow: 0 4px 12px rgba(46,28,6,.3); }
.site-header .btn-primary:hover { background: #57370d; }
@media (min-width: 900px) {
  .site-header .nav-links a, .site-header .nav-link, .site-header .nav-link.nav-button { color: #33210a; }
  .site-header .nav-links a:hover, .site-header .nav-link:hover { color: #000; }
  .site-header .nav-links a .nav-icon, .site-header .nav-link .nav-icon { color: #57370d; }
  .site-header .nav-links a:hover .nav-icon, .site-header .nav-link:hover .nav-icon,
  .site-header .nav-links a[aria-current="page"] .nav-icon, .site-header .nav-link[aria-current="page"] .nav-icon { color: #33210a; }
  .site-header .nav-links a[aria-current="page"], .site-header .nav-link[aria-current="page"] { color: #33210a; font-weight: 600; box-shadow: inset 0 -2px 0 #33210a; }
}
@media (max-width: 899px) { .site-header .main-nav .btn-primary { background: var(--gold); color: var(--on-gold); } }
/* Slideshow buttons on the memorial page: gold, like the other buttons */
.ms-panel[data-panel="photos"] .gallery-toolbar .btn, .ms-panel[data-panel="photos"] .gallery-toolbar .btn:hover { background: var(--gold); color: var(--on-gold); box-shadow: 0 2px 8px rgba(127,90,28,.22); }
.ms-panel[data-panel="photos"] .gallery-toolbar .btn:hover { background: var(--gold-hover); }

/* Shared memories: photo, audio, link, shown left and right in turn */
.memory-counter { text-align: right; }
.memory-attach { display: flex; flex-wrap: wrap; gap: 8px; }
.memory-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); font: 500 .9rem var(--sans); cursor: pointer; }
.memory-chip:hover, .memory-chip:focus-within { border-color: var(--accent); background: var(--accent-tint); }
.memory-chip.is-on { border-color: var(--accent); background: var(--accent-tint); }
.memory-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.memory-preview { display: grid; gap: 10px; justify-items: start; margin-top: 8px; }
.memory-preview img { max-width: 220px; max-height: 180px; border-radius: 10px; }
.memory-preview audio { width: 100%; max-width: 340px; }
.memory-preview video { width: 100%; max-width: 340px; max-height: 240px; border-radius: 10px; background: #000; }
.memory-camera { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-alt); }
.memory-camera video { width: 100%; max-height: 360px; border-radius: 10px; background: #000; }
.memory-camera-time { margin: 0; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.memory-camera.is-recording .memory-camera-time { color: #a33a35; font-weight: 600; }
.memory-camera-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.memory-file-error { margin: 8px 0 0; color: #a33a35; font-size: .9rem; }
.memories { display: grid; gap: 18px; border-top: 0; }
.memories li { align-items: flex-start; gap: 12px; padding: 0; border-bottom: 0; }
.memories li.memory-right { flex-direction: row-reverse; }
.memory-bubble { min-width: 0; max-width: min(78%, 520px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; background: var(--bg-alt); }
.memory-right .memory-bubble { border-radius: 16px 4px 16px 16px; background: var(--accent-tint); }
.memory-body { overflow-wrap: anywhere; }
.memory-photo { display: block; margin-top: 10px; }
.memory-photo img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: 10px; }
.memory-body a { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }
.memory-video { display: block; width: 100%; max-height: 380px; margin-top: 10px; border-radius: 10px; background: #000; }
.memory-audio { display: block; width: 280px; max-width: 100%; margin-top: 10px; }
.memory-link { display: block; margin-top: 10px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: .9rem; text-decoration: none; }
.memory-link:hover { border-color: var(--accent); }
.memory-link img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.memory-remove { margin-top: 6px; text-align: right; }
@media (max-width: 639px) {
  .memories .avatar { width: 34px; height: 34px; }
  .memory-bubble { max-width: 84%; }
}
.memory-person { flex: 0 0 auto; border-radius: 50%; }
.memory-person:hover .avatar, .memory-person:focus-visible .avatar { box-shadow: 0 0 0 2px var(--accent); }
.memory-meta a strong { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 480px) {
  /* Phones: a smaller profile photo so the page content shows sooner, and room for the bell next to the name */
  .site-header .brand { min-width: 0; flex: 1 1 auto; }
  .site-header .brand-text { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
  .header-mobile { flex: 0 0 auto; gap: 8px; }
}
@media (max-width: 400px) {
  /* Small phones: the Scan button shows its icon only, so the full name fits next to the bell */
  .scan-fab span { display: none; }
  .scan-fab { padding-left: 12px; padding-right: 12px; }
  .site-header .brand-text { font-size: .98rem; }
}

/* ---------- Phone design: My Account home and the public memorial profile card ---------- */
.phone-home, .ms-quick, .ms-family-strip, .account-greet { display: none; }
@media (max-width: 640px) {
  /* My Account: a compact greeting row */
  .account-hero { padding: 16px 0 6px; background: none; border-bottom: 0; }
  .account-hero-inner { grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center; justify-items: start; text-align: left; }
  .account-hero .avatar-form { grid-row: span 2; justify-items: start; gap: 4px; }
  .account-hero .avatar-pick, .account-hero .avatar-hero { width: 68px; height: 68px; font-size: 1.6rem; }
  .account-hero .avatar-overlay { font-size: .6rem; padding: 4px 0; }
  .account-hero .avatar-hint { display: none; }
  .account-greet { display: block; margin: 0; font-size: .85rem; color: var(--muted); }
  .account-identity { min-width: 0; width: 100%; justify-self: stretch; text-align: left; }
  .account-name { margin: 0; font-size: 1.35rem; line-height: 1.2; }
  .account-email { margin: 2px 0 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-identity .badges { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
  .account-identity .badges::-webkit-scrollbar { display: none; }
  .account-identity .badge-pill { flex: 0 0 auto; font-size: .72rem; }
  .account-logout { grid-column: 1 / -1; justify-self: stretch; }
  .account-logout .btn { width: 100%; }

  /* Banner, tiles and steps */
  .phone-home { display: block; padding: 8px 0 4px; }
  .phone-banner { position: relative; overflow: hidden; padding: 22px 120px 22px 20px; border-radius: 22px; color: var(--on-gold); background: var(--gold); box-shadow: 0 12px 28px rgba(127,90,28,.28); }
  .phone-banner::before { content: ''; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.22); }
  .phone-banner-kicker { margin: 0 0 6px; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
  .phone-banner-title { margin: 0; font: 600 1.45rem/1.15 var(--serif); color: var(--on-gold); }
  .phone-banner-text { margin: 6px 0 14px; font-size: .88rem; line-height: 1.35; opacity: .85; }
  .phone-banner-btn { position: relative; display: inline-block; padding: 9px 16px; border-radius: 999px; background: #33210a; color: #ffe998; font-size: .85rem; font-weight: 600; text-decoration: none; }
  .phone-banner-art { position: absolute; right: 8px; bottom: 10px; width: 108px; height: auto; opacity: .9; filter: drop-shadow(0 6px 10px rgba(51,33,10,.25)); }
  .phone-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
  .phone-head h2 { margin: 0; font: 600 1.15rem/1.2 var(--serif); }
  .phone-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .phone-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; padding: 12px 4px 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(41,32,10,.06); color: var(--ink); font: 500 .74rem/1.2 var(--sans); text-align: center; text-decoration: none; cursor: pointer; }
  .phone-tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-tint); font-size: 1.35rem; }
  .phone-tile-name { overflow-wrap: anywhere; hyphens: manual; }
  .phone-tile.is-active { border-color: var(--accent); box-shadow: 0 6px 16px rgba(127,90,28,.2); }
  .phone-tile.is-active .phone-tile-icon { background: var(--gold); }
  .phone-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
  .phone-steps li { display: grid; justify-items: center; gap: 8px; padding: 12px 6px; border-radius: 18px; background: var(--bg-alt); font-size: .76rem; line-height: 1.3; text-align: center; }
  .phone-steps span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(41,32,10,.08); font-size: 1.25rem; }
  [data-account-tabs], .editor-nav.is-merged { display: none !important; }
  .account-body { padding-top: 16px; }

  /* Public memorial: profile card over a coloured cover */
  .memorial-simple .ms-head { padding: 118px 0 0; background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.45), transparent 55%), linear-gradient(160deg, #f3d98b, #dcb95f 55%, #b98c3f); }
  .memorial-simple .ms-head > .container { padding: 0 20px 22px; border-radius: 28px 28px 0 0; background: var(--bg); box-shadow: 0 -8px 24px rgba(41,32,10,.08); }
  .ms-photo { width: 132px !important; margin: -66px auto 12px; padding: 5px; aspect-ratio: 1; }
  .ms-label { font-size: .66rem; }
  .ms-name { font-size: 1.75rem; }
  .ms-edit-wide { display: none; }
  .ms-quick { display: block; margin-top: 16px; }
  .ms-actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
  .ms-round { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(41,32,10,.08); color: var(--accent); font-size: 1.25rem; text-decoration: none; cursor: pointer; }
  .ms-round svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .ms-main { display: inline-flex; align-items: center; justify-content: center; min-width: 150px; height: 52px; padding: 0 24px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 600; text-decoration: none; box-shadow: 0 10px 22px rgba(127,90,28,.3); }
  .ms-share-note { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
  .ms-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; padding: 0; list-style: none; }
  .ms-stats li + li { border-left: 1px solid var(--line); }
  .ms-stats a { display: grid; gap: 2px; padding: 4px 0; color: var(--ink); text-decoration: none; }
  .ms-stats strong { font: 700 1.35rem/1.1 var(--sans); }
  .ms-stats span { font-size: .8rem; color: var(--muted); }
  .ms-family-strip { display: block; padding: 16px 20px 18px; background: var(--bg); border-top: 8px solid var(--bg-alt); border-bottom: 8px solid var(--bg-alt); }
  .ms-strip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
  .ms-strip-head h2 { margin: 0; font: 600 1.05rem/1.2 var(--sans); }
  .ms-strip-head a { font-size: .9rem; font-weight: 600; color: var(--accent); text-decoration: none; }
  .ms-strip-row { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; }
  .ms-strip-row::-webkit-scrollbar { display: none; }
  .ms-strip-person { flex: 0 0 auto; display: grid; justify-items: center; gap: 6px; width: 66px; color: var(--ink); font-size: .82rem; text-decoration: none; }
  .ms-strip-person .avatar { width: 62px; height: 62px; font-size: 1.3rem; }
  .ms-strip-person span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- My Account on phones: no top bar, floating menu button, one-colour icon tiles ---------- */
.fab { display: none; }
@media (max-width: 640px) {
  .page-account .site-header { display: none; }
  .page-account .account-hero { padding-top: calc(22px + env(safe-area-inset-top)); }
  .fab::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(250,247,240,.82); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .fab.is-open::before { opacity: 1; pointer-events: auto; }
  .fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 70; display: grid; justify-items: end; gap: 12px; }
  .fab-button { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border: 0; border-radius: 50%; background: #33210a; color: #ffe998; box-shadow: 0 10px 24px rgba(51,33,10,.35); cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
  .fab-button:active { transform: scale(.92); }
  .fab-button .icon { position: absolute; width: 24px; height: 24px; transition: transform .25s ease, opacity .2s ease; }
  .fab-close { opacity: 0; transform: rotate(-90deg); }
  .fab.is-open .fab-open { opacity: 0; transform: rotate(90deg); }
  .fab.is-open .fab-close { opacity: 1; transform: none; }
  .fab-dot { position: absolute; top: 10px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: #d4513b; border: 2px solid #33210a; }
  .fab-menu { display: grid; justify-items: end; gap: 10px; pointer-events: none; }
  .fab.is-open .fab-menu { pointer-events: auto; }
  .fab-item { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: .92rem; font-weight: 500; text-decoration: none; box-shadow: 0 8px 22px rgba(41,32,10,.16); opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .2s ease, transform .25s ease; }
  .fab-item .icon { width: 20px; height: 20px; color: var(--accent); }
  .fab.is-open .fab-item { opacity: 1; transform: none; }
  .fab.is-open .fab-item:nth-last-child(1) { transition-delay: 0s; }
  .fab.is-open .fab-item:nth-last-child(2) { transition-delay: .03s; }
  .fab.is-open .fab-item:nth-last-child(3) { transition-delay: .06s; }
  .fab.is-open .fab-item:nth-last-child(4) { transition-delay: .09s; }
  .fab.is-open .fab-item:nth-last-child(5) { transition-delay: .12s; }
  .fab-badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #d4513b; color: #fff; font-size: .72rem; text-align: center; }

  .phone-tile-icon { color: var(--accent-dark); }
  .phone-tile-icon .icon { width: 24px; height: 24px; stroke-width: 1.7; }
  .phone-tile { animation: tile-in .4s ease backwards; animation-delay: calc(var(--i, 0) * 45ms); transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease; }
  .phone-tile:active { transform: scale(.95); }
  .phone-tile-icon { transition: background-color .2s ease, transform .2s ease; }
  .phone-tile.is-active .phone-tile-icon { color: var(--on-gold); transform: translateY(-2px); }
  .phone-banner { animation: tile-in .45s ease backwards; }
  .phone-banner-btn { transition: transform .15s ease; }
  .phone-banner-btn:active { transform: scale(.95); }
  .account-body { padding-bottom: 90px; }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .phone-tile, .phone-banner { animation: none; }
  .fab-item, .fab-button, .fab-button .icon { transition: none; }
}

/* My Account on phones: bigger photo, tidy badges, log out in the floating menu, plain home until a tile is chosen */
.fab-form { margin: 0; }
button.fab-item { border: 0; font: inherit; cursor: pointer; }
@media (max-width: 640px) {
  .account-hero .avatar-pick, .account-hero .avatar-hero { width: 96px; height: 96px; font-size: 2.1rem; }
  .account-hero .avatar-overlay { font-size: .66rem; }
  .account-identity .badges { flex-wrap: wrap; overflow: visible; gap: 6px; margin-top: 8px; }
  .account-identity .badge-plan { display: none; }
  .account-logout { display: none; }
  .phone-idle .account-body > .panel, .phone-idle .account-body > .editor-nav { display: none !important; }
  .phone-idle .account-body { padding-bottom: 24px; }
}

/* My Account on phones: quicker taps, and softer forms and buttons inside every section */
.phone-tile, .phone-banner-btn, .fab-button, .fab-item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  .page-account .account-body .panel { padding: 22px 18px; border-radius: 22px; border-color: var(--line); box-shadow: 0 6px 22px rgba(41,32,10,.06); }
  .page-account .account-body .panel-title { font-size: 1.35rem; }
  .page-account .account-body .field label { font-size: .86rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
  .page-account .account-body .field input[type=text], .page-account .account-body .field input[type=search], .page-account .account-body .field input[type=email],
  .page-account .account-body .field input[type=url], .page-account .account-body .field input[type=number], .page-account .account-body .field input[type=date],
  .page-account .account-body .field input[type=datetime-local], .page-account .account-body .field select, .page-account .account-body .field textarea,
  .page-account .account-body .bio-editor {
    min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #fcfaf5; font-size: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  }
  .page-account .account-body .field input:focus, .page-account .account-body .field select:focus, .page-account .account-body .field textarea:focus, .page-account .account-body .bio-editor:focus {
    outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(220,185,95,.28);
  }
  .page-account .account-body .btn { min-height: 46px; padding: 11px 20px; border-radius: 999px; font-weight: 600; touch-action: manipulation; transition: transform .12s ease, box-shadow .2s ease; }
  .page-account .account-body .btn:active { transform: scale(.97); }
  .page-account .account-body .btn-sm { min-height: 40px; padding: 8px 16px; }
  .page-account .account-body .btn-primary { box-shadow: 0 8px 18px rgba(127,90,28,.22); }
  .page-account .account-body .btn-secondary { background: #fff; border-color: var(--line-strong); }
  .page-account .account-body form > div > .btn-primary, .page-account .account-body form > .btn-primary { width: 100%; }
  .page-account .account-body .link-button { padding: 6px 2px; font-weight: 600; }
  .page-account .bio-format { gap: 8px; flex-wrap: wrap; }
  .page-account .bio-format button, .page-account .bio-format .emoji-toggle { width: 42px; height: 40px; border-radius: 12px; }
  .page-account .media-subnav { gap: 8px; margin-bottom: 4px; }
  .page-account .media-subnav a { padding: 9px 16px; border-radius: 999px; font-size: .86rem; }
  .page-account .memorial-bar { flex-direction: column; align-items: stretch; gap: 12px; border-radius: 18px; }
  .page-account .memorial-bar-actions { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; min-width: 0; }
  .page-account .memorial-bar-actions .btn { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  /* Room below, so a short section can still scroll up to the top of the screen */
  .page-account:not(.phone-idle) .account-body { padding-bottom: 75vh; }
}
/* The closed floating menu must not catch taps meant for the page under it. */
.fab { pointer-events: none; }
.fab-button, .fab.is-open .fab-menu, .fab.is-open::before { pointer-events: auto; }
.fab:not(.is-open) .fab-item { visibility: hidden; transition: opacity .2s ease, transform .25s ease, visibility 0s .25s; }
@media (max-width: 640px) {
  /* QR code card on phones: picture on top, then the link and the buttons, all within the screen */
  .page-account #qr { min-width: 0; max-width: 100%; overflow: hidden; }
  .page-account #qr .qr-panel, .page-account #qr .qr-panel > div { min-width: 0; max-width: 100%; }
  .page-account .qr-item { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-account .qr-item > :first-child { align-self: center; }
  .page-account .qr-item .qr-thumb { width: 180px; height: 180px; }
  .page-account .qr-info { width: 100%; text-align: center; }
  .page-account .qr-info p { overflow-wrap: anywhere; }
  .page-account .qr-link-row { margin-top: 10px; }
  .page-account .qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .page-account .qr-actions .btn { width: 100%; justify-content: center; }
  .page-account .qr-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .page-account .account-body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Phones: home tiles polish and a simple Family Tree ---------- */
.mtree-head, .mtree-me, .mtree-add-card { display: none; }
@media (max-width: 640px) {
  .phone-head span { font-size: .85rem; color: var(--muted); }
  .phone-head h2 { font-size: 1.3rem; }
  .phone-banner { padding-right: 20px; }
  .phone-banner-art { bottom: auto; top: 14px; width: 92px; opacity: .55; }
  .phone-banner-btn { display: flex; justify-content: center; gap: 8px; width: 100%; margin-top: 4px; padding: 13px 16px; font-size: .95rem; }
  .phone-tile { gap: 10px; padding: 14px 4px 12px; border-radius: 20px; font-size: .78rem; }
  .phone-tile-icon { width: 46px; height: 46px; border-radius: 15px; }

  #family .family-hub { display: none; }
  #family .panel-head { margin-bottom: 0; }
  .mtree-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
  .mtree-head p { margin: 2px 0 0; font-size: .9rem; line-height: 1.35; }
  .mtree-add-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid #ecd9a6; border-radius: 16px; background: #fffaf0; color: var(--accent-dark); font: 600 .9rem/1.2 var(--sans); cursor: pointer; touch-action: manipulation; }
  .mtree-add-btn span { font-size: 1.2rem; line-height: 1; }
  .mtree-me { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; padding: 16px; border: 1.5px solid #ecd9a6; border-radius: 20px; background: #fffaf0; }
  .mtree-me::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 2px; height: 24px; background: #e7cf92; }
  .mtree-me-face { width: 58px; height: 58px; font-size: 1.3rem; background: var(--gold); color: #fff; box-shadow: 0 0 0 4px #fbefcf; }
  .mtree-me-text { display: grid; min-width: 0; }
  .mtree-me-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
  .mtree-me-text small { color: var(--muted); font-size: .85rem; }
  .mtree-pill { align-self: start; padding: 4px 10px; border-radius: 999px; background: #f6ebd0; color: var(--accent-dark); font-size: .75rem; font-weight: 600; }
  .mtree-me-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
  .mtree-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #ecd9a6; border-radius: 999px; background: #fff; color: var(--accent-dark); font: 500 .8rem var(--sans); cursor: pointer; touch-action: manipulation; }
  .mtree-link .icon { width: 15px; height: 15px; }
  #family .family-lists { margin-top: 30px; }
  #family .family-lists > div:first-child { position: relative; padding-left: 16px; }
  #family .family-lists > div:first-child::before { content: ''; position: absolute; left: 2px; top: 30px; bottom: 6px; border-left: 2px dashed #e7cf92; }
  #family .family-lists > div:first-child > .detail-heading { margin: 0 0 10px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  #family .people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; }
  #family .people li { position: relative; display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 3px 12px rgba(41,32,10,.05); }
  #family .people .person { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
  #family .people .person > span { display: grid; min-width: 0; }
  #family .people .avatar { flex: 0 0 auto; width: 42px; height: 42px; }
  #family .people strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
  #family .people small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .76rem; line-height: 1.25; }
  #family .people form { margin: 0; text-align: right; }
  #family .people .link-button { padding: 0; font-size: .75rem; font-weight: 500; color: var(--muted); }
  .mtree-add-card { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 16px; border: 1.5px dashed #e2c98a; border-radius: 16px; background: none; color: var(--accent-dark); font: 600 .9rem var(--sans); cursor: pointer; touch-action: manipulation; }
  .mtree-add-card span { font-size: 1.2rem; line-height: 1; }
}
.pn-short { display: none; }
@media (max-width: 640px) {
  #family .people .pn-full { display: none; }
  #family .people .pn-short { display: inline; }
  #family .people li { padding: 12px 12px 10px; }
  #family .people .avatar { width: 46px; height: 46px; }
  #family .people strong { font-size: .95rem; }
  #family .people small { font-size: .8rem; }
}
@media (max-width: 640px) {
  #family .family-lists > div:first-child { padding-left: 12px; }
  #family .people { gap: 8px; }
  #family .people li { padding: 10px 10px 8px; }
  #family .people .person { gap: 8px; }
  #family .people .avatar { width: 38px; height: 38px; font-size: .95rem; }
  #family .people .link-button { text-decoration: none; }
}
@media (max-width: 640px) {
  /* The memorial's name card (QR code, Page background, View Public Page) shows only in the Memorial section */
  .account-merged:not([data-section="place"]) #memorials > .panel-head,
  .account-merged:not([data-section="place"]) #memorials > .memorial-bar,
  .account-merged:not([data-section="place"]) #memorials > .memorial-switch { display: none; }
}
@media (max-width: 640px) {
  /* Profile photo: no text over it; a small camera badge shows it can still be tapped to change */
  .account-hero .avatar-overlay { display: none; }
  .account-hero .avatar-pick { position: relative; }
  .account-hero .avatar-pick::after { content: ''; position: absolute; right: 2px; bottom: 2px; width: 28px; height: 28px; border: 2px solid #fff; border-radius: 50%;
    background: #33210a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffe998' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 15px no-repeat;
    box-shadow: 0 2px 6px rgba(41,32,10,.25); }
  /* Family Tree: space between the add card and the requests below */
  .mtree-add-card { margin-bottom: 28px; }
  /* Tile names stay whole words (e.g. "Achievements" never splits) */
  .phone-tile-name { overflow-wrap: normal; word-break: keep-all; font-size: .72rem; letter-spacing: -.01em; }
}

/* Share / invite menu on the memorial page */
.share-sheet:not([hidden]) { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(30,22,8,.5); }
.share-panel { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 32px 28px 24px; border-radius: 22px; background: #fffdf8; box-shadow: 0 20px 50px rgba(41,32,10,.25); text-align: left; animation: sheet-up .22s ease; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.share-x { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.share-title { margin: 0 32px 10px 0; font: 600 clamp(1.35rem, 5vw, 1.8rem)/1.25 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.share-sub { margin: 0 0 18px; color: var(--muted); font-size: .98rem; line-height: 1.5; }
.share-row { display: flex; align-items: center; gap: 16px; width: 100%; margin: 0 0 6px; padding: 14px 12px; border: 2px solid transparent; border-radius: 18px; background: none; color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer; touch-action: manipulation; transition: background-color .15s ease, border-color .15s ease; }
.share-row:hover, .share-row:focus-visible { background: #fbf6ea; }
.share-row.is-on { border-color: #b9a37f; }
.share-row strong { display: block; font-size: 1.08rem; font-weight: 500; }
.share-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.share-ico { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; }
.share-ico .icon { width: 22px; height: 22px; }
.share-ico.is-em { background: #fdecef; color: #e8355a; }
.share-ico.is-fb { background: #1877f2; color: #fff; }
.share-ico.is-wa { background: #25d366; color: #fff; }
.share-ico.is-qr { background: #ece9e3; color: #4a4a4a; }
.share-qr { display: grid; justify-items: center; gap: 14px; margin-top: 10px; padding: 22px 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.share-qr img { width: 220px; height: 220px; object-fit: contain; }
.share-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-qr-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.share-qr-actions .icon { width: 16px; height: 16px; }
.ms-invite-wide .btn { display: inline-flex; align-items: center; gap: 6px; }
.ms-invite-wide .icon { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .share-sheet:not([hidden]) { align-items: flex-end; padding: 0; }
  .share-panel { max-height: 88vh; padding: 26px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .ms-invite-wide { display: none; }
}
@media (prefers-reduced-motion: reduce) { .share-panel { animation: none; } }
/* Long names always fit the screen */
.ms-name, .account-name, .phone-banner-title, .memorial-bar-name { overflow-wrap: anywhere; }
@media (max-width: 640px) { .ms-name { font-size: clamp(1.35rem, 7vw, 1.75rem); } }

/* Memorial privacy: switch in My Account, and the page visitors see for a private memorial */
.privacy-card { display: grid; gap: 12px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.privacy-switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.privacy-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.privacy-track { flex: 0 0 auto; position: relative; width: 50px; height: 28px; border-radius: 999px; background: #d9d4c7; transition: background-color .2s ease; }
.privacy-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.privacy-switch input:checked + .privacy-track { background: #7f5a1c; }
.privacy-switch input:checked + .privacy-track .privacy-knob { transform: translateX(22px); }
.privacy-switch input:focus-visible + .privacy-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.privacy-text { display: grid; }
.privacy-text strong { font-weight: 600; color: var(--ink); }
.privacy-text small { color: var(--muted); font-size: .85rem; }
.privacy-pass { display: grid; gap: 6px; }
.privacy-pass label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.privacy-pass input { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fcfaf5; font-size: 1rem; }
.privacy-card .btn { justify-self: start; }
.locked-page { padding: 64px 0; }
.locked-card { max-width: 420px; margin: 0 auto; padding: 32px 24px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(41,32,10,.08); }
.locked-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark); }
.locked-icon .icon { width: 28px; height: 28px; }
.locked-title { margin: 0 0 8px; font: 600 1.6rem/1.2 var(--serif); }
.locked-form { margin-top: 18px; text-align: left; }
@media (max-width: 640px) {
  .account-merged:not([data-section="place"]) #memorials > .privacy-card { display: none; }
  .privacy-card .btn { justify-self: stretch; }
}
.share-ico.is-ms { background: linear-gradient(135deg, #0099ff, #a033ff 60%, #ff5280); color: #fff; }
.share-ico.is-cp { background: var(--accent-tint); color: var(--accent-dark); }
.share-row[hidden] { display: none; }
/* Invite menu: compact rows with smaller icons */
.share-row { gap: 14px; margin: 0 0 2px; padding: 9px 10px; border-radius: 14px; }
.share-row strong { font-size: 1rem; }
.share-ico { width: 40px; height: 40px; }
.share-ico .icon, .share-ico svg { width: 18px; height: 18px; }
.share-sub { margin-bottom: 12px; }

/* My Account: crisper text, lighter field text (all sections) */
.page-account { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.page-account .account-body .field input, .page-account .account-body .field select, .page-account .account-body .field textarea,
.page-account .account-body .bio-editor, .page-account .privacy-pass input {
  font-family: var(--sans); font-weight: 400; font-size: .95rem; letter-spacing: .005em; color: #2b2418;
}
.page-account .account-body .field input::placeholder, .page-account .account-body .field textarea::placeholder { font-weight: 400; color: #a39a8a; }
.page-account .account-body .field label { font-weight: 500; letter-spacing: .01em; }
.page-account .account-body .field-hint, .page-account .account-body .fine-print, .page-account .account-body .muted { font-weight: 400; }
.page-account .account-body .panel-title { font-weight: 600; letter-spacing: -.005em; }
@media (max-width: 640px) {
  /* 16px on phones, or iPhones zoom in when a field is tapped */
  .page-account .account-body .field input, .page-account .account-body .field select, .page-account .account-body .field textarea,
  .page-account .account-body .bio-editor { font-size: 16px; }
  .page-account .account-body .field label { font-size: .82rem; }
}
/* Hidden from people; bots fill it in */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Sign up, log in, confirm email, forgot password: a frosted glass card on a white page with soft gold light */
.auth { position: relative; overflow: hidden; background: #fff; }
.auth::before { content: ''; position: absolute; inset: -80px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 34% at 18% 18%, rgba(255,226,140,.55), transparent 70%),
    radial-gradient(34% 32% at 86% 26%, rgba(220,185,95,.38), transparent 70%),
    radial-gradient(40% 36% at 78% 88%, rgba(201,162,77,.28), transparent 70%),
    radial-gradient(36% 34% at 10% 86%, rgba(255,240,200,.6), transparent 70%);
  filter: blur(20px); }
.auth-panel { position: relative; z-index: 1; padding: 32px 28px; border-radius: 26px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px rgba(127,90,28,.12), 0 2px 8px rgba(41,32,10,.05), inset 0 1px 0 #fff; }
.auth .field input[type=text], .auth .field input[type=email], .auth .field input[type=password], .auth .field input[type=search] {
  border-radius: 14px; border-color: rgba(201,162,77,.35); background: rgba(255,255,255,.75); transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.auth .field input:focus { background: #fff; border-color: #c9a24d; box-shadow: 0 0 0 3px rgba(220,185,95,.25); }
.auth .segmented { border-radius: 16px; overflow: hidden; border-color: rgba(201,162,77,.35); background: rgba(255,255,255,.6); }
.auth .btn { border-radius: 14px; }
@media (max-width: 640px) {
  .auth { padding: 24px 12px 56px; }
  .auth-panel { padding: 24px 18px; border-radius: 22px; }
}
.auth .field > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth .field > label .optional { font-size: .85em; }

/* ---------- Login and sign-up: logo on top, pill fields, round social buttons, photo panel on login ---------- */
.auth-logo { display: block; width: 64px; margin: 0 auto 10px; }
.auth-logo img { display: block; width: 64px; height: 64px; }
.auth-panel .form-title { text-align: center; }
.auth-panel > .muted:first-of-type, .auth-panel > p.muted { text-align: center; }
.auth .field input[type=text], .auth .field input[type=email], .auth .field input[type=password], .auth .field input[type=search] {
  min-height: 52px; padding: 12px 20px; border: 1px solid transparent; border-radius: 999px; background: #f6f2e8; }
.auth .field input:focus { background: #fff; border-color: #c9a24d; box-shadow: 0 0 0 4px rgba(220,185,95,.22); }
.auth .password-wrap .password-toggle { right: 14px; }
.auth .btn-primary { min-height: 54px; border-radius: 999px; font-size: 1.02rem; }
.auth .segmented { border-radius: 999px; padding: 4px; gap: 4px; }
.auth .segmented a { border-radius: 999px; }
.social-round { display: flex; justify-content: center; gap: 16px; }
.social-btn { display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 1px solid rgba(201,162,77,.3); border-radius: 50%;
  background: #fff; box-shadow: 0 4px 14px rgba(41,32,10,.08); cursor: pointer; transition: transform .15s ease, box-shadow .2s ease; touch-action: manipulation; }
.social-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(41,32,10,.12); }
.social-btn .icon { width: 24px; height: 24px; }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); }

/* Login: the form on the left, a photo with floating glass notes on the right (computers) */
.auth-split { position: relative; z-index: 1; display: grid; max-width: 1080px; margin: 0 auto; }
@media (min-width: 900px) {
  .auth-has-split { padding-top: 40px; }
  .auth-split { grid-template-columns: 1fr 1.1fr; align-items: stretch; gap: 0; padding: 14px; border-radius: 34px;
    background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.9); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 30px 70px rgba(127,90,28,.14); }
  .auth-split .auth-panel { max-width: 400px; width: 100%; margin: auto; padding: 40px 24px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.auth-visual { display: none; }
@media (min-width: 900px) {
  .auth-visual { position: relative; display: block; margin: 0; min-height: 560px; overflow: hidden; border-radius: 26px; }
  .auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .auth-chip { position: absolute; display: grid; gap: 4px; max-width: 250px; padding: 14px 16px; border-radius: 18px;
    background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0,0,0,.18); color: #33210a; font-size: .85rem; line-height: 1.35; }
  .auth-chip strong { font-size: .95rem; }
  .auth-chip span { color: #6b5a3c; }
  .auth-chip-top { top: 26px; left: 26px; background: linear-gradient(135deg, rgba(255,233,152,.92), rgba(220,185,95,.88)); }
  .auth-chip-bottom { right: 26px; bottom: 26px; }
}

/* Home photo: the wide garden picture */
.hero-media img { aspect-ratio: 1672 / 941; object-fit: cover; }

/* Login: plain white page, and the whole card is frosted glass */
.auth-has-split { background: #fff; }
.auth-has-split::before { display: none; }
@media (min-width: 900px) {
  .auth-has-split { padding: 48px 32px 64px; }
  .auth-split { max-width: 1180px; min-height: 640px; padding: 16px; border-radius: 36px;
    background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,247,226,.45));
    border: 1px solid rgba(255,255,255,.95);
    -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
    box-shadow: 0 40px 90px rgba(127,90,28,.18), 0 2px 10px rgba(41,32,10,.06), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(220,185,95,.18); }
  .auth-visual { min-height: 608px; }
  .auth-visual img { object-position: 22% center; }
  .auth-chip { background: rgba(255,255,255,.55); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
  .auth-chip-top { background: rgba(255,240,200,.6); }
}

/* Login and sign-up: white page and white glass everywhere; softly rounded fields (not square, not pills) */
.auth, .auth-has-split { background: #fff; }
.auth::before { display: none; }
.auth-panel, .auth-split .auth-panel {
  background: rgba(255,255,255,.72); border: 1px solid #fff;
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 70px rgba(41,32,10,.12), 0 4px 14px rgba(41,32,10,.06), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(201,162,77,.14); }
@media (min-width: 900px) {
  .auth-split { background: rgba(255,255,255,.72); }
  .auth-split .auth-panel { background: none; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.auth .field input[type=text], .auth .field input[type=email], .auth .field input[type=password], .auth .field input[type=search] {
  border-radius: 12px; background: rgba(255,255,255,.85); border: 1px solid rgba(201,162,77,.3); box-shadow: inset 0 1px 2px rgba(41,32,10,.04); }
.auth .btn-primary, .auth .btn { border-radius: 12px; }
.auth .segmented, .auth .segmented a { border-radius: 12px; }
@media (max-width: 640px) {
  .auth { padding: 20px 14px 48px; }
  .auth-panel { border-radius: 24px; box-shadow: 0 24px 60px rgba(41,32,10,.14), 0 2px 8px rgba(41,32,10,.06), inset 0 0 0 1px rgba(201,162,77,.16); }
}

/* Home: a bigger photo on the right */
@media (min-width: 900px) {
  .hero > .container.hero-grid { max-width: 1320px; }
  .hero-grid { grid-template-columns: .85fr 1.15fr; gap: 56px; }
  .hero-media { border-radius: 22px; box-shadow: 0 24px 60px rgba(127,90,28,.18); }
}
@media (min-width: 1300px) { .hero-media { margin-right: -40px; } }

/* ---------- My Account on computers: white page, frosted white glass cards (design only) ---------- */
@media (min-width: 641px) {
  .page-account { background: #fff; }
  .page-account .account-hero { background: #fff; border-bottom: 0; }
  .page-account .account-hero-inner, .page-account .editor-nav.is-merged, .page-account [data-account-tabs] .container,
  .page-account .account-body > .panel, .page-account .memorial-bar, .page-account .privacy-card {
    background: rgba(255,255,255,.72) !important; border: 1px solid #fff !important;
    -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 24px 60px rgba(41,32,10,.08), 0 2px 8px rgba(41,32,10,.04), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(201,162,77,.14) !important; }
  .page-account .account-hero-inner { padding: 28px 32px; border-radius: 28px; }
  .page-account .account-body > .panel { border-radius: 24px; }
  .page-account .memorial-bar, .page-account .privacy-card { border-radius: 18px; }
  .page-account .account-body { position: relative; }
  /* Soft gold light behind the glass, so the frost shows on a white page */
  .page-account main { position: relative; overflow: hidden; }
  .page-account main::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(28% 22% at 12% 8%, rgba(255,226,140,.38), transparent 70%),
      radial-gradient(26% 24% at 90% 22%, rgba(220,185,95,.22), transparent 70%),
      radial-gradient(30% 26% at 80% 75%, rgba(255,240,200,.45), transparent 70%),
      radial-gradient(26% 24% at 8% 70%, rgba(201,162,77,.16), transparent 70%); }
  .page-account .account-body .field input, .page-account .account-body .field select, .page-account .account-body .field textarea,
  .page-account .account-body .bio-editor, .page-account .copy-row input {
    border-radius: 12px; background: rgba(255,255,255,.85); border: 1px solid rgba(201,162,77,.3); }
  .page-account .account-body .btn { border-radius: 12px; }
  .page-account .qr-thumb { border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(41,32,10,.08); }
  .page-account .account-logout .btn { border-radius: 12px; background: rgba(255,255,255,.8); }
}

/* Home: four products in one row on wide screens */
@media (min-width: 1200px) { .home-products .product-grid, .product-grid.is-four { grid-template-columns: repeat(4, 1fr); } }

.price-prefix { font-size: .62em; font-weight: 600; color: var(--muted, #6b6457); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }

/* Product cards: prices and links line up across the row; the note sits on its own line */
.product-card, .product-card .product-link { height: 100%; }
.product-card .product-link { display: flex; flex-direction: column; }
.product-card .product-body { flex: 1; display: flex; flex-direction: column; }
.product-card .product-tagline { flex: 1; }
.product-card .price { margin-top: 4px; }
.product-card .price-note { display: block; margin: 2px 0 0; }
.product-card .text-link { align-self: flex-start; }

/* ---------- Home: How it works ---------- */
.hiw { background: linear-gradient(180deg, #fff 0%, #fbf8f2 100%); position: relative; overflow: hidden; }
.hiw::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30% 40% at 90% 10%, rgba(255,226,140,.22), transparent 70%), radial-gradient(28% 36% at 5% 85%, rgba(220,185,95,.14), transparent 70%); }
.hiw .container { position: relative; }
.hiw-kicker { font: 600 .78rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #a8802f; margin: 0 0 12px; }
.hiw .section-title { margin-bottom: 10px; max-width: 18em; }
.hiw-lead { color: var(--muted); max-width: 36em; margin: 0 0 40px; font-size: 1.05rem; }

.hiw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: none; }
.hiw-steps li.hiw-step { border-top: 0; padding: 0; }
.hiw-step { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start; }
.hiw-step:not(:last-child)::after { content: ''; position: absolute; left: 25px; top: 56px; bottom: -14px; width: 2px;
  background: linear-gradient(180deg, rgba(201,162,77,.55), rgba(201,162,77,.12)); }
.hiw-num { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--ink);
  font: 600 1.3rem/1 var(--serif); box-shadow: 0 8px 20px rgba(185,140,63,.28), inset 0 1px 0 rgba(255,255,255,.7); }
.hiw-body { background: rgba(255,255,255,.78); border: 1px solid #fff; border-radius: 20px; padding: 20px 22px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(41,32,10,.07), inset 0 0 0 1px rgba(201,162,77,.14); }
.hiw-body h3 { font: 600 1.18rem/1.3 var(--serif); margin: 2px 0 6px; }
.hiw-body p { margin: 0; color: var(--muted); }

.hiw-choices { display: grid; gap: 10px; margin-top: 16px; align-items: stretch; }
.hiw-choice { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid rgba(201,162,77,.3); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.hiw-choice:hover { transform: translateY(-2px); border-color: #c9a24d; box-shadow: 0 12px 28px rgba(185,140,63,.18); }
.hiw-choice .hiw-ic { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: #fbf3df; color: #9a7428; }
.hiw-choice strong { font: 600 1rem/1.25 var(--sans); }
.hiw-choice span { font-size: .88rem; color: var(--muted); line-height: 1.4; }
.hiw-or { align-self: center; justify-self: center; font: 600 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #a8802f;
  padding: 6px 10px; border-radius: 999px; background: #fbf3df; }

.hiw-features { margin-top: 48px; }
.hiw-features-title { font: 600 1.25rem/1.3 var(--serif); margin: 0 0 18px; }
.hiw-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hiw-grid li { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.8); border: 1px solid #fff;
  box-shadow: 0 10px 26px rgba(41,32,10,.06), inset 0 0 0 1px rgba(201,162,77,.12); transition: transform .2s, box-shadow .2s; }
.hiw-grid li:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(41,32,10,.1), inset 0 0 0 1px rgba(201,162,77,.3); }
.hiw-grid .hiw-ic { width: 38px; height: 38px; padding: 8px; border-radius: 11px; background: var(--gold); color: var(--ink); margin-bottom: 4px; }
.hiw-grid strong { font: 600 .98rem/1.3 var(--sans); color: var(--ink); }
.hiw-grid span { font-size: .86rem; color: var(--muted); line-height: 1.45; }

@media (min-width: 760px) {
  .hiw-choices { grid-template-columns: 1fr auto 1fr; }
  .hiw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .hiw-grid li { padding: 20px; }
  .hiw-body { padding: 24px 28px; }
}
@media (min-width: 1000px) {
  .hiw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
  .hiw-step-start { grid-column: 1 / -1; }
  .hiw-step:not(:last-child)::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hiw-choice, .hiw-grid li { transition: none; } }
@media (min-width: 1000px) {
  .hiw-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hiw-step:not(.hiw-step-start) { grid-template-columns: 1fr; gap: 0; }
  .hiw-step:not(.hiw-step-start) .hiw-num { position: absolute; top: -14px; left: 22px; width: 44px; height: 44px; font-size: 1.1rem; z-index: 1; }
  .hiw-step:not(.hiw-step-start) .hiw-body { height: 100%; padding-top: 42px; }
  .hiw-steps { row-gap: 40px; }
}

/* How it works: entrance animation (only when JavaScript runs and motion is allowed) */
.hiw-anim .hiw-step, .hiw-anim .hiw-choice, .hiw-anim .hiw-grid li, .hiw-anim .hiw-media {
  opacity: 0; transform: translateY(26px) scale(.98);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.hiw-anim .hiw-step.is-in, .hiw-anim .hiw-choice.is-in, .hiw-anim .hiw-grid li.is-in, .hiw-anim .hiw-media.is-in { opacity: 1; transform: none; }
.hiw-anim .hiw-step .hiw-num { transform: scale(.4) rotate(-20deg); transition: transform .6s cubic-bezier(.3,1.6,.5,1) .25s; }
.hiw-anim .hiw-step.is-in .hiw-num { transform: none; }
.hiw-anim .hiw-grid li.is-in .hiw-ic { animation: hiwPop .6s cubic-bezier(.3,1.6,.5,1) both; animation-delay: inherit; }
@keyframes hiwPop { from { transform: scale(.5) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hiw-num { position: relative; }
.hiw-step.is-in .hiw-num::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(201,162,77,.5);
  animation: hiwRing 2.4s ease-out 1s infinite; }
@keyframes hiwRing { 0% { transform: scale(.85); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.hiw-anim .hiw-grid li.is-in:hover { transform: translateY(-3px); }
.hiw-anim .hiw-choice.is-in:hover { transform: translateY(-2px); }

/* How it works: photos inside steps 3 and 4 */
.hiw-media { margin: 0 0 16px; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 2; background: #efe9df; box-shadow: 0 10px 24px rgba(41,32,10,.12); }
.hiw-media > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.hiw-step:hover .hiw-media > img { transform: scale(1.04); }
.hiw-anim .hiw-step .hiw-media > img { transform: scale(1.12); }
.hiw-anim .hiw-step.is-in .hiw-media > img { transform: none; transition-delay: .2s; }
.hiw-anim .hiw-step.is-in:hover .hiw-media > img { transform: scale(1.04); transition-delay: 0s; }
@media (min-width: 1000px) {
  .hiw-step:not(.hiw-step-start) .hiw-body { display: flex; flex-direction: column; }
}
/* Step 2: a small drawing of a memorial page */
.hiw-mock { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 0 14px 14px;
  background: linear-gradient(180deg, #f6efe0, #fff); }
.hiw-mock-banner { position: absolute; inset: 0 0 52% 0; background: url('../img/memorial-garden.jpg') center 40% / cover; }
.hiw-mock-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(41,32,10,0) 30%, rgba(41,32,10,.35)); }
.hiw-mock-card { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 34px 10px 12px; border-radius: 14px; background: rgba(255,255,255,.9); border: 1px solid #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 24px rgba(41,32,10,.12); }
.hiw-mock-avatar { position: absolute; top: -28px; width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(41,32,10,.18); object-fit: contain; padding: 6px; }
.hiw-mock-kicker { font: italic .72rem/1.2 var(--serif); color: #a8802f; }
.hiw-mock-name { font: 600 .98rem/1.25 var(--serif); color: var(--ink); }
.hiw-mock-dates { font-size: .74rem; color: var(--muted); }
.hiw-mock-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.hiw-mock-tabs i { font: 600 .66rem/1 var(--sans); font-style: normal; padding: 5px 8px; border-radius: 999px; background: #fbf3df; color: #8a6a26; }
.hiw-mock-tabs i:first-child { background: var(--gold); color: var(--ink); }

/* ---------- Fading photo slideshow (home hero, login) ---------- */
.fade-slides { position: relative; }
.hero-media.fade-slides { aspect-ratio: 1672 / 941; }
.fade-slides .fade-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto;
  opacity: 0; animation: fadeSlide 18s ease-in-out infinite; will-change: opacity, transform; }
.fade-slides .fade-slide:nth-of-type(1) { animation-delay: -1.5s; }
.fade-slides .fade-slide:nth-of-type(2) { animation-delay: 4.5s; }
.fade-slides .fade-slide:nth-of-type(3) { animation-delay: 10.5s; }
@keyframes fadeSlide {
  0% { opacity: 0; transform: scale(1.06); }
  8% { opacity: 1; }
  33% { opacity: 1; }
  42% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
.auth-visual .slide-family { object-position: 50% center; }
.auth-visual .slide-scan { object-position: 42% center; }
@media (prefers-reduced-motion: reduce) {
  .fade-slides .fade-slide { animation: none; }
  .fade-slides .fade-slide:first-of-type { opacity: 1; }
}

/* ---------- How it works: tap a picture to see it bigger ---------- */
.hiw-media[data-zoom] { cursor: zoom-in; }
.hiw-media[data-zoom]:focus-visible { outline: 3px solid #c9a24d; outline-offset: 3px; }
.hiw-media[data-zoom]::after { content: ''; position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2329200a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); opacity: .9; transition: transform .2s; }
.hiw-media[data-zoom] { position: relative; }
.hiw-media[data-zoom]:hover::after { transform: scale(1.1); }
.zoom-view { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(20,16,8,.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.zoom-view.is-open { opacity: 1; }
.zoom-view-frame { max-width: min(1100px, 100%); max-height: 100%; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45);
  transform: scale(.94); transition: transform .3s cubic-bezier(.2,.8,.2,1); background: #fff; }
.zoom-view.is-open .zoom-view-frame { transform: none; }
.zoom-view-frame > img { display: block; width: 100%; height: auto; max-height: calc(100vh - 48px); object-fit: contain; }
.zoom-view-frame.hiw-mock { width: min(560px, 100%); aspect-ratio: 3 / 2; cursor: default; }
.zoom-view-frame.hiw-mock::after { display: none; }
.zoom-view-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #29200a; font: 400 26px/1 var(--sans); }
body.zoom-open { overflow: hidden; }

/* Slides are <picture> elements now */
.fade-slides picture.fade-slide { display: block; }
.fade-slides picture.fade-slide img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: auto; position: static; }
.auth-visual picture.fade-slide img { object-position: 30% center; }
.auth-visual picture.fade-slide:nth-of-type(n+2) img { object-position: 62% center; }

/* Login: show the whole photo; a blurred copy of it fills the panel around it */
.auth-visual { background: #e9dcc3; }
.fade-slides .fade-slide.is-fit { display: grid; place-items: center; overflow: hidden; }
.fade-slide.is-fit picture { display: block; }
.fade-slide.is-fit .slide-bg { position: absolute; inset: -40px; }
.fade-slide.is-fit .slide-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(22px) saturate(1.15) brightness(1.03); }
.fade-slide.is-fit .slide-fg { position: relative; width: 100%; padding: 0 14px; }
.fade-slide.is-fit .slide-fg img { width: 100%; height: auto; border-radius: 16px; box-shadow: 0 18px 44px rgba(41,32,10,.28); }
.auth-visual .fade-slide.is-fit .slide-fg img { position: static; inset: auto; height: auto; object-fit: contain; }
.auth-visual .fade-slide.is-fit .slide-bg img { position: absolute; inset: 0; }

/* Login: notifications pop in, stay a moment, then slip away, one after another.
   Only opacity and transform move, so the browser animates them cheaply. */
.auth-note { opacity: 0; transform: translateY(-12px) scale(.96); animation: authNote 16s ease-in-out infinite; will-change: opacity, transform; z-index: 2; }
.auth-chip-bottom.auth-note { transform: translateY(12px) scale(.96); animation-name: authNoteUp; }
.auth-note.n1 { animation-delay: .6s; }
.auth-note.n2 { animation-delay: 4.6s; }
.auth-note.n3 { animation-delay: 8.6s; }
.auth-note.n4 { animation-delay: 12.6s; }
.auth-note em { font: 500 .7rem/1 var(--sans); font-style: normal; color: #9a7a3e; margin-top: 2px; }
@keyframes authNote {
  0% { opacity: 0; transform: translateY(-12px) scale(.96); }
  4% { opacity: 1; transform: none; }
  20% { opacity: 1; transform: none; }
  25% { opacity: 0; transform: translateY(-8px) scale(.98); }
  100% { opacity: 0; transform: translateY(-12px) scale(.96); }
}
@keyframes authNoteUp {
  0% { opacity: 0; transform: translateY(12px) scale(.96); }
  4% { opacity: 1; transform: none; }
  20% { opacity: 1; transform: none; }
  25% { opacity: 0; transform: translateY(8px) scale(.98); }
  100% { opacity: 0; transform: translateY(12px) scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-note { animation: none; }
  .auth-note.n1, .auth-note.n2 { opacity: 1; transform: none; }
}
/* Login: one still photo, shown whole */
.fade-slides .fade-slide.is-static { animation: none; opacity: 1; transform: none; }
/* Login: one still photo filling the panel, like the dashboard login */
.auth-visual .auth-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% center; }

/* ---------- Funeral backgrounds: drawn pieces (assets/img/wallpapers/*.svg, a few KB each, cached)
   layered over a soft sky. On the memorial page they stay put while the page scrolls. ---------- */
.wp-heavenly-cross { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-light.svg') right 9% top 12% / min(26%, 260px) auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-lily-peace { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-white-roses { --wpf: url('../img/wallpapers/roses-white-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-white-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-light.svg') right 9% top 12% / min(26%, 260px) auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-dove-peace { --wpf: url('../img/wallpapers/olive-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/olive-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/dove.svg') right 7% top 12% / min(30%, 300px) auto no-repeat, url('../img/wallpapers/sky-blue.svg') center / cover no-repeat, #e8f0f8; background: var(--wpf); }
.wp-golden-heaven { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-gold.svg') right 10% top 12% / min(16%, 150px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
.wp-golden-lilies { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
.wp-sunset-dove { --wpf: url('../img/wallpapers/roses-white-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-white-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/dove.svg') right 7% top 12% / min(30%, 300px) auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
.wp-blue-cross { --wpf: url('../img/wallpapers/babysbreath-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/babysbreath-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-light.svg') right 9% top 12% / min(26%, 260px) auto no-repeat, url('../img/wallpapers/sky-blue.svg') center / cover no-repeat, #e8f0f8; background: var(--wpf); }
.wp-lavender-lily { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-lavender.svg') center / cover no-repeat, #f1eef8; background: var(--wpf); }
.wp-lavender-dove { --wpf: url('../img/wallpapers/babysbreath-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/babysbreath-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/dove.svg') right 7% top 12% / min(30%, 300px) auto no-repeat, url('../img/wallpapers/sky-lavender.svg') center / cover no-repeat, #f1eef8; background: var(--wpf); }
.wp-rose-heaven { --wpf: url('../img/wallpapers/roses-pink-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-pink-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-rose.svg') center / cover no-repeat, #f9ecee; background: var(--wpf); }
.wp-pink-cross { --wpf: url('../img/wallpapers/roses-pink-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-pink-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-light.svg') right 9% top 12% / min(26%, 260px) auto no-repeat, url('../img/wallpapers/sky-rose.svg') center / cover no-repeat, #f9ecee; background: var(--wpf); }
.wp-red-roses { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/roses-red-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-red-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-red-cross { --wpf: url('../img/wallpapers/roses-red-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-red-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-gold.svg') right 10% top 12% / min(16%, 150px) auto no-repeat, url('../img/wallpapers/sky-ivory.svg') center / cover no-repeat, #f7f2e8; background: var(--wpf); }
.wp-candle-vigil { --wpf: url('../img/wallpapers/babysbreath-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/babysbreath-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/candles.svg') center bottom / min(44%, 380px) auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
.wp-ivory-frame { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/olive-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/olive-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/sky-ivory.svg') center / cover no-repeat, #f7f2e8; background: var(--wpf); }
.wp-ivory-lilies { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-gold.svg') right 10% top 12% / min(16%, 150px) auto no-repeat, url('../img/wallpapers/sky-ivory.svg') center / cover no-repeat, #f7f2e8; background: var(--wpf); }
.wp-ivory-roses { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/roses-white-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-white-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-ivory.svg') center / cover no-repeat, #f7f2e8; background: var(--wpf); }
.wp-two-doves { --wpf: url('../img/wallpapers/roses-white-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-white-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/doves.svg') right 6% top 11% / min(38%, 380px) auto no-repeat, url('../img/wallpapers/sky-blue.svg') center / cover no-repeat, #e8f0f8; background: var(--wpf); }
.wp-olive-branch { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/olive-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/olive-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/dove.svg') right 7% top 12% / min(30%, 300px) auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-babys-breath { --wpf: url('../img/wallpapers/babysbreath-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/babysbreath-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-gold-cross { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/cross-gold.svg') right 10% top 12% / min(16%, 150px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-ivory.svg') center / cover no-repeat, #f7f2e8; background: var(--wpf); }
.wp-heaven-light { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-lily-gold-cross { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-gold.svg') right 10% top 12% / min(16%, 150px) auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
.wp-rose-vigil { --wpf: url('../img/wallpapers/roses-pink-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-pink-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/candles.svg') center bottom / min(44%, 380px) auto no-repeat, url('../img/wallpapers/sky-rose.svg') center / cover no-repeat, #f9ecee; background: var(--wpf); }
.wp-white-vigil { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/candles.svg') center bottom / min(44%, 380px) auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-dove-lilies { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/dove.svg') right 7% top 12% / min(30%, 300px) auto no-repeat, url('../img/wallpapers/sky-grey.svg') center / cover no-repeat, #eef0f2; background: var(--wpf); }
.wp-blue-lilies { --wpf: url('../img/wallpapers/lilies-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/lilies-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/rays.svg') center top / 100% auto no-repeat, url('../img/wallpapers/sky-blue.svg') center / cover no-repeat, #e8f0f8; background: var(--wpf); }
.wp-lavender-roses { --wpf: url('../img/wallpapers/roses-white-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/roses-white-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/cross-light.svg') right 9% top 12% / min(26%, 260px) auto no-repeat, url('../img/wallpapers/sky-lavender.svg') center / cover no-repeat, #f1eef8; background: var(--wpf); }
.wp-eternal-rest { --wpf: url('../img/wallpapers/frame.svg') center / 100% 100% no-repeat, url('../img/wallpapers/babysbreath-l.svg') left bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/babysbreath-r.svg') right bottom / min(40%, 380px) auto no-repeat, url('../img/wallpapers/doves.svg') right 6% top 11% / min(38%, 380px) auto no-repeat, url('../img/wallpapers/sky-gold.svg') center / cover no-repeat, #fbf1dc; background: var(--wpf); }
/* The memorial page: the background is painted on a layer fixed to the screen (works on phones too). */
.memorial-simple.wpf { background: none; position: relative; isolation: isolate; }
.memorial-simple.wpf::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--wpf); pointer-events: none; }
.wp-swatch[class*="wp-"] { background-color: #f3f1ec; }

/* ---------- The owner's own photo as the memorial background ---------- */
.memorial-simple.wpc { background: none; position: relative; isolation: isolate; }
.ms-bg-photo { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; pointer-events: none; }
.memorial-simple.wpc::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.35) 40%, rgba(255,255,255,.55)); }   /* keeps text easy to read */
.memorial-simple.wpc .ms-head { background: transparent; }
.wp-own { background: #eee; }
.wp-own > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wp-own .wp-sample { position: relative; }
.wp-upload { display: grid; gap: 8px; margin: 0 20px; padding: 16px; border: 1px dashed rgba(201,162,77,.6); border-radius: 14px; background: #fffaf0; }
.wp-upload-title { margin: 0; font-weight: 600; color: var(--ink); }
.wp-upload-help { margin: 0; font-size: .86rem; color: var(--muted); }
.wp-upload input[type=file] { font-size: .9rem; max-width: 100%; }
.wp-rights { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--ink); }
.wp-rights input { margin-top: 3px; }
.wp-upload-remove { margin: 10px 20px 20px; }
.wp-modal > .wp-upload:last-child { margin-bottom: 20px; }
.wp-modal .wp-upload { margin: 0 0 16px; }
.wp-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-or { margin: 4px 0 12px; font: 600 .78rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* "Use your own photo": one drop area with a preview */
.wp-modal .wp-upload { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; border: 0; background: none; }
.wp-drop { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 14px; cursor: pointer;
  border-radius: 16px; background: linear-gradient(135deg, #fffaf0, #fff); border: 1.5px dashed rgba(201,162,77,.55);
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.wp-drop:hover { border-color: #c9a24d; box-shadow: 0 10px 26px rgba(185,140,63,.14); transform: translateY(-1px); }
#wp-file:focus-visible + .wp-drop { outline: 3px solid rgba(201,162,77,.6); outline-offset: 2px; }
.wp-drop-art { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #fbf0d5, #f3e1b3); color: #8a6a26; }
.wp-drop-icon { width: 34px; height: 34px; }
.wp-drop-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wp-drop.has-photo .wp-drop-icon { display: none; }
.wp-drop-text { display: grid; gap: 3px; min-width: 0; }
.wp-drop-text strong { font: 600 1rem/1.25 var(--serif); color: var(--ink); }
.wp-drop-text span { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-drop.is-busy { pointer-events: none; opacity: .75; }
.wp-drop.is-busy .wp-drop-art::after { content: ''; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.7); border-top-color: #c9a24d; animation: wpSpin .8s linear infinite; }
@keyframes wpSpin { to { transform: rotate(360deg); } }
.wp-modal .wp-rights { font-size: .88rem; padding: 0 4px; }
.wp-modal .wp-rights input { accent-color: #b98c3f; width: 16px; height: 16px; }
.wp-upload-note { margin: 0; padding: 0 4px; font-size: .8rem; color: var(--muted); }
.wp-upload-note.is-warn { color: #a5422f; }
.wp-remove-link { justify-self: start; padding: 0 4px; border: 0; background: none; color: #a5422f; font: 500 .85rem var(--sans); text-decoration: underline; cursor: pointer; }

/* ---------- Memorial page: modern hero on computers (big photo, huge name, italic years) ---------- */
.ms-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ms-hero-actions p { margin: 0; }
.ms-head.has-cutout .ms-photo { background: radial-gradient(70% 70% at 50% 40%, #fff, #f3ead8); }
.ms-head.has-cutout .ms-photo img { object-fit: cover; object-position: center 20%; }
@media (min-width: 900px) {
  .memorial-simple .ms-head.ms-hero-head { padding: 56px 0 40px; text-align: left; }
  .memorial-simple .ms-head.ms-hero-head:not([class*=" wp"]) { background: radial-gradient(60% 70% at 78% 45%, rgba(246,232,200,.75), transparent 70%), linear-gradient(180deg, #fff, #fbf8f2); }
  .ms-hero-head .ms-hero-wrap { max-width: 1180px; text-align: left; }
  .ms-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 56px; min-height: 500px; }
  .ms-hero-text { order: 1; }
  .ms-hero-head .ms-hero-photo { order: 2; justify-self: end; margin: 0; width: 100%; max-width: 460px; aspect-ratio: 4 / 5; padding: 0;
    border-radius: 30px; transform: none; overflow: hidden; background: #f3ede2; box-shadow: 0 30px 70px rgba(41,32,10,.18), 0 4px 12px rgba(41,32,10,.06); }
  .ms-hero-head .ms-hero-photo a { border-radius: 30px; height: 100%; }
  .ms-hero-head .ms-hero-photo img { object-fit: cover; }
  /* the photo without its background: the person stands on soft light, no frame */
  .ms-hero-head.has-cutout .ms-hero-photo { background: transparent; box-shadow: none; border-radius: 0; max-width: 520px; aspect-ratio: 1; }
  .ms-hero-head.has-cutout .ms-hero-photo a { border-radius: 0; }
  .ms-hero-head.has-cutout .ms-hero-photo img { object-fit: contain; object-position: center bottom; filter: drop-shadow(0 24px 30px rgba(41,32,10,.22));
    -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
  .ms-hero-head .ms-photo-initial { font-size: 7rem; border-radius: 30px; }
  .ms-hero-head .ms-label { font-size: .8rem; letter-spacing: .32em; color: #a8802f; margin-bottom: 14px; }
  .ms-hero-head .ms-name { font: 600 clamp(3.2rem, 5.6vw, 5.6rem)/1.02 var(--serif); letter-spacing: -.025em; margin: 0 0 14px; }
  .ms-hero-head .ms-dates { font: italic 400 clamp(1.5rem, 2.3vw, 2.2rem)/1.2 var(--serif); color: #8a6a26; letter-spacing: 0; }
  .ms-hero-head .ms-epitaph { margin-top: 22px; max-width: 30em; font-size: 1.3rem; color: #4b4436; }
  .ms-hero-head .ms-hero-actions { justify-content: flex-start; margin-top: 26px; }
  .ms-hero-head .ms-hero-actions .btn { margin-top: 0; }
}

/* Memorial hero (computers): bigger photo on the right, facts on the left */
.ms-hero-facts { display: none; }
@media (min-width: 900px) {
  .ms-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; min-height: 600px; }
  .ms-hero-head .ms-hero-photo { max-width: 560px; }
  .ms-hero-head.has-cutout .ms-hero-photo { max-width: 640px; aspect-ratio: 5 / 6; overflow: visible; }
  .ms-hero-head.has-cutout .ms-hero-photo a { overflow: visible; }
  .ms-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin: 28px 0 0; max-width: 560px;
    padding: 22px 24px; border-radius: 20px; background: rgba(255,255,255,.72); border: 1px solid #fff;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(41,32,10,.08), inset 0 0 0 1px rgba(201,162,77,.14); }
  .ms-hero-facts div { min-width: 0; }
  .ms-hero-facts dt { font: 600 .7rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #a8802f; margin-bottom: 4px; }
  .ms-hero-facts dd { margin: 0; font: 500 1.02rem/1.35 var(--serif); color: var(--ink); }
  /* on a wallpaper the hero is see-through, so the photo stands right on the chosen background */
  .memorial-simple[class*=" wp-"] .ms-head.ms-hero-head, .memorial-simple.wpc .ms-head.ms-hero-head { background: transparent; }
}

/* ---------- Memorial pages on computers: slim glass header, links tucked into "Menu" ---------- */
.nav-more { display: none; }
@media (min-width: 900px) {
  .page-memorial { --header-h: 54px; }
  .page-memorial .site-header { background: rgba(255,255,255,.62); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(201,162,77,.25); box-shadow: none; transition: transform .35s ease, background .2s; }
  .page-memorial .site-header.is-tucked { transform: translateY(-100%); }
  .page-memorial .header-inner { height: 54px; }
  .page-memorial .brand-mark { width: 26px; height: 26px; }
  .page-memorial .brand-text { font-size: 1rem; }
  .page-memorial .main-nav { position: relative; inset: auto; top: auto; justify-content: flex-end; gap: 18px; }
  .page-memorial .nav-more { display: inline-flex; align-items: center; gap: 6px; order: 2; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(201,162,77,.45);
    background: rgba(255,255,255,.7); color: var(--ink); font: 500 .85rem var(--sans); cursor: pointer; }
  .page-memorial .nav-more .icon { width: 16px; height: 16px; }
  .page-memorial .nav-more[aria-expanded="true"] { background: #fff; border-color: #c9a24d; }
  .page-memorial .nav-links { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 200px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.96); border: 1px solid #fff;
    box-shadow: 0 18px 44px rgba(41,32,10,.16), inset 0 0 0 1px rgba(201,162,77,.18); }
  .page-memorial .nav-links.is-open { display: flex; animation: navDrop .18s ease-out; }
  .page-memorial .nav-links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .92rem; box-shadow: none !important; }
  .page-memorial .nav-links a:hover { background: #fbf3df; }
  .page-memorial .nav-actions { order: 1; gap: 16px; }
  .page-memorial .nav-actions .nav-link { font-size: .85rem; }
  .page-memorial .nav-actions .btn { padding: 6px 14px; font-size: .85rem; min-height: 0; }
  @keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* ---------- Memorial pages: header edge to edge; everything fades away after 10 s without activity ---------- */
@media (min-width: 900px) {
  .page-memorial .site-header .header-inner { max-width: none; width: 100%; padding: 0 28px; }
  .page-memorial .main-nav { padding-left: 24px; }
}
.page-memorial .fab, .page-memorial .music-pill, .page-memorial [data-music] {
  transition: opacity .8s ease, visibility 0s linear 0s; }
/* idle: the bar and buttons go; our logo stays where it is, for everyone who sees the screen */
.page-memorial .site-header { transition: background-color .8s ease, border-color .8s ease, box-shadow .8s ease, transform .35s ease; }
.page-memorial .main-nav, .page-memorial .header-mobile { transition: opacity .8s ease, visibility 0s linear 0s; }
.page-memorial.is-idle .site-header { background: transparent !important; border-color: transparent !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; transform: none !important; }
.page-memorial.is-idle .main-nav, .page-memorial.is-idle .header-mobile, .page-memorial.is-idle .fab, .page-memorial.is-idle .music-pill, .page-memorial.is-idle [data-music] {
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
.page-memorial.is-idle .brand { filter: drop-shadow(0 1px 6px rgba(255,255,255,.9)); }
.page-memorial.is-idle { cursor: none; }
@media (prefers-reduced-motion: reduce) { .page-memorial .site-header { transition: none; } }

/* Memorial hero: photo sits higher (less gap under the header); "In Loving Memory" in a script font */
@media (min-width: 900px) {
  .memorial-simple .ms-head.ms-hero-head { padding: 8px 0 36px; }
  .ms-hero { align-items: start; min-height: 0; }
  .ms-hero-text { align-self: center; padding-top: 24px; }
  .ms-hero-head .ms-hero-photo { margin-top: -6px; }
  .ms-hero-head .ms-label { font: 400 clamp(2.4rem, 3.4vw, 3.3rem)/1.1 'Great Vibes', 'Source Serif 4', cursive; letter-spacing: 0; text-transform: none; color: #a8802f; margin: 0 0 6px; }
}
/* Memorial hero on computers: no Invite button, and no date line when the details card already shows Born / Passed away */
@media (min-width: 900px) {
  .ms-hero-head .ms-invite-wide { display: none; }
  .ms-hero-text:has(.ms-hero-facts) .ms-dates { display: none; }
}

/* =====================================================================
   Memorial sections, new design (computers and phones):
   floating glass section bar with line icons, script titles, glass cards,
   and a family tree with gold-ringed photos.
   ===================================================================== */
.memorial-simple .ms-tabs { background: transparent !important; border: 0; box-shadow: none; }
.memorial-simple .ms-tabs-inner { width: max-content; max-width: calc(100% - 24px); margin: 6px auto 0; padding: 6px; gap: 4px; justify-content: flex-start;
  border-radius: 999px; background: rgba(255,255,255,.64); border: 1px solid rgba(255,255,255,.95);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 14px 34px rgba(41,32,10,.09), inset 0 0 0 1px rgba(201,162,77,.18); scrollbar-width: none; }
.memorial-simple .ms-tabs-inner::-webkit-scrollbar { display: none; }
.memorial-simple .ms-tabs a { position: relative; gap: 8px; padding: 10px 18px; border-radius: 999px; background: transparent; box-shadow: none;
  font: 500 .9rem/1 var(--sans); letter-spacing: 0; text-transform: none; color: #6b5d44; transform: none; }
.memorial-simple .ms-tabs a:hover { color: var(--ink); background: rgba(255,255,255,.6); transform: none; }
.memorial-simple .ms-tabs a.is-active { background: #fff; color: var(--ink); box-shadow: 0 6px 16px rgba(41,32,10,.1); }
.memorial-simple .ms-tabs a.is-active::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px;
  background: linear-gradient(90deg, #e9c76d, #b98c3f); }
.ms-tab-ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.memorial-simple .ms-tabs a.is-active .ms-tab-ic { color: #a8802f; }
.memorial-simple .ms-count, .memorial-simple .ms-tabs a.is-active .ms-count { background: #f4e3b5; color: #7a5a1c; font-weight: 600; }

/* glass section cards */
.memorial-simple .memorial-body .memorial-section { position: relative; margin-top: 28px; padding: 40px 44px 44px; border-radius: 30px; text-align: left;
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.95);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 28px 64px rgba(41,32,10,.09), inset 0 0 0 1px rgba(201,162,77,.14); }
/* titles: small kicker, gold script name, a ✦ divider */
.memorial-simple .ms-kicker { margin: 0; text-align: center; font: 600 .7rem/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: #b0893c; }
.memorial-simple .memorial-body .memorial-heading { display: block; margin: 6px 0 22px; padding: 0 0 18px; border: 0; text-align: center;
  font: 400 clamp(2.4rem, 5vw, 3.3rem)/1.05 'Great Vibes', var(--serif), cursive; color: #a8802f; letter-spacing: 0;
  background: linear-gradient(90deg, transparent, #d8b867 40%, transparent 40.1%, transparent 59.9%, #d8b867 60%, transparent) center bottom / 150px 1px no-repeat; }
.memorial-simple .memorial-body .memorial-heading::after { content: '✦'; display: block; margin: 8px auto -26px; width: 20px; font: 400 .8rem/1 var(--sans); color: #c9a24d; }
.memorial-simple .ms-sub { max-width: 34em; margin: 0 auto 26px; text-align: center; font: italic 400 1.06rem/1.6 var(--serif); color: #6b5d44; }
.memorial-simple .memorial-bio { font: 400 1.08rem/1.8 var(--serif); color: #3e3627; }
.memorial-simple .memorial-bio > p:first-child::first-letter { float: left; margin: 6px 10px 0 0; font: 400 3.6rem/.8 var(--serif); color: #a8802f; }
/* Photos keep their own simple headers (album and year lists) */
.memorial-simple .ms-panel[data-panel="photos"] .memorial-section { background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.95); padding: 32px 36px; }

/* family tree: soft canvas, gold rings, serif names */
.memorial-simple .ftree { background: none; padding: 8px 0 12px; max-height: none; --tree-line: #dcc285; }
.memorial-simple .ftree-label { background: #fff; color: #8a6a26; border: 0; box-shadow: inset 0 0 0 1px rgba(201,162,77,.32); letter-spacing: .24em; font-size: .64rem; }
.memorial-simple .ftree-gen + .ftree-gen::before, .memorial-simple .ftree-row::before, .memorial-simple .ftree-row > .ftree-card::before,
.memorial-simple .ftree-couple > .ftree-card:first-child::before { background: #dcc285 !important; }
.memorial-simple .ftree-card { width: 150px; padding: 6px 6px 4px; border: 0; background: transparent; box-shadow: none; gap: 4px; }
a.memorial-simple .ftree-card:hover, .memorial-simple a.ftree-card:hover { transform: translateY(-3px); box-shadow: none; }
.memorial-simple .ftree-avatar { width: 104px; height: 104px; font-size: 2rem; border: 4px solid #fff;
  box-shadow: 0 0 0 4px #d9b45e, 0 0 0 5px rgba(169,124,50,.5), 0 14px 30px rgba(120,86,25,.25); background: #f6ecd6; margin-bottom: 8px; }
.memorial-simple .ftree-card.is-me .ftree-avatar { width: 130px; height: 130px; }
.memorial-simple .ftree-card.is-me { border: 0; box-shadow: none; }
.memorial-simple .ftree-name { font: 600 1.02rem/1.25 var(--serif); color: var(--ink); }
.memorial-simple .ftree-role { background: none; color: #8b7b5c; font: 500 .74rem/1.4 var(--sans); letter-spacing: .04em; text-transform: none; padding: 0; }
.memorial-simple .is-me .ftree-role { margin-top: 4px; padding: 5px 10px; border-radius: 999px; background: linear-gradient(135deg, #fff0bf, #e2bf68); color: #6e4f12;
  font: 600 .64rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.memorial-simple .is-me .ftree-role::before { content: '✦ '; }
.memorial-simple a.ftree-card .ftree-avatar { transition: transform .25s ease, box-shadow .25s ease; }
.memorial-simple a.ftree-card:hover .ftree-avatar { transform: scale(1.04); box-shadow: 0 0 0 4px #e5c36c, 0 0 0 5px rgba(169,124,50,.55), 0 18px 36px rgba(120,86,25,.3); }

/* phones */
@media (max-width: 639px) {
  .memorial-simple .ms-tabs-inner { margin-top: 4px; }
  .memorial-simple .ms-tabs a { padding: 9px 13px; font-size: .82rem; gap: 6px; }
  .ms-tab-ic { width: 15px; height: 15px; }
  .memorial-simple .memorial-body .memorial-section { margin-top: 20px; padding: 28px 18px 30px; border-radius: 24px; }
  .memorial-simple .memorial-body .memorial-heading { font-size: 2.3rem; margin-bottom: 18px; }
  .memorial-simple .ms-sub { font-size: .98rem; margin-bottom: 18px; }
  .memorial-simple .ftree-card { width: 104px; }
  .memorial-simple .ftree-avatar { width: 72px; height: 72px; box-shadow: 0 0 0 3px #d9b45e, 0 10px 22px rgba(120,86,25,.22); border-width: 3px; }
  .memorial-simple .ftree-card.is-me .ftree-avatar { width: 88px; height: 88px; }
  .memorial-simple .ftree-name { font-size: .9rem; }
}

/* Memorial hero: name on one line (sized by main.js), bigger "In Loving Memory", photo closer to the header */
.page-memorial .ms-name.is-fit { white-space: nowrap; display: inline-block; max-width: none; }
.page-memorial .ms-hero-text { min-width: 0; }
@media (min-width: 900px) {
  .ms-hero-head .ms-label { font-size: clamp(3rem, 4.6vw, 4.6rem); margin-bottom: 2px; }
  .memorial-simple .ms-head.ms-hero-head { padding-top: 0; }
  .ms-hero-head .ms-hero-photo { margin-top: -10px; }
  .ms-hero-head.has-cutout .ms-hero-photo { aspect-ratio: auto; max-height: 640px; }
  .ms-hero-head.has-cutout .ms-hero-photo a { height: auto; }
  .ms-hero-head.has-cutout .ms-hero-photo img { width: 100%; height: auto; max-height: 640px; object-fit: contain; object-position: center top; }
}
/* the section bar stays in its place under the hero; it no longer floats over the content while scrolling */
.memorial-simple .ms-tabs { position: relative !important; top: auto !important; }

/* Memorial hero sizes (computers and phones): balanced name and script line, a little air above the photo */
.page-memorial .ms-hero-text .ms-label.is-fit { white-space: nowrap; display: table; }   /* shrink-wrapped, but always on its own line (a short name like "Toby" stays below it) */
@media (min-width: 900px) {
  .memorial-simple .ms-head.ms-hero-head { padding-top: 30px; }
  .ms-hero-head .ms-hero-photo { margin-top: 0; }
  .ms-hero-head .ms-label { font-size: clamp(2.3rem, 3.1vw, 3.2rem); }
  .ms-hero-head .ms-name { font-size: clamp(2.4rem, 3.9vw, 3.9rem); }
}
@media (max-width: 899px) {
  /* phones and tablets: the same script line and serif name as on computers, sized for small screens */
  .memorial-simple .ms-hero-text .ms-label { margin: 6px 0 2px; font: 400 2.1rem/1.1 'Great Vibes', var(--serif), cursive; letter-spacing: 0; text-transform: none; color: #a8802f; }
  .memorial-simple .ms-hero-text .ms-name { font: 600 1.85rem/1.15 var(--serif); letter-spacing: -.01em; }
}

/* ---------- My Account: same section bar as the memorial page (glass bar, line icons, white pill + gold line) ---------- */
.page-account .editor-nav.is-merged, .page-account .account-tabs .container { gap: 4px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.66) !important;
  border: 1px solid rgba(255,255,255,.95) !important; -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 14px 34px rgba(41,32,10,.09), inset 0 0 0 1px rgba(201,162,77,.18) !important; }
.page-account .editor-nav.is-merged a, .page-account .account-tabs a { position: relative; gap: 8px; padding: 10px 18px; border-radius: 999px; background: transparent; box-shadow: none;
  font: 500 .9rem/1 var(--sans); letter-spacing: 0; text-transform: none; color: #6b5d44; }
.page-account .editor-nav.is-merged a:hover, .page-account .account-tabs a:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.page-account .editor-nav.is-merged a.is-active, .page-account .editor-nav.is-merged a.is-account.is-active, .page-account .account-tabs a.is-active,
.page-account .editor-embedded .editor-nav a.is-active { background: #fff !important; color: var(--ink) !important; box-shadow: 0 6px 16px rgba(41,32,10,.1) !important; }
.page-account .editor-nav.is-merged a.is-active::after, .page-account .account-tabs a.is-active::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px;
  background: linear-gradient(90deg, #e9c76d, #b98c3f); }
.page-account .editor-nav.is-merged.on-account a:not(.is-account).is-active { background: transparent !important; box-shadow: none !important; color: #6b5d44 !important; }
.page-account .editor-nav.is-merged.on-account a:not(.is-account).is-active::after { display: none; }
.page-account a.is-active .ms-tab-ic { color: #a8802f; }
@media (max-width: 760px) { .page-account .editor-nav.is-merged a, .page-account .account-tabs a { padding: 9px 13px; font-size: .84rem; } }

/* the photo and its "On memorial pages" switch sit together */
.avatar-col { display: grid; justify-items: center; gap: 10px; }
.photo-style { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; }
.photo-style-label { width: 100%; text-align: center; font: 600 .66rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9a7a3e; }
.photo-style button { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(201,162,77,.4); background: rgba(255,255,255,.8); color: #6b5d44;
  font: 500 .8rem/1 var(--sans); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.photo-style button:hover { border-color: #c9a24d; color: var(--ink); }
.photo-style button.is-on { background: var(--gold); color: var(--on-gold, #29200a); border-color: transparent; box-shadow: 0 4px 12px rgba(127,90,28,.22); }
@media (max-width: 760px) {
  /* phones: the photo keeps its spot beside the name; the switch gets its own row underneath */
  .account-hero-inner > .avatar-col { display: contents; }
  .account-hero-inner .photo-style { grid-column: 1 / -1; order: 5; justify-content: flex-start; margin-top: 6px; }
  .account-hero-inner .photo-style-label { width: auto; margin-right: 4px; }
}
@media (max-width: 760px) { .account-hero-inner .photo-style { flex-wrap: nowrap; } .account-hero-inner .photo-style-label { font-size: .6rem; letter-spacing: .1em; } .photo-style button { padding: 7px 10px; } }

/* ---------- Memorial pages: QR code in the lower left (stays even when the page is idle) ---------- */
.ms-qr-float { position: fixed; left: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; cursor: pointer;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.95); background: rgba(255,255,255,.82); color: var(--ink); text-align: left;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 36px rgba(41,32,10,.14), inset 0 0 0 1px rgba(201,162,77,.2);
  transition: transform .2s, box-shadow .2s; }
.ms-qr-float:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(41,32,10,.2), inset 0 0 0 1px rgba(201,162,77,.4); }
.ms-qr-float img { width: 64px; height: 64px; border-radius: 10px; background: #fff; padding: 4px; box-shadow: inset 0 0 0 1px #eee3c8; }
.ms-qr-float-text { display: grid; gap: 2px; }
.ms-qr-float-text strong { font: 600 .92rem/1.2 var(--serif); }
.ms-qr-float-text span { font-size: .74rem; color: #9a7a3e; }
.ms-qr-dialog { width: min(380px, calc(100vw - 32px)); padding: 30px 26px 24px; border: 0; border-radius: 26px; text-align: center;
  background: #fff; box-shadow: 0 30px 80px rgba(20,16,8,.35); }
.ms-qr-dialog::backdrop { background: rgba(20,16,8,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ms-qr-x { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f5efe2; font-size: 22px; cursor: pointer; }
.ms-qr-kicker { margin: 0; font: 400 1.9rem/1 'Great Vibes', var(--serif), cursive; color: #a8802f; }
.ms-qr-name { margin: 6px 0 14px; font: 600 1.2rem/1.25 var(--serif); }
.ms-qr-big { width: 100%; max-width: 260px; height: auto; margin: 0 auto; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: 0 0 0 1px #eee3c8, 0 12px 28px rgba(41,32,10,.1); }
.ms-qr-help { margin: 14px 0 16px; font-size: .86rem; color: var(--muted); }
.ms-qr-actions { display: flex; gap: 8px; justify-content: center; }
@media (max-width: 760px) {
  .ms-qr-float { left: 12px; bottom: 12px; padding: 6px; border-radius: 14px; }
  .ms-qr-float img { width: 52px; height: 52px; }
  .ms-qr-float-text { display: none; }
}
@media print { .ms-qr-float { display: none; } }

/* =====================================================================
   Memorial page on phones and tablets: same look as on computers
   (big photo, script line, name, details card on the wallpaper),
   and the section bar becomes an app-style bar pinned to the bottom.
   ===================================================================== */
.ms-tabs .t-short { display: none; }
@media (max-width: 899px) {
  /* hero: no gold band or white card; the photo stands on the wallpaper */
  .memorial-simple .ms-head.ms-hero-head { padding: 14px 0 8px; text-align: center;
    background: radial-gradient(90% 60% at 50% 30%, rgba(246,232,200,.7), transparent 70%), linear-gradient(180deg, #fff, #fbf8f2); }
  .memorial-simple[class*=" wp-"] .ms-head.ms-hero-head, .memorial-simple.wpc .ms-head.ms-hero-head { background: transparent; }
  .memorial-simple .ms-head.ms-hero-head > .container { padding: 0 16px; background: none; border-radius: 0; box-shadow: none; }
  .memorial-simple .ms-hero { display: grid; gap: 6px; justify-items: center; }
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo { width: min(74vw, 320px); aspect-ratio: 4 / 5; margin: 0 auto 6px; padding: 0; border-radius: 26px; transform: none;
    overflow: hidden; background: #f3ede2; box-shadow: 0 22px 48px rgba(41,32,10,.16); }
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo a, .memorial-simple .ms-head.ms-hero-head .ms-photo-initial { border-radius: 26px; height: 100%; }
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
  .memorial-simple .ms-head.ms-hero-head.has-cutout .ms-hero-photo { width: min(86vw, 380px); aspect-ratio: auto; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .memorial-simple .ms-head.ms-hero-head.has-cutout .ms-hero-photo a { border-radius: 0; height: auto; }
  .memorial-simple .ms-head.ms-hero-head.has-cutout .ms-hero-photo img { height: auto; max-height: 56vh; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(41,32,10,.2));
    -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent); mask-image: linear-gradient(180deg, #000 84%, transparent); }
  .memorial-simple .ms-hero-text { width: 100%; }
  .memorial-simple .ms-hero-text .ms-epitaph { margin: 6px 0 0; font-size: 1.08rem; }
  .ms-hero-text:has(.ms-hero-facts) .ms-dates { display: none; }
  .memorial-simple .ms-hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 16px auto 0; max-width: 460px; padding: 16px 18px;
    text-align: left; border-radius: 18px; background: rgba(255,255,255,.76); border: 1px solid #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 14px 32px rgba(41,32,10,.08), inset 0 0 0 1px rgba(201,162,77,.14); }
  .memorial-simple .ms-hero-facts dt { font: 600 .62rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #a8802f; margin-bottom: 3px; }
  .memorial-simple .ms-hero-facts dd { margin: 0; font: 500 .95rem/1.3 var(--serif); color: var(--ink); }
  .memorial-simple .ms-hero-actions { display: none; }
  .memorial-simple .ms-quick { margin-top: 14px; }
  .memorial-simple .ms-stats { display: none; }

  /* section bar: pinned to the bottom like an app, all five always in view */
  .memorial-simple .ms-tabs { position: fixed !important; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); top: auto !important; z-index: 55; padding: 0; }
  .memorial-simple .ms-tabs-inner { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; max-width: 560px; margin: 0 auto; padding: 5px; gap: 2px;
    border-radius: 22px; background: rgba(255,255,255,.86); }
  .memorial-simple .ms-tabs a { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 2px 7px; border-radius: 17px; font-size: .66rem; font-weight: 500; text-align: center; }
  .memorial-simple .ms-tabs a .ms-tab-ic { width: 21px; height: 21px; }
  .memorial-simple .ms-tabs a.is-active::after { bottom: 3px; width: 14px; margin-left: -7px; }
  .memorial-simple .ms-tabs .t-long { display: none; }
  .memorial-simple .ms-tabs .t-short { display: inline; }
  .memorial-simple .ms-tabs .ms-count { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 16px; height: 16px; font-size: .6rem; }
  .page-memorial main, .page-memorial .site-footer { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  /* the QR, menu and music buttons sit just above the bar */
  .page-memorial .ms-qr-float { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .page-memorial .fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .page-memorial .music-player { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .page-memorial.is-idle .ms-tabs { opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
  .page-memorial .ms-tabs { transition: opacity .8s ease; }
}
@media (max-width: 899px) {
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo { width: min(74vw, 320px) !important; margin: 0 auto 6px !important; aspect-ratio: 4 / 5 !important; padding: 0 !important; }
  .memorial-simple .ms-head.ms-hero-head.has-cutout .ms-hero-photo { width: min(86vw, 380px) !important; aspect-ratio: auto !important; }
}
@media (max-width: 899px) {
  /* the person's photo sits exactly in the middle */
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo { margin-left: auto !important; margin-right: auto !important; justify-self: center; }
  .memorial-simple .ms-head.ms-hero-head .ms-hero-photo a { display: flex; justify-content: center; }
  .memorial-simple .ms-head.ms-hero-head.has-cutout .ms-hero-photo img { width: auto; max-width: 100%; margin: 0 auto; object-position: center bottom; }
  /* QR on the left and music on the right: same height, same line */
  .page-memorial .ms-qr-float { left: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); height: 52px; padding: 5px; border-radius: 14px; }
  .page-memorial .ms-qr-float img { width: 40px; height: 40px; padding: 2px; border-radius: 8px; }
  .page-memorial .music-player { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .page-memorial .music-toggle { height: 52px; box-sizing: border-box; }
}

/* Profile photo: a spinner while the photo is being prepared and saved */
.avatar-form.is-processing .avatar-pick { pointer-events: none; }
.avatar-form.is-processing .avatar-overlay { opacity: 1 !important; display: grid; place-items: center; align-content: center; gap: 8px; padding-top: 0;
  background: rgba(41,32,10,.45); color: #fff; font-weight: 600; }
.avatar-form.is-processing .avatar-overlay::before { content: ''; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35); border-top-color: #f3d27a; animation: wpSpin .8s linear infinite; }
.avatar-form.is-processing [data-avatar-actions] [type=submit] { position: relative; padding-left: 38px; }
.avatar-form.is-processing [data-avatar-actions] [type=submit]::before { content: ''; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; border: 2px solid rgba(41,32,10,.25); border-top-color: #29200a; animation: wpSpin .8s linear infinite; }
.avatar-form.is-processing .avatar-overlay { inset: 0 !important; height: auto !important; border-radius: 50% !important; font-size: .8rem; }

/* ---------- Legal pages ---------- */
.legal-head { text-align: center; }
.legal-kicker { margin: 0 0 4px; font: 600 .72rem/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: #a8802f; }
.legal-updated { margin: 6px 0 18px; font-size: .85rem; color: var(--muted); }
.legal-nav { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.75);
  box-shadow: 0 10px 26px rgba(41,32,10,.07), inset 0 0 0 1px rgba(201,162,77,.2); }
.legal-nav a { padding: 9px 16px; border-radius: 999px; font: 500 .88rem/1 var(--sans); color: #6b5d44; text-decoration: none; }
.legal-nav a:hover { color: var(--ink); background: rgba(255,255,255,.8); }
.legal-nav a[aria-current="page"] { background: var(--gold); color: var(--on-gold, #29200a); box-shadow: 0 4px 12px rgba(127,90,28,.22); }
.legal { padding-bottom: 40px; }
.legal .legal-lead { font: italic 400 1.1rem/1.65 var(--serif); color: #4b4436; padding: 16px 20px; border-left: 3px solid #d9b45e; background: #fffaf0; border-radius: 0 12px 12px 0; }
.legal h2 { margin-top: 34px; font: 600 1.25rem/1.3 var(--serif); }
.legal li { margin: 6px 0; }
/* memorial pages: small legal line at the very end */
.ms-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; padding: 28px 16px 36px; font-size: .78rem; color: #9a8a6b; }
.ms-legal a { color: #8a7650; text-decoration: none; }
.ms-legal a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 899px) { .ms-legal { padding-bottom: calc(110px + env(safe-area-inset-bottom)); } }
@media (max-width: 640px) { .legal-nav a { padding: 8px 12px; font-size: .8rem; } }

/* ---------- Memorial hero: running gold glow on the photo without background ---------- */
.ms-hero-photo a { position: relative; }
.ms-hero-photo img[data-glow] { position: relative; z-index: 1; }
.ms-aura { position: absolute; z-index: 0; left: 12%; right: 12%; top: 18%; bottom: 4%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,214,120,.55), rgba(255,214,120,0)); filter: blur(18px);
  animation: msAura 5s ease-in-out infinite; will-change: opacity, transform; }
@keyframes msAura { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: .9; transform: scale(1.04); } }
.ms-shine { position: absolute; z-index: 2; overflow: hidden; pointer-events: none; opacity: 0;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.ms-shine.is-ready { opacity: 1; }
.ms-shine i { position: absolute; top: -10%; bottom: -10%; left: -55%; width: 45%;
  background: linear-gradient(100deg, rgba(255,240,190,0) 0%, rgba(255,236,170,.6) 48%, rgba(255,250,225,.75) 52%, rgba(255,240,190,0) 100%);
  transform: translateX(0) skewX(-14deg); animation: msShine 6s ease-in-out infinite; will-change: transform; }
@keyframes msShine { 0% { transform: translateX(0) skewX(-14deg); } 55%, 100% { transform: translateX(370%) skewX(-14deg); } }

/* "In Loving Memory of" breathes gently with a soft gold glow */
.ms-hero-text .ms-label { text-shadow: 0 0 22px rgba(232,196,106,.55); transform-origin: left center; animation: msBreathe 4.5s ease-in-out infinite; will-change: transform; }
@keyframes msBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@media (max-width: 899px) { .ms-hero-text .ms-label { transform-origin: center; } }

/* ---------- Slideshow button (beside the QR) and the slideshow in the photo's place ---------- */
.ms-show-float { position: fixed; left: 236px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; cursor: pointer;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.95); background: rgba(255,255,255,.82); color: var(--ink); text-align: left;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 36px rgba(41,32,10,.14), inset 0 0 0 1px rgba(201,162,77,.2); transition: transform .2s, box-shadow .2s; }
.ms-show-float:hover { transform: translateY(-2px); }
.ms-show-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 10px; background: var(--gold); color: #29200a; }
.ms-show-ic svg { width: 26px; height: 26px; fill: currentColor; }
.ms-show-ic .i-stop, .ms-show-float[aria-pressed="true"] .i-play { display: none; }
.ms-show-float[aria-pressed="true"] .i-stop { display: inline; }
.ms-qr-float, .ms-show-float { height: 82px; }
.ms-head.is-showing .ms-hero-photo > a { visibility: hidden; }
.ms-head.is-showing .ms-hero-photo { aspect-ratio: 4 / 5 !important; border-radius: 30px; overflow: hidden !important; background: #1d1810 !important;
  box-shadow: 0 30px 70px rgba(41,32,10,.22) !important; }
.ms-slides { position: absolute; inset: 0; cursor: pointer; }
.ms-slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.ms-slides img.is-on { opacity: 1; animation: msKen 7s ease-out both; }
@keyframes msKen { from { transform: scale(1.06); } to { transform: scale(1); } }
.ms-hero-photo { position: relative; }
@media (max-width: 760px) {
  .page-memorial .ms-show-float { left: 72px; bottom: calc(84px + env(safe-area-inset-bottom)); height: 52px; padding: 5px; border-radius: 14px; }
  .ms-show-float .ms-show-ic { width: 40px; height: 40px; border-radius: 8px; }
  .ms-show-float .ms-show-ic svg { width: 18px; height: 18px; }
  .ms-show-float .ms-qr-float-text { display: none; }
  .ms-head.is-showing .ms-hero-photo { border-radius: 26px; }
}
@media (prefers-reduced-motion: reduce) { .ms-aura, .ms-shine i, .ms-hero-text .ms-label, .ms-slides img.is-on { animation: none; } }
/* QR and slideshow buttons side by side, the same size */
.ms-float-row { position: fixed; left: 20px; bottom: 20px; z-index: 40; display: flex; gap: 10px; align-items: stretch; }
.ms-float-row .ms-qr-float, .ms-float-row .ms-show-float { position: static; height: 82px; }
@media (max-width: 899px) {
  .page-memorial .ms-float-row { left: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); gap: 8px; }
  .page-memorial .ms-float-row .ms-qr-float, .page-memorial .ms-float-row .ms-show-float { height: 52px; padding: 5px; border-radius: 14px; }
  .page-memorial .ms-float-row .ms-show-ic { width: 40px; height: 40px; border-radius: 8px; }
  .page-memorial .ms-float-row .ms-show-ic svg { width: 18px; height: 18px; }
  .page-memorial .ms-float-row .ms-qr-float-text { display: none; }
}
@media print { .ms-float-row { display: none; } }
.ms-head .ms-hero-photo .ms-slides img { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-height: none !important; max-width: none !important;
  margin: 0 !important; object-fit: cover !important; object-position: center !important; filter: none !important; -webkit-mask-image: none !important; mask-image: none !important; }

/* ---------- Fixes: title back on, light running around the photo, slideshow above the QR ---------- */
/* the breathing goes on the inner text, so the title's own fade-in still runs */
.ms-hero-text .ms-label { text-shadow: none; transform-origin: initial; }
.ms-hero-text .ms-label.reveal-in { animation: reveal-in .7s cubic-bezier(.2,.7,.2,1) .12s forwards; }
.ms-breathe { display: inline-block; text-shadow: 0 0 22px rgba(232,196,106,.55); transform-origin: left center; animation: msBreathe 4.5s ease-in-out infinite; will-change: transform; }
@media (max-width: 899px) { .ms-breathe { transform-origin: center; } }

/* a ring of gold light that slowly travels around the photo's edges */
.ms-hero-photo { position: relative; overflow: visible !important; }
.ms-ring { position: absolute; inset: -4px; z-index: 3; pointer-events: none; border-radius: 34px; overflow: hidden; padding: 3px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ms-ring i { position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1; translate: -50% -50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 250deg, rgba(255,226,140,.15) 290deg, #ffe7a3 330deg, #fff6d6 345deg, #d9a93d 355deg, transparent 360deg);
  animation: msRing 7s linear infinite; will-change: transform; }
.ms-ring::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(217,180,94,.35); }
@keyframes msRing { to { rotate: 360deg; } }
.ms-hero-photo .ms-ring { filter: drop-shadow(0 0 6px rgba(255,214,120,.8)); }
.ms-head.is-showing .ms-ring { border-radius: 34px; }
@media (max-width: 899px) { .ms-ring { border-radius: 30px; inset: -3px; padding: 2.5px; } }

/* QR and slideshow: stacked (slideshow on top), smaller; the QR stays easy to scan */
.ms-float-row { flex-direction: column; align-items: stretch; gap: 8px; left: 18px; bottom: 18px; width: 178px; }
.ms-float-row .ms-show-float { height: 44px; padding: 5px 12px 5px 5px; gap: 10px; border-radius: 14px; }
.ms-float-row .ms-show-ic { width: 34px; height: 34px; border-radius: 9px; }
.ms-float-row .ms-show-ic svg { width: 16px; height: 16px; }
.ms-float-row .ms-show-float .ms-qr-float-text strong { font-size: .82rem; }
.ms-float-row .ms-show-float .ms-qr-float-text span { font-size: .68rem; }
.ms-float-row .ms-qr-float { height: 72px; padding: 6px 12px 6px 6px; gap: 10px; border-radius: 14px; }
.ms-float-row .ms-qr-float img { width: 60px; height: 60px; padding: 3px; border-radius: 8px; }
.ms-float-row .ms-qr-float .ms-qr-float-text strong { font-size: .82rem; }
.ms-float-row .ms-qr-float .ms-qr-float-text span { font-size: .68rem; }
@media (max-width: 899px) {
  .page-memorial .ms-float-row { width: auto; left: 12px; gap: 6px; }
  .page-memorial .ms-float-row .ms-show-float { width: 52px; height: 36px; padding: 0; justify-content: center; }
  .page-memorial .ms-float-row .ms-show-ic { width: 100%; height: 100%; border-radius: 12px; }
  .page-memorial .ms-float-row .ms-qr-float { width: 52px; height: 52px; padding: 4px; justify-content: center; }
  .page-memorial .ms-float-row .ms-qr-float img { width: 44px; height: 44px; padding: 2px; }
}
@media (prefers-reduced-motion: reduce) { .ms-ring i, .ms-breathe { animation: none; } }
.ms-slides { border-radius: 30px; overflow: hidden; }
@media (max-width: 899px) { .ms-slides { border-radius: 26px; } }
.ms-ring { padding: 4px; }
.ms-hero-photo .ms-ring { filter: drop-shadow(0 0 10px rgba(255,210,110,.95)); }

/* The running gold light now moves across the person's name (not around the photo) */
.ms-ring { display: none !important; }
.page-memorial .ms-hero-text .ms-name {
  background: linear-gradient(100deg, #29200a 0%, #29200a 38%, #b98c3f 45%, #fff1c2 50%, #d9a93d 55%, #29200a 62%, #29200a 100%) 0 0 / 300% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(232,196,106,.28));
  padding-bottom: .16em; margin-bottom: max(0px, calc(14px - .16em));   /* room for letters like y, g, p: the gold fill only paints inside the box */
  animation: reveal-in .7s cubic-bezier(.2,.7,.2,1) .2s forwards, msNameLight 7s ease-in-out 1s infinite; }
@keyframes msNameLight { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { .page-memorial .ms-hero-text .ms-name { animation: none; background-position: 100% 0; } }

/* ---------- One icon style everywhere: thin gold-brown line icons with a gentle animation ---------- */
.ui-ic { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; color: #a8802f; transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.ui-ic-wrap { display: inline-grid; place-items: center; }
.ms-tab-ic, .ui-ic, .phone-tile-icon svg, .hiw-ic { transform-origin: 50% 60%; }
/* hover / tap: a small lift and tilt */
a:hover > .ui-ic, button:hover > .ui-ic, label:hover > .ui-ic, a:hover .ms-tab-ic, button:hover .ms-tab-ic, .dgroup-icon:hover .ui-ic, h3:hover .ui-ic { transform: translateY(-2px) rotate(-8deg) scale(1.08); }
/* the open section's icon floats softly */
a.is-active .ms-tab-ic, a.is-active .ui-ic { animation: icFloat 3.2s ease-in-out infinite; }
@keyframes icFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
/* icons come in with a small pop when the page opens */
.dgroup-icon .ui-ic, .dc-block h3 .ui-ic, .modal-icon .ui-ic, .memory-chip .ui-ic, .auth-note strong .ui-ic { animation: icPop .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes icPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-icon .ui-ic { width: 26px; height: 26px; color: #6e4f12; }
.ftree-heart .ui-ic { color: #d0577a; animation: icBeat 2.4s ease-in-out infinite; }
@keyframes icBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } }
.footer-contact li, .footer-contact a { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.footer-contact a:hover { color: var(--ink); }
.auth-note strong { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .ui-ic, .ms-tab-ic { animation: none !important; transition: none; } }

/* "Public page" switch only shows under Memorial Details (computers and phones) */
.account-merged:not([data-section="place"]) #memorials > .privacy-card { display: none; }

/* ---------- Pet Memories ---------- */
.pet-paw { display: inline-grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.pet-paw svg { width: 55%; height: 55%; }
.badge-pets { display: inline-flex; align-items: center; gap: 5px; }
.badge-pets .icon { width: 14px; height: 14px; }
.pet-notice, .pet-note { display: flex; align-items: flex-start; gap: 10px; background: var(--accent-tint); border: 1px solid #f0dfae; border-radius: 12px; }
.pet-notice .icon, .pet-note .icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.pet-note { margin: 0 0 16px; }
.type-pet { display: block; margin-top: 6px; }

/* Activate a scanned code: who is it for? */
.activate-panel { text-align: center; }
.activate-choices { display: grid; gap: 12px; margin: 22px 0 6px; text-align: left; }
.activate-choice { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.activate-choice:hover, .activate-choice:focus-visible { border-color: #dcb95f; box-shadow: 0 10px 28px -18px rgba(87,55,13,.55); transform: translateY(-1px); }
.activate-ic { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.activate-ic .icon { width: 24px; height: 24px; }
.activate-text { flex: 1 1 auto; display: grid; gap: 2px; }
.activate-text strong { font: 600 1.05rem/1.3 var(--sans); }
.activate-text small { color: var(--muted); font-size: .88rem; }
.activate-go { color: var(--accent); }
.activate-go .icon { width: 20px; height: 20px; }
.activate-badge { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 8px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.activate-badge .icon { width: 30px; height: 30px; }
.activate-steps { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.activate-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg-alt); font-size: .95rem; color: var(--ink); }
.activate-steps span { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-weight: 700; font-size: .85rem; }
.activate-actions { display: grid; gap: 10px; }

/* My Account → My Pets */
#pets .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pet-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 16px 0; padding: 16px; border: 1px solid #ecd697; border-radius: 16px; background: linear-gradient(135deg, #fffaf0, #fbf3dc); }
.pet-prompt-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--on-gold); }
.pet-prompt-ic .icon { width: 24px; height: 24px; }
.pet-prompt-text { flex: 1 1 220px; display: grid; gap: 2px; color: var(--ink); }
.pet-prompt-actions { display: flex; gap: 8px; align-items: center; }
.pet-prompt-actions form { margin: 0; }
.pet-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pet-card { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.pet-face { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.pet-info { flex: 1 1 140px; display: grid; gap: 2px; min-width: 0; }
.pet-name { font: 600 1.08rem/1.3 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.pet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pet-tags:empty { display: none; }
.pet-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.pet-actions .btn { flex: 1 1 auto; justify-content: center; }
.pet-empty { display: grid; justify-items: center; gap: 10px; margin: 18px 0 4px; padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: 16px; text-align: center; }
.pet-empty p { margin: 0; }
.pet-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.pet-empty-ic .icon { width: 28px; height: 28px; }
.pet-form { display: grid; gap: 4px; }
.pet-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -4px 0 12px; }
.pet-scan .file-link { margin: 0; }
.pet-owner-check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-alt); cursor: pointer; }
.pet-owner-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: #7f5a1c; flex: 0 0 auto; }
.pet-owner-check span { display: grid; gap: 2px; }
.pet-owner-check strong { color: var(--ink); font-weight: 600; }
.pet-owner-check small { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.memorial-switch a .icon, .memorial-bar-name .icon, .badge-pets .icon { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; margin-right: 4px; }

/* Editor → Pet Profile */
.pet-photo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.pet-photo-pick { position: relative; display: block; width: 120px; height: 120px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; }
.pet-photo-img { display: grid; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #e7cf86; }
.pet-photo-img[hidden] { display: none; }
.pet-photo-cta { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .74rem; white-space: nowrap; }
.pet-photo-cta .icon { width: 13px; height: 13px; }
.pet-photo-hint { display: grid; gap: 4px; flex: 1 1 180px; }
.pet-photo-hint strong { font: 600 1.15rem/1.3 var(--serif); color: var(--ink); }

/* Family trees: the pets row */
.ftree-pets .ftree-label::before { content: none; }
.ftree-card.is-pet .ftree-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e7cf86; }
.ftree-card.is-pet .avatar-initial.pet-paw { width: 100%; height: 100%; }
.ms-strip-person.is-pet .avatar { object-fit: cover; }
.ms-photo-initial.pet-paw svg { width: 42%; height: 42%; }
@media (max-width: 640px) {
  .pet-prompt-actions { width: 100%; }
  .pet-prompt-actions .btn, .pet-prompt-actions form { flex: 1 1 0; }
  .pet-prompt-actions form .btn { width: 100%; }
  .pet-list { grid-template-columns: 1fr; }
}
/* Phones and tablets: the hero text is centered, so the script line stays centered on its own line */
@media (max-width: 899px) { .page-memorial .ms-hero-text .ms-label.is-fit { margin-left: auto; margin-right: auto; } }
/* My Account bar (computers): every tab stays visible. Tighter tabs, and a second row instead of hiding QR Codes off the end. */
@media (min-width: 761px) {
  .page-account .editor-nav.is-merged, .page-account .account-tabs .container { flex-wrap: wrap; justify-content: center; overflow: visible; border-radius: 28px; }
  .page-account .editor-nav.is-merged a, .page-account .account-tabs a { padding: 10px 14px; gap: 7px; }
}
/* Add Pet window: same look as Add family member (filled fields, small caps labels, switch) */
.pet-modal .pet-form { display: grid; gap: 16px; padding-bottom: 20px; }
.pet-modal .pet-field { margin: 0; }
.pet-modal .pet-field .field-status:empty { display: none; }
.pet-modal .pet-plain input { padding-left: 14px; }
.pet-modal .pet-code input { padding-right: 92px; }
.pet-code-tools { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }
.pet-code-btn { display: grid; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: #fff; color: var(--accent); cursor: pointer; box-shadow: 0 1px 3px rgba(41,32,10,.1); transition: background-color .15s, color .15s; }
.pet-code-btn:hover, .pet-code-btn:focus-visible { background: var(--accent-tint); color: var(--accent-dark); }
.pet-code-btn .icon { width: 19px; height: 19px; }
.pet-code-btn[hidden] { display: none; }
.pet-modal .inline-scanner { margin-top: 10px; }
.pet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pet-owner-switch { padding: 12px 14px; border-radius: 12px; background: var(--bg-alt); }
@media (max-width: 480px) { .pet-row { grid-template-columns: 1fr; } }
/* Smaller computer screens: "Photos" and "Details" so the whole bar, QR Codes included, fits on one line */
@media (max-width: 1399px) { .editor-nav .nav-long { display: none; } }
@media (min-width: 761px) { .page-account .editor-nav.is-merged, .page-account .account-tabs .container { gap: 2px; } .page-account .editor-nav.is-merged a, .page-account .account-tabs a { padding: 10px 11px; } }
.pet-modal .pet-form { overflow-x: hidden; }
.pet-modal .add-search input, .pet-modal .add-select select { min-height: 50px; border: 1.5px solid transparent; border-radius: 12px; background: var(--bg-alt); box-shadow: none; }
.pet-modal .add-search input:focus, .pet-modal .add-select select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(214,177,90,.15); }
.pet-modal .add-search input[aria-invalid="true"], .pet-modal .add-select select[aria-invalid="true"] { border-color: var(--error); }
.pet-modal .pet-code input { padding-left: 42px; padding-right: 92px; }
.pet-modal .pet-plain input { padding-left: 14px; }
.page-account .account-body .pet-modal .pet-code input[type="text"] { padding: 12px 92px 12px 42px; }
.page-account .account-body .pet-modal .pet-plain input[type="text"] { padding: 12px 14px; }
/* Pet Profile: photo switch sits under the hint, left-aligned; spinner while the background is removed */
.pet-photo-style { justify-content: flex-start; margin-top: 8px; }
.pet-photo-style .photo-style-label { width: auto; text-align: left; margin-right: 4px; }
.pet-photo-img.is-cutout { object-fit: contain; background: repeating-conic-gradient(#f3eee2 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.pet-profile-form.is-processing .pet-photo-pick::after { content: ''; position: absolute; inset: 38%; border: 3px solid rgba(255,255,255,.7); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }

/* ---------- Home: Partner With Us band (under the hero) ---------- */
.partner-band { padding: 28px 0 8px; }
.partner-band-card { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; padding: 18px 20px; border-radius: 20px;
  background: rgba(255,255,255,.78); border: 1px solid #fff; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(41,32,10,.07), inset 0 0 0 1px rgba(201,162,77,.18); }
.partner-band-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #fbf3df; }
.partner-band-ic .ui-ic { width: 28px; height: 28px; animation: icFloat 3.2s ease-in-out infinite; }
.partner-band-text strong { display: block; font: 600 1.08rem/1.3 var(--serif); color: var(--ink); }
.partner-band-text span { display: block; color: var(--muted); font-size: .93rem; margin-top: 2px; }
.partner-band-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.partner-band-actions .btn { border-radius: 12px; }
@media (min-width: 900px) { .partner-band-card { grid-template-columns: auto 1fr auto; padding: 20px 26px; } .partner-band-actions { grid-column: auto; } }

/* Notifications: partner application results */
.notif .btn .icon { width: 1em; height: 1em; }

/* More menu items (Directory, Partner With Us): keep every label on one line */
@media (min-width: 900px) {
  .nav-links a, .nav-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
  .main-nav { padding-left: 28px; }
}
@media (min-width: 900px) and (max-width: 1599px) {
  .nav-links { gap: 16px; }
  .nav-actions { gap: 14px; }
  .nav-links .nav-icon, .nav-actions .nav-link .nav-icon:not(.ni-bell) { display: none; }
  .nav-links a, .nav-link { font-size: .9rem; }
}
@media (min-width: 900px) and (max-width: 1599px) { .notif-label { display: none; } }
@media (min-width: 900px) and (max-width: 1099px) {
  .main-nav { padding-left: 16px; }
  .nav-links { gap: 12px; }
  .nav-actions { gap: 10px; }
  .nav-links a, .nav-link { font-size: .85rem; }
  .brand-text { display: none; }
}
@media (min-width: 1600px) { .site-header .header-inner { max-width: 1440px; } }

/* Home page: "Newly remembered" row of small round photos under the hero buttons (opt-in by families) */
.hero-copy { min-width: 0; }
.newly { margin-top: 28px; max-width: 44rem; min-width: 0; }
.newly-head { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.newly-ic { display: inline-grid; place-items: center; }
.newly-ic .ui-ic { width: 20px; height: 20px; animation: newlyFly 4s ease-in-out infinite; }
.newly-title { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.newly-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(185,140,63,.55), rgba(185,140,63,0)); }
.newly-slider { position: relative; display: flex; align-items: flex-start; justify-content: center; gap: 8px; }
.newly-row { display: flex; gap: 14px; margin: 0; padding: 6px 6px 8px; scroll-padding: 0 6px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-width: 0; overscroll-behavior-x: contain; }
.newly-row.is-gliding { scroll-snap-type: none; }
.newly-row::-webkit-scrollbar { display: none; }
.newly-nav { flex: none; position: relative; display: grid; place-items: center; width: 38px; height: 38px; margin-top: 17px; padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(253,244,218,.75)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #8a6420;
  box-shadow: 0 6px 18px rgba(127,90,28,.16), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(220,185,95,.45); cursor: pointer; transition: transform .35s cubic-bezier(.3,1.4,.5,1), box-shadow .35s ease, opacity .3s ease; }
.newly-nav[hidden] { display: none; }
.newly-nav svg { width: 18px; height: 18px; stroke-width: 2; transition: transform .35s ease; }
.newly-nav:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(127,90,28,.24), inset 0 1px 0 #fff, inset 0 0 0 1px rgba(220,185,95,.8); }
.newly-prev:hover svg { transform: translateX(-2px); } .newly-next:hover svg { transform: translateX(2px); }
.newly-nav:active { transform: scale(.94); }
.newly-nav:disabled { opacity: .3; cursor: default; transform: none; }
.newly-row li { flex: 0 0 auto; scroll-snap-align: start; opacity: 0; animation: newlyIn .7s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: .3s; }
.newly-item { display: grid; justify-items: center; gap: 6px; width: 64px; color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.newly-ring { position: relative; display: grid; place-items: center; width: 60px; height: 60px; padding: 2px; border-radius: 50%; background: var(--gold); box-shadow: 0 4px 14px rgba(127,90,28,.18); transition: transform .4s cubic-bezier(.3,1.4,.5,1), box-shadow .4s ease; }
.newly-ring img, .newly-initial { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; background: #fcfaf5; }
.newly-initial { display: grid; place-items: center; font: 600 1.3rem/1 var(--serif); color: var(--accent); }
.newly-initial .icon { width: 22px; height: 22px; color: #a8802f; }
.newly-ring::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid rgba(220,185,95,.6); opacity: 0; animation: newlyGlow 4.8s ease-in-out infinite; pointer-events: none; }
.newly-item:hover .newly-ring, .newly-item:focus-visible .newly-ring { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 20px rgba(127,90,28,.28); }
.newly-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: var(--muted); }
.newly-row li:nth-child(2) { animation-delay: 0.38s; } .newly-row li:nth-child(2) .newly-ring::after { animation-delay: 0.4s; }
.newly-row li:nth-child(3) { animation-delay: 0.46s; } .newly-row li:nth-child(3) .newly-ring::after { animation-delay: 0.8s; }
.newly-row li:nth-child(4) { animation-delay: 0.54s; } .newly-row li:nth-child(4) .newly-ring::after { animation-delay: 1.2s; }
.newly-row li:nth-child(5) { animation-delay: 0.62s; } .newly-row li:nth-child(5) .newly-ring::after { animation-delay: 1.6s; }
.newly-row li:nth-child(6) { animation-delay: 0.70s; } .newly-row li:nth-child(6) .newly-ring::after { animation-delay: 2.0s; }
.newly-row li:nth-child(7) { animation-delay: 0.78s; } .newly-row li:nth-child(7) .newly-ring::after { animation-delay: 2.4s; }
.newly-row li:nth-child(8) { animation-delay: 0.86s; } .newly-row li:nth-child(8) .newly-ring::after { animation-delay: 2.8s; }
.newly-row li:nth-child(9) { animation-delay: 0.94s; } .newly-row li:nth-child(9) .newly-ring::after { animation-delay: 3.2s; }
.newly-row li:nth-child(10) { animation-delay: 1.02s; } .newly-row li:nth-child(10) .newly-ring::after { animation-delay: 3.6s; }
.newly-row li:nth-child(11) { animation-delay: 1.10s; } .newly-row li:nth-child(11) .newly-ring::after { animation-delay: 4.0s; }
.newly-row li:nth-child(12) { animation-delay: 1.18s; } .newly-row li:nth-child(12) .newly-ring::after { animation-delay: 4.4s; }
@keyframes newlyIn { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes newlyGlow { 0%, 70%, 100% { opacity: 0; transform: scale(1); } 80% { opacity: 1; } 95% { opacity: 0; transform: scale(1.12); } }
@keyframes newlyFly { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(1px, -2px) rotate(-4deg); } }
@media (min-width: 641px) {   /* 7 circles fit beside the arrows */
  .newly-row { gap: 8px; }
  .newly-ring { width: 50px; height: 50px; } .newly-ring img, .newly-initial { width: 46px; height: 46px; }
  .newly-item { width: 52px; } .newly-name { max-width: 56px; font-size: .7rem; }
  .newly-nav { width: 32px; height: 32px; margin-top: 15px; } .newly-nav svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
  .newly { margin-top: 22px; max-width: none; }
  .newly-slider { gap: 4px; }
  .newly-row { gap: 6px; padding: 6px 4px 8px; }
  .newly-nav { display: none !important; }   /* phones swipe; 7 circles fit */
  .newly-ring { width: 40px; height: 40px; padding: 1.5px; } .newly-ring img, .newly-initial { width: 37px; height: 37px; border-width: 1.5px; }
  .newly-initial { font-size: 1rem; } .newly-initial .icon { width: 16px; height: 16px; }
  .newly-item { width: 42px; gap: 4px; } .newly-name { max-width: 42px; font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) { .newly-row li { opacity: 1; animation: none; } .newly-ring::after, .newly-ic .ui-ic { animation: none; } }

/* My Account: "Newly remembered" switch and its confirm pop-up */

.privacy-switch.is-disabled { cursor: not-allowed; opacity: .6; }
.newly-modal-text { margin: 0; font-size: .95rem; color: var(--text); }
.newly-modal-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.newly-modal-list li { display: flex; gap: 8px; align-items: flex-start; }
.newly-modal-list .ui-ic { margin-top: 2px; }
.newly-consent { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-tint); }
.newly-modal-warn { margin: -8px 0 0; font-size: .85rem; color: var(--error); }
.newly-card .privacy-text strong { display: flex; align-items: center; gap: 6px; }

/* How it works on tablets (760-999px): one step per row, so the cards are not squeezed by the 3-column .steps grid */
@media (max-width: 999px) { .hiw-steps { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* =====================================================================
   My Account on phones: the sections sit in a bottom tab bar, the same
   glass bar as the memorial page (icon on top, short name, white pill
   and gold line on the open one), ready to carry over to a mobile app.
   ===================================================================== */
@media (max-width: 640px) {
  .phone-tiles.phone-dock { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
    display: flex; gap: 2px; max-width: 560px; margin: 0 auto; padding: 5px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    border-radius: 22px; background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.95);
    -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 14px 34px rgba(41,32,10,.14), inset 0 0 0 1px rgba(201,162,77,.18); scrollbar-width: none;
    animation: dock-in .5s cubic-bezier(.2,.8,.2,1) backwards; transition: transform .3s ease, opacity .3s ease; }
  .phone-dock::-webkit-scrollbar { display: none; }
  /* a soft fade on the side that has more sections */
  .phone-dock.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
  .phone-dock.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px); mask-image: linear-gradient(90deg, transparent, #000 34px); }
  .phone-dock.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); }

  .phone-dock .phone-tile { position: relative; flex: 1 0 70px; justify-content: center; gap: 4px; min-width: 70px; padding: 8px 4px 9px; border: 0; border-radius: 17px;
    background: transparent; box-shadow: none; color: #6b5d44; font: 500 .66rem/1.1 var(--sans); letter-spacing: 0; scroll-snap-align: center;
    animation: none; transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .15s ease; }
  .phone-dock .phone-tile:active { transform: scale(.94); }
  .phone-dock .phone-tile-icon { width: auto; height: auto; border-radius: 0; background: none !important; color: inherit; transform: none; }
  .phone-dock .phone-tile-icon .icon, .phone-dock .phone-tile-icon svg { width: 21px; height: 21px; stroke-width: 1.6; }
  .phone-dock .phone-tile-name { font-size: .66rem; letter-spacing: 0; white-space: nowrap; }
  .phone-dock .phone-tile.is-active { background: #fff; color: var(--ink); box-shadow: 0 6px 16px rgba(41,32,10,.1); }
  .phone-dock .phone-tile.is-active .phone-tile-icon { color: #a8802f; transform: translateY(-1px); }
  .phone-dock .phone-tile.is-active::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px;
    background: linear-gradient(90deg, #e9c76d, #b98c3f); animation: dock-line .35s ease backwards; }
  /* View Page opens the public page: a small gold dot marks it as a link out */
  .phone-dock a.phone-tile .phone-tile-icon { position: relative; }
  .phone-dock a.phone-tile .phone-tile-icon::after { content: ''; position: absolute; top: -1px; right: -4px; width: 6px; height: 6px; border-radius: 50%; background: #c9a24d; }

  /* room for the bar under the page, and the round menu button moves up above it */
  .page-account main, .page-account .site-footer { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .page-account .fab { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .page-account .phone-home { padding-bottom: 0; }
  /* typing: the bar slides away so it never covers the field */
  .is-typing .phone-dock { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .is-typing.page-account .fab { opacity: 0; pointer-events: none; }
}
@keyframes dock-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes dock-line { from { width: 0; margin-left: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .phone-dock, .phone-dock .phone-tile.is-active::after { animation: none; } }

/* =====================================================================
   My Account on phones, profile layout: "Profile" title, a big centred
   photo card with name and membership, then a "My Details" card of
   label / value pairs. Computers keep the wide header.
   ===================================================================== */
.phone-pagehead, .phone-details, .account-plan { display: none; }
@media (max-width: 640px) {
  .page-account .phone-pagehead { display: block; padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: 14px; margin-bottom: 18px;
    border-bottom: 1px dashed rgba(169,128,47,.35); animation: tile-in .45s ease backwards; }
  .phone-pagehead-title { margin: 0; font: 700 2rem/1.1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
  .phone-pagehead-sub { margin: 6px 0 0; font-size: .86rem; color: var(--muted); }

  .page-account .account-hero { padding: 0 !important; background: none !important; border: 0; }
  .page-account .account-hero-inner { display: flex !important; flex-direction: column; align-items: center; gap: 0; padding: 24px 18px 22px !important; text-align: center; width: auto !important; max-width: none; margin: 0 var(--gutter, 16px) !important;
    border-radius: 24px; background: rgba(255,255,255,.82); border: 1px solid rgba(201,162,77,.28);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 14px 34px rgba(41,32,10,.08); animation: tile-in .5s ease backwards; }
  .page-account .account-hero-inner > .avatar-col { display: grid !important; order: 2; justify-items: center; gap: 12px; margin-top: 20px; }
  .page-account .account-identity { order: 1; width: 100%; text-align: center; }
  .page-account .account-greet, .page-account .account-email, .page-account .account-identity .badges { display: none !important; }
  .page-account .account-name { margin: 0; font: 700 1.6rem/1.15 var(--serif); }
  .page-account .account-plan { display: block; margin: 4px 0 0; font: 600 .92rem/1.2 var(--sans); letter-spacing: .02em;
    background: linear-gradient(90deg, #b98c3f, #e2b85c, #b98c3f); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* the big round photo with a thick soft ring, like the profile sample */
  .page-account .account-hero .avatar-form { justify-items: center; }
  .page-account .account-hero .avatar-pick { position: relative; display: block; width: 236px; height: 236px; padding: 16px; border-radius: 50%;
    background: linear-gradient(145deg, #efe7d6, #d9ccb1); box-shadow: inset 0 2px 6px rgba(41,32,10,.12), 0 18px 40px rgba(41,32,10,.14); }
  .page-account .account-hero .avatar-pick .avatar-hero { width: 204px !important; height: 204px !important; font-size: 4rem; border: 0; box-shadow: 0 6px 18px rgba(41,32,10,.18); }
  .page-account .account-hero .avatar-pick::after { right: 22px; bottom: 22px; width: 38px; height: 38px; background-size: 19px; }
  .page-account .account-hero .avatar-hint { display: block; font-size: .78rem; }
  .page-account .account-hero-inner .photo-style { justify-content: center; margin-top: 2px; }

  /* My Details card */
  .page-account .phone-details { display: block; margin-top: 16px; }
  .pd-card { padding: 20px 18px 8px; border-radius: 24px; background: rgba(255,255,255,.82); border: 1px solid rgba(201,162,77,.28);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 14px 34px rgba(41,32,10,.08); animation: tile-in .55s ease backwards; }
  .pd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .pd-head h2 { margin: 0; font: 700 1.15rem/1.2 var(--serif); }
  .pd-live { width: 10px; height: 10px; border-radius: 50%; background: #3fb26b; box-shadow: 0 0 0 4px rgba(63,178,107,.18); animation: pd-pulse 2.4s ease-in-out infinite; }
  .pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin: 0; }
  .pd-grid > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid rgba(169,128,47,.14); }
  .pd-grid > div:last-child, .pd-grid > div:nth-last-child(2):not(.pd-wide):nth-child(odd) { border-bottom: 0; }
  .pd-grid .pd-wide { grid-column: 1 / -1; }
  .pd-grid dt { font-size: .74rem; color: var(--muted); }
  .pd-grid dd { margin: 3px 0 0; font: 600 .92rem/1.3 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
  .pd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
  .pd-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .pd-pill.is-ok { background: #e6f5ec; color: #23824b; }
  .pd-pill.is-warn { background: #fdf0dc; color: #a2620f; }
  .pd-code { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 6px; background: #f6efe0; color: #7a5a1c; font: 600 .7rem/1.4 ui-monospace, monospace; }

  .page-account .phone-home { padding-top: 16px; }
}
@keyframes pd-pulse { 50% { box-shadow: 0 0 0 7px rgba(63,178,107,.06); } }
@media (prefers-reduced-motion: reduce) { .pd-live, .pd-card, .phone-pagehead { animation: none; } }

/* =====================================================================
   My Account on phones, v3: section buttons in a slim bar on the left,
   one main profile card (photo, then the details), simple light font.
   ===================================================================== */
@media (max-width: 640px) {
  /* left bar */
  .phone-tiles.phone-dock { top: 0; bottom: 0; left: 0; right: auto; width: 62px; max-width: none; margin: 0; flex-direction: column; align-items: center; gap: 8px;
    padding: calc(18px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 0; border: 0; border-right: 1px solid rgba(169,128,47,.18); background: rgba(255,255,255,.9);
    box-shadow: 6px 0 24px rgba(41,32,10,.05); -webkit-mask-image: none !important; mask-image: none !important; animation: rail-in .5s cubic-bezier(.2,.8,.2,1) backwards; }
  .phone-dock::before { content: ''; flex: 0 0 auto; width: 30px; margin: 4px 0 10px; border-top: 1px dashed rgba(169,128,47,.45); }
  .phone-dock .phone-tile { flex: 0 0 44px; width: 44px; height: 44px; min-width: 0; padding: 0; border-radius: 13px; color: #6b5d44; scroll-snap-align: none; }
  .phone-dock .phone-tile-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .phone-dock .phone-tile-icon .icon, .phone-dock .phone-tile-icon svg { width: 20px; height: 20px; }
  .phone-dock .phone-tile.is-active { background: var(--gold); color: var(--on-gold, #29200a); box-shadow: 0 6px 14px rgba(127,90,28,.25); }
  .phone-dock .phone-tile.is-active .phone-tile-icon { color: inherit; transform: none; }
  .phone-dock .phone-tile.is-active::after { display: none; }
  .is-typing .phone-dock { transform: none; opacity: 1; pointer-events: auto; }

  /* the page sits beside the bar */
  .page-account main, .page-account .site-footer { padding-left: 62px; padding-bottom: 0; }
  .page-account .fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .is-typing.page-account .fab { opacity: 1; pointer-events: auto; }
  .page-account main { --gutter: 14px; }
  .page-account main .container { padding-left: 14px; padding-right: 14px; }

  /* simple, light type */
  .phone-pagehead-title { font: 500 1.7rem/1.15 var(--sans); letter-spacing: -.01em; }
  .phone-pagehead-sub { font-size: .82rem; }
  .page-account .account-name { font: 500 1.35rem/1.25 var(--sans); letter-spacing: -.005em; }
  .page-account .account-plan { font: 400 .9rem/1.3 var(--sans); background: none; color: #a8802f; }

  /* one main profile card: name, photo, then the details */
  .page-account .account-hero-inner { padding: 22px 16px 10px !important; }
  .page-account .account-hero-inner > .avatar-col { margin-top: 18px; }
  .page-account .account-hero .avatar-pick { width: 196px; height: 196px; padding: 13px; }
  .page-account .account-hero .avatar-pick .avatar-hero { width: 170px !important; height: 170px !important; }
  .page-account .account-hero .avatar-pick::after { right: 16px; bottom: 16px; width: 34px; height: 34px; background-size: 17px; }
  .page-account .account-hero-inner > .pd-card { display: block; order: 3; width: 100%; margin-top: 22px; padding: 18px 0 0; text-align: left;
    background: none; border: 0; border-top: 1px dashed rgba(169,128,47,.3); border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
  .pd-head h2 { font: 500 1.02rem/1.2 var(--sans); }
  .pd-grid dt { font-size: .72rem; }
  .pd-grid dd { font: 400 .9rem/1.35 var(--sans); }
  .pd-grid > div { padding: 11px 0; }
}
@keyframes rail-in { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .pd-code { display: block; width: fit-content; margin: 5px 0 0; } }
@media (max-width: 640px) {
  .page-account .account-body .panel-title, .page-account .account-body h2, .page-account .account-body h3, .page-account .phone-banner-title {
    font-family: var(--sans); font-weight: 500; letter-spacing: -.005em; }
  .page-account .account-body .panel-title { font-size: 1.2rem; }
  .page-account .phone-banner-title { font-size: 1.25rem; }
}

/* Home: Featured partners under the partner band (paid Featured plan). */
.partner-featured { list-style: none; margin: 14px 0 0; padding: 2px 2px 8px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.partner-featured li { flex: 0 0 240px; scroll-snap-align: start; }
.partner-featured a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.78); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .25s, box-shadow .25s; }
.partner-featured a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(41,32,10,.10); }
.pf-media { flex: 0 0 64px; width: 64px; height: 52px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #fbf3df; }
.pf-media img { width: 100%; height: 100%; object-fit: cover; }
.pf-text { display: grid; gap: 2px; min-width: 0; }
.pf-text b { font-size: .92rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-text small { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-text small .icon { width: 13px; height: 13px; flex: 0 0 auto; }
