:root {
  --paper: #f7f2e7;
  --paper-deep: #efe5d3;
  --surface: #fffdf8;
  --ink: #241f1a;
  --ink-soft: #4b4238;
  --muted: #857868;
  --line: #e2d7c2;
  --accent: #9c3b2c;
  --accent-dark: #7d2c20;
  --gold: #a9874f;
  --shadow: 0 18px 48px rgba(64, 49, 29, 0.09);
  --radius: 14px;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "SimSun", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, legend {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }

img { max-width: 100%; display: block; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(169, 135, 79, 0.14);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ── Header / footer ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 242, 231, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand-text {
  font-size: 1.06rem;
  letter-spacing: 0.16em;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text small {
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.inline-form { display: inline; margin: 0; }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.link-button:hover { color: var(--accent-dark); text-decoration: underline; }
.link-button.danger { color: #8d2f22; }

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-quote {
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 8px;
}
.footer-meta { margin: 0; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff8ef;
  box-shadow: 0 10px 24px rgba(156, 59, 44, 0.24);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff8ef; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }

.btn-small { padding: 8px 16px; font-size: 0.86rem; }
.btn-block { width: 100%; }

.btn-google {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

/* ── Type helpers ────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.lede { font-size: 1.1rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.7);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.badge-public { border-color: rgba(169, 135, 79, 0.5); color: #7a5c2c; }
.badge-passcode { border-color: rgba(156, 59, 44, 0.4); color: var(--accent); }
.badge-muted { color: var(--muted); }
.badge-gold { border-color: var(--gold); color: #7a5c2c; }

.alert {
  background: #fdf1e8;
  border: 1px solid #e8c3ae;
  border-left: 4px solid var(--accent);
  color: #6f2a1e;
  padding: 14px 18px;
  border-radius: 10px;
  margin: 0 0 24px;
  font-size: 0.95rem;
}
.error-list { margin: 0; padding-left: 18px; }

.toast {
  background: #eef5ea;
  border: 1px solid #c6d9b8;
  color: #3f5c33;
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}

/* ── Home ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  background:
    radial-gradient(720px 420px at 82% 18%, rgba(169, 135, 79, 0.18), transparent 62%),
    radial-gradient(560px 380px at 8% 92%, rgba(156, 59, 44, 0.10), transparent 60%),
    linear-gradient(180deg, #faf6ec 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner { max-width: 760px; }

.hero h1 { margin-bottom: 22px; letter-spacing: 0.06em; }

.hero .lede { max-width: 620px; margin-bottom: 32px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }

.hero-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.hero-mark {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  color: var(--gold);
  opacity: 0.5;
  pointer-events: none;
}
.hero-mark svg { width: 100%; height: auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  padding-top: 64px;
  padding-bottom: 24px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
}
.feature-index {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  margin-bottom: 14px;
}
.feature h2 { font-size: 1.18rem; }
.feature p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }

.how { padding-top: 72px; }
.section-head { margin-bottom: 28px; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 24px 22px 20px;
  border-top: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.8), transparent);
}
.steps li::before {
  content: "0" counter(step);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.steps h3 { margin-top: 8px; }
.steps p { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 0; }

.quote-band {
  margin-top: 88px;
  padding: 56px 0;
  background: var(--ink);
  color: #f3e9d6;
  text-align: center;
}
.quote-band blockquote {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  letter-spacing: 0.24em;
  color: #e5cfa4;
}
.quote-band p { margin: 0; color: #bdb2a0; font-size: 0.95rem; }

/* ── Auth ────────────────────────────────────────────────────────── */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 0;
  max-width: 1080px;
  margin: 64px auto 0;
  padding: 0 24px;
  align-items: stretch;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 44px 44px 36px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.auth-hint { color: var(--ink-soft); font-size: 0.95rem; }
.auth-fineprint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.7;
}

.auth-aside {
  background: linear-gradient(160deg, #2c261f 0%, #3a3127 100%);
  color: #efe4d0;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-aside h2 { color: #f6ecd9; letter-spacing: 0.08em; }
.seal-line {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: #c8a877;
  margin-bottom: 18px;
}
.plain-list { margin: 18px 0 0; padding-left: 18px; font-size: 0.92rem; color: #c9bda9; }
.plain-list li { margin-bottom: 10px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.resend-form {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.stack-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.field > span b { color: var(--accent); }
.field > span em { color: var(--muted); font-style: normal; }

input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="number"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 135, 79, 0.16);
}
textarea { resize: vertical; }

.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.field-inline { display: flex; flex-direction: column; gap: 4px; }
.field-inline > span {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.field-hint {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.6;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ── Memorial page ───────────────────────────────────────────────── */
.memorial-hero {
  padding: 64px 0 48px;
  background:
    radial-gradient(600px 320px at 78% 10%, rgba(169, 135, 79, 0.16), transparent 65%),
    linear-gradient(180deg, #faf6ec, var(--paper));
  border-bottom: 1px solid var(--line);
}

.memorial-hero-inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.portrait {
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
}
.portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.02);
}

.portrait-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(45deg, rgba(169, 135, 79, 0.08) 0 2px, transparent 2px 10px),
    var(--paper-deep);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
}
.portrait-empty span {
  font-size: 4.4rem;
  color: rgba(122, 92, 44, 0.42);
}

.memorial-intro h1 { margin-bottom: 6px; }
.lamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(169, 135, 79, 0.55);
  border-radius: 999px;
  background: rgba(169, 135, 79, 0.12);
  color: #7a5c2c;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  box-shadow: 0 0 0 1px rgba(169, 135, 79, 0.08), 0 0 18px rgba(169, 135, 79, 0.18);
  animation: candle-breathe 3.2s ease-in-out infinite;
}

.lamp-cta {
  display: inline-block;
  margin-top: 0.9rem;
  color: #8a6a35;
  font-family: var(--sans);
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(169, 135, 79, 0.45);
}

.lamp-cta:hover { color: var(--gold); border-bottom-color: var(--gold); }
.lamp-cta-muted { color: var(--muted); border-bottom: 0; }

@keyframes candle-breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(169, 135, 79, 0.08), 0 0 12px rgba(169, 135, 79, 0.14); }
  50% { box-shadow: 0 0 0 1px rgba(169, 135, 79, 0.16), 0 0 26px rgba(169, 135, 79, 0.32); }
}

@media (prefers-reduced-motion: reduce) {
  .lamp-badge { animation: none; }
}
.latin-name {
  font-family: var(--sans);
  font-size: 0.94rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.life-dates {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.life-dates .dash { margin: 0 10px; color: var(--gold); }

.epitaph {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 640px;
  white-space: pre-line;
}
.epitaph-en {
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}

.owner-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Offer actions */
.offer-section { padding-top: 40px; }

.offer-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  box-shadow: var(--shadow);
}

.offer-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.offer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.offer-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--serif);
  text-align: left;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.offer-button:hover {
  border-color: var(--gold);
  background: #fffaf0;
  transform: translateY(-1px);
  color: var(--ink);
}
.offer-button svg { width: 30px; height: 30px; color: var(--gold); }
.offer-label { font-size: 0.95rem; letter-spacing: 0.04em; }
.offer-count {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 2px 9px;
  min-width: 32px;
  text-align: center;
}

.letter-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.letter-block .field { width: 100%; }

.locked-note {
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Timeline */
.timeline-section { padding-top: 64px; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  border-left: 1px solid var(--line);
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 26px;
  padding: 0 0 34px 28px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--paper);
}
.timeline-year {
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding-top: 2px;
}
.timeline-body p { color: var(--ink-soft); font-size: 0.95rem; }
.timeline-body img {
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  max-height: 320px;
  object-fit: cover;
}

/* Offerings */
.offerings-section { padding-top: 56px; }

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.section-head-row h2 { margin-bottom: 0; }

.count-summary {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

.offering-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.offering {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.offering-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--gold);
  font-size: 0.92rem;
}
.offering-note .offering-mark { color: var(--accent); }

.offering-meta {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}
.offering-meta strong { color: var(--ink-soft); font-weight: 600; }
.offering-meta time { float: right; font-size: 0.74rem; }
.offering-place { color: var(--muted); }

.offering-message {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
  white-space: pre-line;
}
.offering-message.muted { color: var(--muted); font-size: 0.9rem; }

.empty-state {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.5);
}
.empty-state.large { padding: 64px 24px; }
.empty-state h2 { color: var(--ink); }
.empty-glyph {
  font-size: 2.4rem;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 8px;
}

/* Share */
.share-panel {
  margin-top: 56px;
  padding: 28px;
  background: #f3ecdd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.share-row input {
  flex: 1 1 320px;
  font-family: var(--sans);
  font-size: 0.85rem;
  background: #fffdf8;
}

/* ── Dashboard / admin ───────────────────────────────────────────── */
.dash, .admin { padding-top: 56px; }

.dash-head, .admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.dash-head h1, .admin-head h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin-bottom: 6px; }
.dash-sub { color: var(--muted); font-size: 0.92rem; margin: 0; }

.memorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.memorial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.memorial-card-top { display: flex; gap: 8px; margin-bottom: 12px; }
.memorial-card h2 { font-size: 1.24rem; margin-bottom: 4px; }
.memorial-card h2 a { color: var(--ink); }
.memorial-card h2 a:hover { color: var(--accent); }
.memorial-stats {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 14px 0 18px;
}
.card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.memorial-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 30px 30px;
  box-shadow: var(--shadow);
}

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 26px 0 6px;
}
fieldset:first-of-type { border-top: 0; }
legend {
  padding: 0;
  font-size: 1.08rem;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field-wide { grid-column: 1 / -1; }

textarea.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.7;
}

.radio-group { display: grid; gap: 10px; margin-bottom: 18px; }
.radio-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: var(--gold);
  background: #fdf7ea;
}
.radio-card input { margin-top: 5px; }
.radio-card span { display: flex; flex-direction: column; gap: 2px; }
.radio-card strong { font-weight: 600; font-size: 0.98rem; }
.radio-card small { color: var(--muted); font-family: var(--sans); font-size: 0.78rem; line-height: 1.6; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 26px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-section {
  margin-top: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px 30px;
}
.admin-section h2 { font-size: 1.3rem; }

.admin-inline-actions {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}

.table-scroll { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.85rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.admin-table tr.row-hidden { opacity: 0.55; }
.cell-message { max-width: 360px; color: var(--ink-soft); }

/* ── Gate / error ────────────────────────────────────────────────── */
.gate-shell, .error-shell {
  min-height: 56vh;
  display: grid;
  place-items: center;
  padding: 80px 24px;
}
.gate-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 40px 34px;
  box-shadow: var(--shadow);
}
.gate-card h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.gate-lede { color: var(--ink-soft); font-size: 0.98rem; }

.error-shell { text-align: center; }
.error-shell h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.error-shell p { color: var(--muted); }
.error-code {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  color: var(--gold);
  margin-bottom: 12px;
}
.error-actions { margin-top: 24px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-mark { display: none; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-card { border-radius: var(--radius) var(--radius) 0 0; }
  .auth-aside { border-radius: 0 0 var(--radius) var(--radius); }
  .memorial-hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .portrait, .portrait-empty { width: 200px; }
  .memorial-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 64px 0 48px; }
  .offer-identity, .form-grid, .offer-buttons { grid-template-columns: 1fr; }
  .offer-button { grid-template-columns: 30px 1fr auto; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; padding-left: 20px; }
  .auth-card, .memorial-form, .admin-section { padding-left: 20px; padding-right: 20px; }
  .offering-meta time { float: none; display: block; }
  .site-nav { gap: 12px; font-size: 0.88rem; }
  .brand-text { font-size: 0.98rem; }
}
