:root {
  color-scheme: light;
  --bg: #eef6e9;
  --bg-elevated: rgba(252, 253, 249, .9);
  --surface: #fbfcf8;
  --surface-2: #e8f2e2;
  --surface-3: #daeacf;
  --text: #203128;
  --text-soft: #627168;
  --line: rgba(45, 74, 57, .14);
  --line-strong: rgba(45, 74, 57, .24);
  --green: #55765c;
  --green-strong: #35563e;
  --green-light: #cfe0cb;
  --sage: #93ab8f;
  --gold: #b18a4f;
  --danger: #a85353;
  --shadow: 0 18px 60px rgba(45, 64, 50, .1);
  --shadow-soft: 0 8px 28px rgba(45, 64, 50, .07);
  --radius: 24px;
  --radius-small: 14px;
  --sidebar: 238px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #25382e;
  --bg-elevated: rgba(43, 64, 51, .95);
  --surface: #304739;
  --surface-2: #3a5242;
  --surface-3: #46604b;
  --text: #edf4ed;
  --text-soft: #ccd9cc;
  --line: rgba(216, 236, 217, .12);
  --line-strong: rgba(216, 236, 217, .21);
  --green: #b7d2aa;
  --green-strong: #c8dec6;
  --green-light: #405d44;
  --sage: #7e9d81;
  --gold: #d2ad73;
  --danger: #e18d8d;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background .25s ease, color .25s ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.08;
}
h1 { font-size: clamp(2.25rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
h3 { font-size: 1rem; }

.ambient { position: fixed; z-index: -2; border-radius: 999px; filter: blur(10px); pointer-events: none; }
.ambient-one { width: 38vw; height: 38vw; right: 5vw; top: -20vw; background: rgba(156, 191, 150, .19); }
.ambient-two { width: 32vw; height: 32vw; left: 16vw; bottom: -22vw; background: rgba(187, 174, 133, .13); }

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto 0;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; font-family: Georgia, serif; font-size: 1.3rem; letter-spacing: -.02em; }
.brand img { width: 35px; height: 35px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.language-picker select { min-height: 40px; width: 112px; padding: 0 9px; border-radius: 999px; font-size: .8rem; cursor: pointer; }
.theme-dark { display: none; }
html[data-theme="dark"] .theme-dark { display: inline; }
html[data-theme="dark"] .theme-light { display: none; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; padding-top: 74px; }
.sidebar {
  position: fixed;
  top: 74px;
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
}
.side-nav { display: grid; gap: 8px; }
.nav-item { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 10px 14px; border-radius: 14px; color: var(--text-soft); font-weight: 650; }
.nav-item > span:first-child { width: 23px; font-size: 1.25rem; text-align: center; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--surface-2); }
.sidebar-note { margin-top: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--surface), var(--surface-2)); color: var(--text-soft); font-family: Georgia, serif; }
.sidebar-note p { margin: 6px 0 0; }
.soft-mark { color: var(--green); font-size: 1.6rem; }
.text-button { margin-top: 20px; padding: 6px 4px; border: 0; background: none; color: var(--text-soft); cursor: pointer; }
.text-button:hover { color: var(--text); }
.main-content { grid-column: 2; width: 100%; min-width: 0; padding: 40px clamp(22px, 4vw, 70px) 90px; }
.mobile-nav { display: none; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 720;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green-strong); color: var(--bg); }
html[data-theme="dark"] .button-primary { color: #142019; }
.button-secondary { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.button-ghost { background: transparent; border-color: var(--line-strong); }
.button-danger { background: rgba(168, 83, 83, .13); border-color: rgba(168, 83, 83, .28); color: var(--danger); }
.button-small { min-height: 36px; padding: 7px 13px; font-size: .86rem; }
.button-wide { width: 100%; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.quiet-link, .read-more { color: var(--text-soft); font-weight: 650; font-size: .9rem; }
.quiet-link:hover, .read-more:hover { color: var(--green-strong); }
.push-right { margin-left: auto; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.subtle { color: var(--text-soft); }

.avatar { flex: 0 0 auto; width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--avatar, var(--green)); color: #fff; font-weight: 800; box-shadow: inset 0 0 0 2px rgba(255,255,255,.24); }
.avatar-small { width: 36px; height: 36px; font-size: .86rem; }
.avatar-large { width: 94px; height: 94px; font-size: 2rem; }

.flash-stack { position: fixed; z-index: 50; top: 88px; right: 24px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.flash { padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); }
.flash-success { border-color: rgba(79, 126, 86, .35); }
.flash-error { border-color: rgba(168, 83, 83, .35); }

.feed-layout { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 290px); gap: clamp(28px, 4vw, 54px); align-items: start; justify-content: center; }
.feed-column { min-width: 0; }
.feed-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.feed-intro h1 { max-width: 620px; margin: 0; font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
.feed-intro p { max-width: 570px; margin: 14px 0 0; color: var(--text-soft); }
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 0 16px; min-height: 50px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-bar a { color: var(--green); font-size: .88rem; font-weight: 700; }
.search-bar input[type="hidden"] { display: none; }
.discovery-tabs { display: flex; gap: 7px; margin-bottom: 34px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.discovery-tabs a { flex: 1; min-height: 39px; display: grid; place-items: center; padding: 7px 13px; border-radius: 999px; color: var(--text-soft); font-size: .88rem; font-weight: 720; }
.discovery-tabs a:hover { color: var(--text); }
.discovery-tabs a.active { background: var(--surface-3); color: var(--green-strong); box-shadow: inset 0 0 0 1px var(--line); }
.latest-section, .story-section { scroll-margin-top: 100px; }
.story-section { margin-top: 58px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
.section-heading .quiet-link { flex: 0 0 auto; margin-bottom: 5px; }
.preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.memory-preview { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-soft); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.memory-preview:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.preview-photo { position: relative; aspect-ratio: 1 / 1.08; overflow: hidden; display: grid; place-items: center; background: var(--surface-3); color: var(--green); font-size: 2rem; }
.preview-photo::after { content: ""; position: absolute; inset: auto 0 0; height: 42%; background: linear-gradient(transparent, rgba(12, 24, 16, .42)); pointer-events: none; }
.preview-photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos-x, 50%) var(--pos-y, 50%); transform: scale(var(--zoom, 1)); transform-origin: var(--pos-x, 50%) var(--pos-y, 50%); transition: transform .35s ease; }
.memory-preview:hover .preview-photo img { transform: scale(calc(var(--zoom, 1) * 1.025)); }
.preview-remembrance { position: absolute; z-index: 1; left: 10px; bottom: 9px; padding: 4px 8px; border-radius: 999px; background: rgba(16, 29, 20, .66); color: #fff; font-size: .7rem; font-weight: 750; backdrop-filter: blur(7px); }
.preview-copy { display: grid; padding: 12px 13px 14px; }
.preview-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, serif; font-size: 1.18rem; font-weight: 600; }
.preview-copy span, .preview-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.preview-copy span { font-size: .76rem; }
.preview-copy small { margin-top: 3px; font-size: .7rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.pagination span { color: var(--text-soft); font-size: .8rem; }
.compact-empty { padding-block: 50px; }
.feed-list { display: grid; gap: 30px; }
.memory-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.card-header { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 14px 17px; }
.card-owner { flex: 1; display: grid; }
.card-owner a { font-weight: 760; }
.card-owner span { color: var(--text-soft); font-size: .8rem; }
.memory-carousel { position: relative; overflow: hidden; background: #dbe5d7; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.carousel-track::-webkit-scrollbar { display: none; }
.memory-slide { position: relative; flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 5; scroll-snap-align: start; overflow: hidden; }
.memory-stage { display: flex; align-items: center; justify-content: center; isolation: isolate; background: linear-gradient(180deg, #dfe9db 0%, #cbdcc7 56%, #b7caae 100%); }
html[data-theme="dark"] .memory-stage { background: linear-gradient(180deg, #46644b 0%, #3a5540 60%, #304a37 100%); }
.memory-stage::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 50% 18%, rgba(255,255,240,.84), transparent 33%), linear-gradient(145deg, transparent 55%, rgba(62,93,65,.11)); }
.memory-stage::after { content: "❧  ·  ❧"; position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); color: rgba(54, 85, 59, .25); font-size: 1.2rem; letter-spacing: 1.5em; white-space: nowrap; }
.stage-glow { position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,238,.36); filter: blur(16px); }
.portrait-frame { position: absolute; top: 10%; width: 61%; height: 58%; overflow: hidden; background: #d7dfd3; box-shadow: 0 22px 50px rgba(35, 55, 40, .2), inset 0 0 0 7px rgba(255,255,255,.42); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos-x, 50%) var(--pos-y, 50%); transform: scale(var(--zoom, 1)); transform-origin: var(--pos-x, 50%) var(--pos-y, 50%); }
.plaque-garden .portrait-frame { border: 8px solid rgba(99, 125, 94, .85); border-radius: 48% 48% 14px 14px; }
.plaque-light .portrait-frame { border: 6px solid rgba(230, 220, 180, .9); border-radius: 50%; box-shadow: 0 0 0 10px rgba(255,255,230,.18), 0 0 60px rgba(255,240,174,.44); }
.plaque-stone .portrait-frame { border: 10px solid rgba(131, 139, 126, .8); border-radius: 45% 45% 9px 9px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), 0 20px 45px rgba(36,46,37,.22); }
.plaque-copy { position: absolute; z-index: 2; bottom: 9%; left: 50%; transform: translateX(-50%); width: 76%; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 20px 17px; border: 1px solid rgba(67,93,69,.23); border-radius: 50% 50% 14px 14px / 28% 28% 14px 14px; background: rgba(245, 248, 239, .91); color: #2c4432; text-align: center; box-shadow: 0 16px 34px rgba(51,73,53,.18); backdrop-filter: blur(8px); }
html[data-theme="dark"] .plaque-copy { background: rgba(43, 66, 49, .95); color: #edf5eb; }
.plaque-copy strong { font-family: Georgia, serif; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 500; line-height: 1; }
.plaque-copy > span:last-child { margin-top: 8px; font-size: .78rem; letter-spacing: .04em; }
.plaque-leaf { margin-bottom: 2px; color: var(--green); }
.photo-slide { display: grid; place-items: center; background: #172019; }
.photo-backdrop { position: absolute; inset: -25px; width: calc(100% + 50px); height: calc(100% + 50px); object-fit: cover; filter: blur(25px) brightness(.65); transform: scale(1.08); }
.photo-contain { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.carousel-button { position: absolute; z-index: 5; top: 50%; width: 40px; height: 40px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 50%; background: rgba(19,30,22,.58); color: white; font-size: 1.7rem; cursor: pointer; backdrop-filter: blur(8px); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots { position: absolute; z-index: 5; bottom: 16px; left: 50%; display: flex; gap: 6px; transform: translateX(-50%); }
.carousel-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); }
.carousel-dots button.active { width: 18px; border-radius: 6px; background: #fff; }
.card-actions { display: flex; align-items: center; gap: 3px; padding: 10px 13px 3px; }
.card-actions form { display: inline-flex; }
.action-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 9px; border: 0; background: transparent; color: var(--text-soft); font-size: .88rem; font-weight: 720; cursor: pointer; }
.action-button > span:first-child { font-size: 1.35rem; line-height: 1; }
.action-button:hover, .action-button.active { color: var(--green-strong); }
.icon-only { font-size: 1.35rem; }
.card-copy { padding: 3px 19px 20px; }
.card-copy p { margin: 7px 0; }
.counts { color: var(--text-soft); font-size: .8rem; }
.feed-aside { position: sticky; top: 110px; display: grid; gap: 18px; }
.aside-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.aside-card h2 { margin-bottom: 12px; }
.aside-card p { color: var(--text-soft); margin-bottom: 0; }
.aside-action { background: radial-gradient(circle at 100% 0, var(--surface-3), transparent 48%), var(--surface); }
.aside-action > p { margin: 15px 0 20px; }
.community-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.community-stats div { display: grid; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--bg-elevated); }
.community-stats strong { font-family: Georgia, serif; font-size: 1.6rem; line-height: 1; }
.community-stats span { margin-top: 5px; color: var(--text-soft); font-size: .67rem; }
.aside-title h3 { margin: 0 0 15px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.popular-list { display: grid; }
.popular-list > a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 11px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.popular-list > a:hover strong { color: var(--green-strong); }
.popular-thumb { width: 48px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 15px; background: var(--surface-3); color: var(--green); }
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-list > a > span:last-child { min-width: 0; display: grid; }
.popular-list strong, .popular-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popular-list strong { font-size: .88rem; }
.popular-list small { color: var(--text-soft); font-size: .68rem; }
.calm-list { list-style: none; display: grid; gap: 14px; margin: 0; padding: 0; }
.calm-list li { display: flex; gap: 12px; color: var(--text-soft); }
.calm-list span { color: var(--green); font-size: .72rem; font-weight: 800; }
.aside-footnote { padding: 0 6px; color: var(--text-soft); font-size: .76rem; }

.center-page { min-height: calc(100vh - 155px); display: grid; place-items: center; }
.auth-card, .error-card { width: min(100%, 500px); padding: clamp(28px, 5vw, 52px); border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1, .error-card h1 { margin-bottom: 12px; font-size: clamp(2.25rem, 5vw, 3.6rem); }
.auth-mark { float: right; color: var(--green); font-size: 2.4rem; }
.stack-form, .form-grid { display: grid; gap: 18px; }
.stack-form { margin-top: 28px; }
label { display: grid; gap: 7px; color: var(--text); font-weight: 680; }
label em { color: var(--text-soft); font-size: .74rem; font-style: normal; font-weight: 500; }
label small, .field-note { color: var(--text-soft); font-size: .78rem; font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 13px; outline: 0; background: var(--surface); color: var(--text); }
input, select { min-height: 48px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(103, 142, 107, .14); }
.auth-switch { margin: 22px 0 0; color: var(--text-soft); text-align: center; }
.auth-switch a { color: var(--green-strong); font-weight: 750; }
.error-code { color: var(--green-light); font-family: Georgia, serif; font-size: 6rem; line-height: 1; }

.page-heading { max-width: 900px; margin-bottom: 34px; }
.page-heading h1 { margin-bottom: 12px; }
.page-heading p { max-width: 720px; color: var(--text-soft); }
.editor-page, .checkout-page, .store-page, .profile-page, .admin-page, .detail-page { max-width: 1200px; margin: 0 auto; }
.memorial-editor { border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; }
.wizard-progress { display: flex; align-items: center; padding: 22px clamp(22px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.wizard-progress button { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--text-soft); font-size: .82rem; font-weight: 740; cursor: pointer; }
.wizard-progress button span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; }
.wizard-progress button span { font-size: .82rem; }
.wizard-progress button.active { color: var(--green-strong); }
.wizard-progress button.active span { border-color: var(--green); background: var(--green); color: var(--bg); }
.wizard-progress i { flex: 1; height: 1px; margin: 0 12px; background: var(--line); }
.editor-step { display: none; padding: clamp(28px, 5vw, 60px); }
.editor-step.active { display: block; animation: step-in .3s ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.step-copy { display: flex; gap: 20px; margin-bottom: 34px; }
.step-copy > span { color: var(--green); font-family: Georgia, serif; font-size: 1.1rem; }
.step-copy h2 { margin-bottom: 6px; }
.step-copy p { color: var(--text-soft); margin: 0; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wizard-actions { display: flex; align-items: center; padding: 20px clamp(22px, 4vw, 48px); border-top: 1px solid var(--line); background: var(--surface-2); }
.upload-drop { min-height: 180px; place-items: center; align-content: center; padding: 28px; border: 1.5px dashed var(--line-strong); border-radius: 20px; background: var(--surface-2); text-align: center; cursor: pointer; }
.upload-drop:hover { border-color: var(--green); }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--green-light); color: var(--green-strong); font-size: 1.5rem; }
.photo-editor { grid-template-columns: minmax(260px, 420px) 1fr; gap: 30px; align-items: center; margin-top: 28px; }
.photo-editor:not([hidden]) { display: grid; }
.photo-editor-preview { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 20px; background: linear-gradient(180deg, #dfe9db, #b7caae); }
.photo-editor-preview .portrait-frame { top: 10%; left: 50%; transform: translateX(-50%); }
html[data-theme="dark"] .photo-editor-preview { background: linear-gradient(180deg, #46644b 0%, #3a5540 60%, #304a37 100%); }
.photo-editor-preview .plaque-copy { bottom: 9%; }
.crop-controls { display: grid; gap: 17px; }
.crop-controls h3 { margin-bottom: -10px; font-size: 1.2rem; }
.crop-controls p { color: var(--text-soft); }
input[type="range"] { min-height: 28px; padding: 0; border: 0; box-shadow: none; accent-color: var(--green); }
.upload-previews, .existing-photos { display: flex; gap: 10px; margin-top: 20px; overflow-x: auto; }
.upload-previews img, .existing-photos img { width: 88px; height: 88px; flex: 0 0 auto; border-radius: 13px; object-fit: cover; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.plaque-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.plaque-choice { position: relative; display: flex; align-items: center; min-height: 110px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); cursor: pointer; }
.plaque-choice input { position: absolute; opacity: 0; }
.plaque-choice:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.plaque-choice { display: grid; grid-template-columns: minmax(0, 1fr); padding-left: 94px; gap: 4px; }
.plaque-choice strong, .plaque-choice small { margin-left: 0; }
.plaque-mini { position: absolute; left: 15px; width: 64px; height: 76px; display: grid; place-items: center; background: #cadac5; }
.plaque-mini i { width: 36px; height: 43px; background: #809d7e; }
.plaque-mini.plaque-garden { border-radius: 28px 28px 8px 8px; }
.plaque-mini.plaque-light { border-radius: 50%; box-shadow: 0 0 18px rgba(184,160,86,.35); }
.plaque-mini.plaque-light i { border-radius: 50%; background: #dbca93; }
.plaque-mini.plaque-stone { border-radius: 25px 25px 4px 4px; background: #b2b9af; }

.detail-hero { display: grid; grid-template-columns: minmax(350px, 620px) minmax(300px, 1fr); gap: clamp(32px, 6vw, 78px); align-items: center; }
.detail-gallery { border-radius: 30px; box-shadow: var(--shadow); }
.detail-summary h1 { margin-bottom: 8px; }
.species-line { color: var(--text-soft); }
.detail-summary blockquote { margin: 30px 0; padding-left: 20px; border-left: 2px solid var(--sage); color: var(--text); font-family: Georgia, serif; font-size: clamp(1.3rem, 2.5vw, 1.85rem); line-height: 1.45; }
.detail-owner { display: flex; align-items: center; gap: 12px; color: var(--text-soft); }
.detail-owner a { color: var(--text); font-weight: 720; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.detail-actions form { display: flex; }
.edit-link { display: inline-block; margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 54px; margin-top: 70px; }
.story-section, .comments-section, .offering-panel { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.story-section { margin-bottom: 28px; }
.prose { white-space: pre-line; color: var(--text-soft); font-family: Georgia, serif; font-size: 1.13rem; line-height: 1.8; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; }
.section-heading > span { color: var(--text-soft); font-size: .85rem; }
.comment-form { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; margin-bottom: 26px; }
.comment-form textarea { min-height: 76px; }
.comment-list { display: grid; gap: 20px; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.comment p { margin: 5px 0; color: var(--text-soft); }
.comment-meta { display: flex; gap: 10px; align-items: baseline; }
.comment-meta a { font-weight: 750; }
.comment-meta span { color: var(--text-soft); font-size: .75rem; }
.report-link { padding: 0; border: 0; background: none; color: var(--text-soft); font-size: .73rem; cursor: pointer; }
.report-link:hover { color: var(--danger); }
.sign-in-prompt, .empty-inline { padding: 18px; border-radius: 15px; background: var(--surface-2); color: var(--text-soft); }
.sign-in-prompt { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.sign-in-prompt p { margin: 0; }
.detail-aside { display: grid; align-content: start; gap: 15px; }
.offering-panel { position: sticky; top: 105px; }
.offering-list { display: grid; gap: 12px; margin: 22px 0; }
.offering-chip { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.offering-chip > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--green); }
.offering-chip div { display: grid; }
.offering-chip small { color: var(--text-soft); }
.offering-chip p { grid-column: 1 / -1; margin: 6px 0 0; color: var(--text-soft); font-size: .84rem; }
.report-dialog { width: min(90vw, 480px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.report-dialog::backdrop { background: rgba(8,15,10,.58); backdrop-filter: blur(4px); }
.report-dialog form { position: relative; display: grid; gap: 18px; padding: 32px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; }

.checkout-grid { display: grid; grid-template-columns: minmax(360px, 620px) 360px; gap: 50px; align-items: start; }
.checkout-preview .memory-card a, .checkout-preview .card-actions { pointer-events: none; }
.order-card { position: sticky; top: 105px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.order-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--text-soft); }
.order-row strong { color: var(--text); }
.order-row.total { margin-bottom: 20px; border-bottom: 0; font-size: 1.05rem; }
.demo-notice, .demo-banner { padding: 15px; border: 1px solid rgba(177,138,79,.3); border-radius: 15px; background: rgba(177,138,79,.09); }
.demo-notice { margin-bottom: 18px; }
.demo-notice p { margin: 4px 0 0; color: var(--text-soft); font-size: .85rem; }
.order-card .button + .button { margin-top: 9px; }

.store-hero { min-height: 280px; display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: clamp(30px, 6vw, 68px); margin-bottom: 18px; border-radius: 30px; overflow: hidden; background: radial-gradient(circle at 80% 20%, rgba(255,255,230,.42), transparent 28%), linear-gradient(145deg, var(--surface-3), var(--surface)); }
.store-hero h1 { max-width: 720px; margin-bottom: 12px; }
.store-hero p { max-width: 640px; margin: 0; color: var(--text-soft); }
.store-symbol { color: var(--green); font-size: clamp(4rem, 10vw, 9rem); opacity: .45; }
.demo-banner { display: flex; gap: 12px; margin: 20px 0 26px; }
.demo-banner span { color: var(--text-soft); }
.selected-memory { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.selected-memory span { color: var(--text-soft); }
.selected-memory a { margin-left: auto; color: var(--green); font-weight: 700; }
.offering-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.offering-card { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.offering-visual { aspect-ratio: 1.55; display: grid; place-items: center; margin-bottom: 18px; border-radius: 17px; background: radial-gradient(circle, rgba(255,255,255,.5), transparent 40%), linear-gradient(145deg, var(--surface-2), var(--green-light)); }
.offering-visual span { color: var(--green-strong); font-family: Georgia, serif; font-size: 4rem; }
.offering-category { color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.offering-card h2 { margin: 5px 0 8px; font-size: 1.55rem; }
.offering-card > p { flex: 1; color: var(--text-soft); }
.offering-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.offering-meta span { color: var(--text-soft); font-size: .75rem; }
.offering-form { display: grid; gap: 11px; }

.profile-header { display: flex; align-items: center; gap: 24px; padding: 30px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); }
.profile-header h1 { margin-bottom: 5px; }
.profile-header p { margin: 0; color: var(--text-soft); }
.profile-stats { display: flex; gap: 40px; padding: 24px 30px; margin-bottom: 30px; }
.profile-stats div { display: grid; }
.profile-stats strong { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.profile-stats span { color: var(--text-soft); font-size: .8rem; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.profile-memory { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.profile-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.profile-image img { width: 100%; height: 100%; object-fit: cover; }
.profile-image .status-badge { position: absolute; top: 10px; right: 10px; }
.profile-memory > div:last-child { display: grid; padding: 14px; }
.profile-memory span { color: var(--text-soft); font-size: .8rem; }
.history-section { margin-top: 50px; }
.history-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.history-list > div { display: flex; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.history-list > div:last-child { border: 0; }
.history-list span { display: grid; }
.history-list small { color: var(--text-soft); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.stat-grid div { display: grid; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.stat-grid strong { font-family: Georgia, serif; font-size: 2.4rem; font-weight: 500; }
.stat-grid span { color: var(--text-soft); text-transform: capitalize; }
.admin-section { margin-top: 48px; }
.admin-list { display: grid; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.admin-list article { display: flex; align-items: center; gap: 18px; padding: 17px; border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-list article:last-child { border-bottom: 0; }
.admin-list article > div { flex: 1; }
.admin-list p { margin: 4px 0; color: var(--text-soft); }
.admin-list small { color: var(--text-soft); }
.status-badge { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-published, .status-visible, .status-resolved { color: var(--green-strong); background: var(--green-light); }
.status-hidden { color: var(--danger); background: rgba(168,83,83,.12); }
.status-draft, .status-open { color: var(--gold); background: rgba(177,138,79,.12); }
.admin-table { display: grid; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.admin-table-head, .admin-table-row { display: grid; grid-template-columns: minmax(220px, 1fr) 120px minmax(220px, .8fr); gap: 18px; align-items: center; padding: 14px 18px; }
.admin-table-head { background: var(--surface-2); color: var(--text-soft); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.admin-table-row { border-top: 1px solid var(--line); background: var(--surface); }
.admin-table-row > span:first-child { display: grid; }
.admin-table-row small { color: var(--text-soft); }
.admin-table-row form { display: flex; gap: 8px; }
.admin-table-row form input { min-height: 36px; }

.empty-state { display: grid; place-items: center; padding: 70px 24px; border: 1px dashed var(--line-strong); border-radius: 24px; text-align: center; }
.empty-state > span { color: var(--green); font-size: 2.4rem; }
.empty-state h2 { margin: 10px 0 6px; }
.empty-state p { max-width: 480px; color: var(--text-soft); }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 999px; background: #26372b; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  :root { --sidebar: 82px; }
  .sidebar { align-items: center; padding-inline: 12px; }
  .nav-item { justify-content: center; width: 54px; }
  .nav-item > span:last-child, .sidebar-note, .sidebar .text-button { display: none; }
  .feed-layout { grid-template-columns: minmax(0, 660px); }
  .feed-aside { display: none; }
  .offering-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .topbar { height: 64px; padding: 0 16px; }
  .app-shell { display: block; padding-top: 64px; }
  .sidebar { display: none; }
  .main-content { padding: 24px 14px 96px; }
  .mobile-nav { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: 9px; height: 68px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-elevated); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
  .mobile-nav a { display: grid; place-items: center; gap: 1px; color: var(--text-soft); }
  .mobile-nav a.active { color: var(--green-strong); }
  .mobile-nav span { font-size: 1.18rem; }
  .mobile-nav small { font-size: .64rem; }
  .mobile-nav .mobile-create { width: 48px; height: 48px; place-self: center; border-radius: 50%; background: var(--green-strong); color: var(--bg); }
  .feed-intro { align-items: start; }
  .feed-intro .button { display: none; }
  .feed-intro h1 { font-size: 2.8rem; }
  .feed-intro p { font-size: .92rem; }
  .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .story-section { margin-top: 44px; }
  .section-heading { align-items: start; }
  .memory-card { border-radius: 20px; }
  .action-button { padding-inline: 7px; }
  .action-button span:last-child { display: none; }
  .two-columns, .photo-editor, .detail-hero, .detail-grid, .checkout-grid { grid-template-columns: 1fr; }
  .wizard-progress { justify-content: center; }
  .wizard-progress button { font-size: 0; }
  .wizard-progress i { max-width: 45px; margin: 0 5px; }
  .editor-step { padding: 27px 20px; }
  .plaque-picker { grid-template-columns: 1fr; }
  .detail-hero { gap: 30px; }
  .detail-grid { margin-top: 38px; gap: 28px; }
  .offering-panel, .order-card { position: static; }
  .comment-form { grid-template-columns: auto 1fr; }
  .comment-form .button { grid-column: 2; justify-self: end; }
  .store-hero { min-height: 240px; padding: 28px; }
  .store-symbol { display: none; }
  .offering-grid, .profile-grid, .stat-grid { grid-template-columns: 1fr; }
  .profile-header { align-items: start; flex-wrap: wrap; padding: 22px; }
  .profile-header .push-right { width: 100%; margin: 0; }
  .admin-table-head { display: none; }
  .admin-table-row { grid-template-columns: 1fr; }
  .admin-list article { align-items: flex-start; flex-wrap: wrap; }
  .flash-stack { top: 74px; right: 16px; }
}

@media (max-width: 460px) {
  .topbar-actions { gap: 7px; }
  .language-picker select { width: 90px; font-size: .73rem; }
  .topbar { padding-inline: 12px; }
  .brand { gap: 6px; }
  .brand span { font-size: 1.15rem; }
  .feed-intro h1 { font-size: 2.35rem; }
  .discovery-tabs a { padding-inline: 8px; font-size: .8rem; }
  .preview-copy { padding: 10px 11px 12px; }
  .preview-copy strong { font-size: 1.06rem; }
  .section-heading .quiet-link { font-size: .76rem; }
  .card-header { min-height: 64px; }
  .portrait-frame { width: 66%; }
  .plaque-copy { width: 82%; min-height: 112px; }
  .plaque-copy strong { font-size: 1.85rem; }
  .detail-actions .button { width: 100%; }
  .detail-actions form { width: 100%; }
  .detail-actions form .button { width: 100%; }
  .demo-banner { display: grid; }
  .selected-memory { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.memorial-editor { scroll-margin-top: 90px; }
.wizard-error { margin: 0; padding: 14px 24px; color: var(--danger); }
.wizard-actions { gap: 12px; }
input:disabled { cursor: not-allowed; opacity: .45; }
button:disabled { cursor: wait; opacity: .65; }
