/* ═══════════════════════════════════════════════════════════════════════
   wasinunsbleibt.de
   Gedenkseiten mit QR-Code. Gestaltung: Papier, Stein, Schriftsatz.
   Zurückhaltend statt dekorativ — die Inhalte der Trauernden tragen die Seite.
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Papier & Tinte */
  --paper:        #f5f3ee;
  --paper-raised: #fdfcf9;
  --paper-sunken: #efece4;
  --ink:          #1b1a16;
  --ink-soft:     #4c4840;
  --ink-mute:     #7d776c;
  --ink-faint:    #a49d90;

  /* Linien */
  --rule:         #e3ded2;
  --rule-strong:  #cfc8b8;

  /* Efeu — der einzige Akzent */
  --ivy:          #2f4a3b;
  --ivy-hover:    #263c30;
  --ivy-soft:     #55705e;
  --ivy-pale:     #e9efe9;

  /* Signal */
  --clay:         #8c4b32;
  --clay-pale:    #f7ece7;

  --radius:       4px;
  --radius-lg:    8px;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;

  /* Aliase für ältere Markup-Teile */
  --text:       var(--ink);
  --text-soft:  var(--ink-soft);
  --text-muted: var(--ink-mute);
  --text-dim:   var(--ink-faint);
  --black:      var(--ink);
  --gold:       var(--ivy);
  --gold-light: var(--ivy-soft);
  --gold-dim:   var(--rule);
}

html {
  font-family: var(--sans);
  font-size: 17px;
  scroll-behavior: smooth;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

::selection { background: var(--ivy); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ivy);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Grundraster ─────────────────────────────────────────────────────── */
.page-wrap    { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; }
.shell        { max-width: 1080px; margin: 0 auto; padding: 0 1.75rem; width: 100%; }
.shell-narrow { max-width: 680px; }

/* ── Typografie ──────────────────────────────────────────────────────── */
.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.headline-gold {
  font-style: italic;
  color: var(--ivy);
}
.lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 46ch;
}
.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-mute);
}

/* ── Kopfzeile ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 243, 238, 0.92);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(180%) blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}
.site-logo {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  flex: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}
.logo-mark {
  width: 15px; height: 15px;
  flex: none;
  align-self: center;
  color: var(--ivy);
}
.logo-ornament { color: var(--ivy); font-size: 0.8rem; }
.logo-text { line-height: 1; }
.header-nav { display: flex; align-items: center; gap: 0.35rem; }

/* Der Markenname ist lang — auf schmalen Geräten braucht er weniger Gewicht. */
@media (max-width: 560px) {
  .header-inner { gap: 0.5rem; }
  .site-logo { font-size: 1rem; gap: 0.35rem; }
  .logo-mark { width: 12px; height: 12px; }
}

/* ── Flächen ─────────────────────────────────────────────────────────── */
.panel {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.panel-strong {
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
}

/* ── Schaltflächen ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-gold {
  background: var(--ivy);
  color: #fbfaf7;
  border-color: var(--ivy);
}
.btn-gold:hover { background: var(--ivy-hover); border-color: var(--ivy-hover); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.86rem; }
.btn-w  { width: 100%; }

.btn-ghost-sm {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.btn-ghost-sm:hover {
  border-color: var(--ivy);
  color: var(--ivy);
  background: var(--ivy-pale);
}
.btn-text {
  background: none; border: 0; padding: 0;
  color: var(--ivy); font-weight: 500; cursor: pointer;
  border-bottom: 1px solid var(--rule-strong);
}
.btn-text:hover { border-bottom-color: var(--ivy); }

.btn-approve, .btn-reject {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  border: 1px solid;
  background: transparent;
}
.btn-approve { color: var(--ivy);  border-color: var(--ivy); }
.btn-approve:hover { background: var(--ivy); color: #fff; }
.btn-reject  { color: var(--clay); border-color: rgba(140,75,50,0.4); }
.btn-reject:hover { background: var(--clay); color: #fff; border-color: var(--clay); }

/* ── Abschnitte ──────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: 500;
  letter-spacing: -0.01em;
}
.mem-section-title {
  font-family: var(--serif);
  font-size: 1.35rem; font-weight: 500;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.label-rule {
  display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.label-rule::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}

/* ── Formulare ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
  display: block;
  font-size: 0.83rem; font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.form-hint {
  font-weight: 400; font-size: 0.78rem; color: var(--ink-mute);
  margin-left: 0.4rem;
}
.req { color: var(--clay); }

.input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus {
  outline: none;
  border-color: var(--ivy);
  box-shadow: 0 0 0 3px rgba(47, 74, 59, 0.10);
}
.textarea { resize: vertical; line-height: 1.6; min-height: 120px; }
select.input { appearance: none; background-image: none; }

.form-section { padding: 1.5rem 1.6rem; }
.form-section-title {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 500;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

.toggle-label {
  display: inline-flex; align-items: center; gap: 0.7rem;
  cursor: pointer; font-size: 0.93rem;
}
.toggle-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 42px; height: 24px; flex: none;
  border-radius: 999px;
  background: var(--paper-sunken);
  border: 1px solid var(--rule-strong);
  position: relative;
  transition: background-color 0.18s, border-color 0.18s;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  border: 1px solid var(--rule-strong);
  transition: transform 0.18s;
}
.toggle-label input:checked + .toggle-track {
  background: var(--ivy); border-color: var(--ivy);
}
.toggle-label input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px); border-color: var(--ivy);
}

.img-upload-box {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  min-height: 130px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0.75rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.img-upload-box:hover { border-color: var(--ivy); background: var(--ivy-pale); }
.img-upload-ph {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  color: var(--ink-mute); font-size: 0.83rem;
}
.img-upload-ph svg { width: 24px; height: 24px; color: var(--ink-faint); }

.photo-upload-area { margin-top: 0.5rem; }
.photo-upload-label {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sunken);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.photo-upload-label:hover { border-color: var(--ivy); background: var(--ivy-pale); }
.photo-upload-icon { color: var(--ink-mute); display: flex; }
.photo-upload-icon svg { width: 20px; height: 20px; }
.photo-upload-text { font-size: 0.9rem; font-weight: 500; }
.photo-upload-hint { font-size: 0.78rem; color: var(--ink-mute); margin-left: auto; }

/* ── Hinweise ────────────────────────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid;
  transition: opacity 0.4s;
}
.flash-error   { background: var(--clay-pale); border-color: rgba(140,75,50,0.28); color: #6f3a26; }
.flash-success { background: var(--ivy-pale);  border-color: rgba(47,74,59,0.25);  color: var(--ivy); }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 1rem; border: 1px solid; }
.alert-error   { background: var(--clay-pale); border-color: rgba(140,75,50,0.28); color: #6f3a26; }
.alert-success { background: var(--ivy-pale);  border-color: rgba(47,74,59,0.25);  color: var(--ivy); }

/* ═══ STARTSEITE ═══════════════════════════════════════════════════════ */
.landing { padding: 0 0 5rem; }

/* Auftakt */
.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 4rem;
  align-items: center;
  padding: 5rem 0 4.5rem;
}
.hero-copy .kicker { margin-bottom: 1.1rem; }
.hero-copy .headline { margin-bottom: 1.35rem; }
.hero-copy .lead { margin-bottom: 2rem; }
.hero-actions {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
}
.hero-note {
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: var(--ink-mute);
}

/* Der Stein mit der Plakette — erklärt das Produkt ohne Worte */
.hero-object {
  position: relative;
  display: flex; justify-content: center;
}
.stone {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(168deg, #b9b4a8 0%, #a8a396 42%, #99948a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -14px 26px rgba(0,0,0,0.12),
    0 18px 34px rgba(27,26,22,0.16);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.15rem;
  padding: 2.25rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.stone::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.20) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 42%, rgba(0,0,0,0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 74%, rgba(0,0,0,0.05) 0 1.5px, transparent 3px),
    radial-gradient(circle at 82% 86%, rgba(255,255,255,0.16) 0 1px, transparent 2px);
  background-size: 90px 90px, 70px 70px, 110px 110px, 60px 60px;
  opacity: 0.8;
  pointer-events: none;
}
.stone-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #35322b;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}
.stone-dates {
  font-size: 0.8rem;
  color: rgba(53,50,43,0.72);
  letter-spacing: 0.06em;
  margin-top: -0.75rem;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.stone-plate {
  background: #faf8f3;
  border-radius: 3px;
  padding: 0.7rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5),
    0 6px 14px rgba(0,0,0,0.22);
  position: relative;
  z-index: 1;
}
.stone-plate svg, .stone-plate img { width: 104px; height: 104px; display: block; }
.stone-plate-caption {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(53,50,43,0.6);
  text-align: center;
  margin-top: 0.5rem;
}
.hero-object-hint {
  position: absolute;
  right: -0.5rem; bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  box-shadow: 0 6px 16px rgba(27,26,22,0.08);
}
.hero-object-hint svg { width: 14px; height: 14px; color: var(--ivy); }

/* Ablauf */
.steps { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.75rem;
  margin-top: 2rem;
}
.step { position: relative; padding-top: 1.75rem; }
.step::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--rule-strong);
}
.step-no {
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--ivy);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.step-title {
  font-family: var(--serif);
  font-size: 1.2rem; font-weight: 500;
  margin-bottom: 0.4rem;
}
.step-desc { font-size: 0.93rem; color: var(--ink-soft); line-height: 1.65; }

/* Was auf einer Gedenkseite steht */
.detail { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem;
  align-items: start;
  margin-top: 2rem;
}
.feature-list { list-style: none; }
.feature-list li {
  display: flex; gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.feature-list li:first-child { padding-top: 0; }
.feature-list li:last-child { border-bottom: 0; }
.feature-icon {
  flex: none;
  width: 22px; height: 22px;
  color: var(--ivy);
  margin-top: 0.15rem;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-title { display: block; font-weight: 600; font-size: 0.97rem; margin-bottom: 0.15rem; }
.feature-desc  { display: block; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.6; }

/* Vorschau einer echten Seite */
.preview-frame {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-sunken);
}
.preview-url {
  font-size: 0.74rem;
  color: var(--ink-mute);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.preview-body { padding: 1.5rem 1.6rem 1.75rem; }
.preview-portrait {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--paper-sunken);
  border: 1px solid var(--rule-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}
.preview-portrait svg { width: 26px; height: 26px; }
.preview-name {
  font-family: var(--serif);
  font-size: 1.45rem; line-height: 1.2;
}
.preview-dates {
  font-size: 0.83rem; color: var(--ink-mute); margin-top: 0.15rem;
  letter-spacing: 0.04em;
}
.preview-text {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem; line-height: 1.7; color: var(--ink-soft);
}
.preview-entry {
  margin-top: 1rem; padding: 0.85rem 1rem;
  background: var(--paper-sunken);
  border-radius: var(--radius);
  font-size: 0.87rem; color: var(--ink-soft);
}
.preview-entry-name {
  font-weight: 600; color: var(--ink); font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

/* Ruhige Zusicherungen */
.assurances { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.assurance-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  margin-top: 2rem;
}
.assurance-term {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.assurance-desc { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.6; }

/* Abschluss */
.closing {
  margin-top: 3.5rem;
  padding: 3rem 2.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  text-align: center;
}
.closing-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.closing-text {
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 auto 1.75rem;
  font-size: 0.98rem;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2.75rem; padding: 3rem 0; }
  .hero-object { padding-bottom: 2.75rem; }
  .hero-object-hint {
    right: auto; left: 50%; bottom: 0;
    transform: translateX(-50%);
    white-space: nowrap;
  }
  .stone { max-width: 250px; }
  .steps-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .detail-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .assurance-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}
@media (max-width: 520px) {
  .assurance-grid { grid-template-columns: 1fr; }
  .closing { padding: 2.25rem 1.5rem; }
}

/* ── Anmelde-Dialog ──────────────────────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.auth-modal[hidden] { display: none !important; }
.auth-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(27, 26, 22, 0.42);
}
.auth-modal-dialog {
  position: relative; z-index: 1;
  width: min(100%, 400px);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 1.9rem 1.85rem 2rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(27, 26, 22, 0.22);
}
.auth-modal-close {
  position: absolute; top: 0.6rem; right: 0.7rem;
  width: 2rem; height: 2rem;
  border: 0; background: transparent;
  color: var(--ink-mute);
  font-size: 1.35rem; line-height: 1;
  cursor: pointer; border-radius: var(--radius);
}
.auth-modal-close:hover { color: var(--ink); background: var(--paper-sunken); }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.auth-tab {
  border: 0; background: none;
  padding: 0.55rem 0.5rem 0.7rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { color: var(--ink); border-bottom-color: var(--ivy); }
.login-title {
  font-family: var(--serif);
  font-size: 1.4rem; font-weight: 500;
  margin-bottom: 1.1rem;
}
.login-panel { padding: 2rem 2rem 2.25rem; }
.auth-pane[hidden] { display: none; }
.auth-modal-dialog .form-group:last-of-type { margin-bottom: 1.25rem; }
body.auth-modal-open { overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ptpl-mark { letter-spacing: 0.3em; }

/* ── Profil-Menü ─────────────────────────────────────────────────────── */
.header-profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.profile-btn:hover { border-color: var(--rule-strong); background: var(--paper-raised); }
.profile-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ivy); color: #fbfaf7;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600;
  flex: none;
}
.profile-name { font-size: 0.9rem; font-weight: 500; }
.profile-chevron { font-size: 0.65rem; color: var(--ink-mute); }
.header-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: var(--clay); color: #fff;
  font-size: 0.7rem; font-weight: 600;
}
.profile-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 0.5rem);
  min-width: 232px;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(27,26,22,0.14);
  overflow: hidden;
  z-index: 60;
}
.profile-dropdown.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  background: none; border: 0; text-align: left;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--paper-sunken); }
.dropdown-divider { height: 1px; background: var(--rule); }
.dropdown-logout { color: var(--clay); }
.dropdown-qr-hint {
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  color: var(--ivy);
  background: var(--ivy-pale);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ── Benachrichtigungen ──────────────────────────────────────────────── */
.notif-section { margin-bottom: 1rem; }
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: var(--clay); color: #fff;
  font-size: 0.75rem; font-weight: 600;
  vertical-align: middle;
}
.notif-group { display: flex; flex-direction: column; gap: 0.85rem; }
.notif-group-title {
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 0.25rem;
}
.notif-card {
  display: flex; gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; flex: none;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 0.95rem; }
.notif-memorial { font-weight: 400; color: var(--ink-mute); font-size: 0.87rem; }
.notif-memorial a { color: var(--ivy); border-bottom: 1px solid var(--rule-strong); }
.notif-message {
  margin-top: 0.4rem;
  font-size: 0.92rem; color: var(--ink-soft);
  font-family: var(--serif); font-style: italic;
}
.notif-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.45rem; }
.notif-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }

/* ── Eigene Gedenkseiten ─────────────────────────────────────────────── */
.memorial-list { display: flex; flex-direction: column; gap: 0.85rem; }
.memorial-list-item {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1rem 1.25rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.memorial-thumb {
  width: 60px; height: 60px; border-radius: var(--radius);
  object-fit: cover; flex: none;
  border: 1px solid var(--rule);
}
.memorial-thumb-placeholder {
  width: 60px; height: 60px; border-radius: var(--radius);
  background: var(--paper-sunken);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); flex: none;
}
.memorial-info { flex: 1; min-width: 0; }
.memorial-name {
  font-family: var(--serif);
  font-size: 1.15rem; font-weight: 500;
}
.memorial-meta { font-size: 0.82rem; color: var(--ink-mute); margin-top: 0.1rem; }
.memorial-stats {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.8rem; color: var(--ink-mute);
}
.pending-badge { color: var(--clay); }
.memorial-actions { display: flex; gap: 0.5rem; flex: none; }
.badge-draft {
  display: inline-block;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .memorial-list-item { flex-wrap: wrap; }
  .memorial-actions { width: 100%; }
  .memorial-actions .btn-ghost-sm { flex: 1; }
  .profile-name { display: none; }
  .notif-actions { flex-wrap: wrap; }
}

/* ── Öffentliche Gedenkseite ─────────────────────────────────────────── */
.memorial-hero { position: relative; z-index: 1; }
.memorial-hero-media {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.memorial-hero-body {
  position: relative; z-index: 1;
  padding: 5rem 1.5rem 3.5rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.memorial-hero-text { display: flex; flex-direction: column; align-items: inherit; }
.memorial-avatar {
  width: 128px; height: 128px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper);
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
  margin-bottom: 1.25rem;
}
.memorial-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-sunken);
  color: var(--ink-faint);
  font-family: var(--serif); font-size: 2.5rem;
}
.memorial-avatar-ph svg { width: 42%; height: 42%; }
.memorial-name-hero {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.memorial-dates-hero {
  font-size: 0.95rem; letter-spacing: 0.08em;
  margin-top: 0.5rem;
}
.memorial-location-hero {
  font-size: 0.85rem;
  margin-top: 0.6rem;
}
.memorial-cover-fade { display: none; }

.memorial-shell {
  max-width: 680px;
  padding-top: 3rem;
  padding-bottom: 4rem;
}
.memorial-section { margin-bottom: 2.75rem; }
.memorial-section.panel { padding: 1.75rem 1.9rem; }
.memorial-story {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--ink-soft);
}
.guestbook-form-panel { padding: 1.5rem 1.6rem; }

.guestbook-entries { display: flex; flex-direction: column; gap: 1.25rem; }
.guestbook-entry { display: flex; gap: 0.9rem; }
.entry-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 0.9rem;
  flex: none;
}
.entry-bubble {
  flex: 1; min-width: 0;
  padding: 0.9rem 1.15rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.entry-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.35rem;
}
.entry-name { font-weight: 600; font-size: 0.92rem; }
.entry-time { font-size: 0.76rem; color: var(--ink-faint); flex: none; }
.entry-text {
  font-family: var(--serif);
  font-size: 1rem; line-height: 1.7; color: var(--ink-soft);
}

/* ── QR-Seite ────────────────────────────────────────────────────────── */
.qr-shell { padding-top: 2.5rem; padding-bottom: 4rem; }
.qr-hero {
  display: flex; gap: 3rem; align-items: center;
  padding: 2rem 2.25rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.qr-hero-left {
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.qr-frame-wrap {
  position: relative;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}
.qr-frame-corners { display: none; }
.qr-hero-img { width: 190px; height: 190px; display: block; }
.qr-scan-badge {
  display: flex; align-items: baseline; gap: 0.35rem;
  font-size: 0.82rem; color: var(--ink-mute);
}
.qr-scan-count { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.qr-scan-label { letter-spacing: 0.04em; }

.qr-hero-right { flex: 1; min-width: 270px; }
.qr-hero-name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 400;
  margin: 0.4rem 0 0.2rem;
}
.qr-hero-dates { color: var(--ink-mute); font-size: 0.88rem; margin-bottom: 1.1rem; }
.qr-link-box {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.55rem 0.55rem 0.85rem;
  background: var(--paper-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.qr-link-text {
  flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-copy-btn {
  flex: none;
  width: 30px; height: 30px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.qr-copy-btn svg { width: 16px; height: 16px; }
.qr-copy-btn:hover { border-color: var(--ivy); color: var(--ivy); }
.qr-copy-btn.is-copied {
  width: auto; padding: 0 0.6rem;
  font-size: 0.75rem; color: var(--ivy); border-color: var(--ivy);
}
.qr-hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.qr-hero-hint {
  margin-top: 1.1rem;
  font-size: 0.83rem; color: var(--ink-mute); line-height: 1.6;
}

.template-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.tpl-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.tpl-card:hover, .tpl-card.tpl-selected { border-color: var(--ivy); }
.tpl-preview-wrap {
  padding: 1.1rem;
  background: var(--paper-sunken);
  display: flex; align-items: center; justify-content: center;
  min-height: 170px;
}
.tpl-preview {
  display: flex; flex-direction: column; align-items: center;
  width: 118px; min-height: 148px;
  padding: 0.6rem;
  text-align: center;
}
.tpl-klassisch { background: #fdfaf2; border: 1px solid #d9d0b8; }
.tpl-wuerde    { background: #1b1a16; border: 1px solid #4a463d; }
.tpl-karte     { background: #fdfaf2; border: 1px solid #d9d0b8; width: 168px; min-height: 96px; flex-direction: row; }
.tpl-schild    { background: linear-gradient(160deg,#ded9cc,#c9c2b0); border: 1px solid #b3ab97; }
.tpl-prev-ornament { font-size: 8px; color: var(--ivy); margin-bottom: 3px; letter-spacing: 0.1em; }
.tpl-prev-name { font-family: var(--serif); font-size: 12px; font-weight: 500; color: #1b1a16; line-height: 1.2; margin-bottom: 2px; }
.tpl-prev-dates { font-size: 7px; color: #6b665c; margin-bottom: 5px; }
.tpl-prev-qr-box { margin: 5px 0; }
.tpl-prev-qr-img { width: 52px; height: 52px; display: block; }
.tpl-prev-url { font-size: 6px; color: #7d776c; margin-top: 4px; word-break: break-all; }
.tpl-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--rule);
}
.tpl-card-name { font-size: 0.76rem; color: var(--ink-mute); }

.qr-tips-panel { padding: 1.6rem 1.75rem; }
.qr-tips-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem;
}
.qr-tip { display: flex; gap: 0.75rem; }
.qr-tip-icon { flex: none; color: var(--ivy); margin-top: 0.15rem; }
.qr-tip-icon svg { width: 20px; height: 20px; }
.qr-tip-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.15rem; }
.qr-tip-desc  { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.55; }

@media (max-width: 760px) {
  .template-grid { grid-template-columns: 1fr 1fr; }
  .qr-tips-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .template-grid { grid-template-columns: 1fr; }
  .qr-hero { padding: 1.5rem; gap: 1.75rem; }
}

/* ── QR-Gestaltung und Shop ─────────────────────────────────────────── */
.qr-shop-section { margin-top: 3.5rem; }
.shop-price { color: var(--ivy); font-weight: 600; font-size: 0.9rem; }
.design-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.design-card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  padding: 0.65rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.design-card:hover { transform: translateY(-2px); border-color: var(--ivy); }
.design-card:has(input:checked), .design-card.is-selected {
  border-color: var(--ivy);
  box-shadow: 0 0 0 2px rgba(47,74,59,.14);
}
.design-card input { position: absolute; opacity: 0; pointer-events: none; }
.design-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 4px);
  background: #eee;
}
.design-card span {
  display: block;
  padding: .7rem .2rem .15rem;
  font-size: .82rem;
  color: var(--ink-soft);
  text-align: center;
}
.shop-options, .checkout-form { margin-top: 1rem; padding: 1.5rem; }
.size-options { display: flex; flex-wrap: wrap; gap: .6rem; }
.size-options label { cursor: pointer; }
.size-options input { position: absolute; opacity: 0; }
.size-options span {
  display: block;
  border: 1px solid var(--rule-strong);
  padding: .55rem .85rem;
  border-radius: var(--radius);
}
.size-options input:checked + span {
  border-color: var(--ivy);
  background: var(--ivy-pale);
  color: var(--ivy);
}
.subscription-card {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
}
.subscription-card > div:first-child strong { font-family: var(--serif); font-size: 1.3rem; }
.subscription-card p { color: var(--ink-soft); margin-top: .35rem; max-width: 55ch; line-height: 1.55; }
.subscription-price { text-align: right; flex: none; }
.subscription-price strong { display: block; font-family: var(--serif); font-size: 2rem; }
.subscription-price span, .checkout-hint { color: var(--ink-mute); font-size: .78rem; }
.checkout-hint { margin: .7rem 0 0; text-align: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Kundenkonto und Verwaltung ─────────────────────────────────────── */
.konto-card { padding: 1.4rem 1.5rem; }
.konto-email { color: var(--ink-mute); margin: 0 0 .75rem; }
.konto-page { margin: 0; }
.konto-page a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.konto-actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
.customer-order {
  padding: 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 1rem;
  align-items: center;
}
.customer-order > div { display: flex; flex-direction: column; gap: .2rem; }
.customer-order span { color: var(--ink-mute); font-size: .82rem; }
.order-status {
  display: inline-block;
  width: fit-content;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: .18rem .5rem;
  font-size: .7rem !important;
  letter-spacing: .04em;
}
.order-status.is-inactive { color: #a33; border-color: #d8a0a0; }
.admin-shell { padding-top: 2.5rem; padding-bottom: 5rem; }
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.admin-kpis .panel { padding: 1.25rem; }
.admin-kpis strong { display: block; font-family: var(--serif); font-size: 2rem; }
.admin-kpis span { color: var(--ink-mute); font-size: .8rem; }
.admin-order-detail, .admin-table-panel { padding: 1.5rem; margin-top: 1rem; }
.admin-table-wrap { overflow-x: auto; margin-top: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.admin-table th, .admin-table td {
  padding: .75rem .65rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.admin-table th { color: var(--ink-mute); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-table td small { display: block; color: var(--ink-mute); margin-top: .2rem; }

@media (max-width: 760px) {
  .design-grid { grid-template-columns: 1fr 1fr; }
  .subscription-card { align-items: flex-start; }
  .customer-order { grid-template-columns: 1fr; }
  .admin-kpis { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .design-grid { grid-template-columns: 1fr; }
  .subscription-card { flex-direction: column; }
  .subscription-price { text-align: left; }
}

/* ── Admin-Backoffice / ERP ──────────────────────────────────────────── */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.admin-login-card { width: min(420px, 100%); padding: 2rem; display: grid; gap: .85rem; }
.admin-login-card h1 { font-family: var(--serif); font-weight: 500; margin: 0 0 .5rem; }
.admin-back-link, .auth-help-link { display: inline-block; margin-top: .8rem; color: var(--ivy); font-size: .84rem; }
.erp-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); background: var(--paper); }
.erp-sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.4rem 1rem;
  background: #24372d; color: #fff; display: flex; flex-direction: column; z-index: 30;
}
.erp-brand { color: #fff; font-family: var(--serif); font-size: 1.15rem; padding: .5rem .65rem 1.4rem; }
.erp-brand small { display: block; margin-top: .2rem; color: rgba(255,255,255,.58); font-family: var(--sans); font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; }
.erp-sidebar nav { display: grid; gap: .2rem; }
.admin-nav-link {
  display: block; width: 100%; padding: .68rem .75rem; border: 0; border-radius: 6px;
  color: rgba(255,255,255,.76); background: transparent; text-align: left; font: inherit; font-size: .86rem; cursor: pointer;
}
.admin-nav-link:hover, .admin-nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.erp-sidebar form { margin-top: auto; }
.admin-logout { color: rgba(255,255,255,.62); }
.erp-main { min-width: 0; }
.erp-topbar {
  min-height: 64px; border-bottom: 1px solid var(--rule); background: var(--paper-raised);
  display: flex; align-items: center; justify-content: flex-end; padding: .8rem 2rem;
}
.erp-topbar div { display: grid; text-align: right; gap: .1rem; }
.erp-topbar span { color: var(--ink-mute); font-size: .74rem; }
.erp-menu { display: none; }
.erp-content { max-width: 1220px; margin: 0 auto; padding: 2rem; }
.erp-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.erp-kpis a { color: inherit; }
.erp-grid-form { display: grid; gap: 1rem; }
.erp-two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; }
.erp-form-actions, .erp-search, .inline-form { display: flex; align-items: center; gap: .65rem; }
.erp-search { max-width: 560px; margin-bottom: 1rem; }
.erp-search .input { margin: 0; }
.admin-order-detail .input { margin-bottom: .75rem; }
.admin-order-detail summary { font-family: var(--serif); font-size: 1.15rem; cursor: pointer; margin-bottom: 1rem; }
.input-small { display: inline-block; width: 90px; margin: 0 .5rem; }
.draft-banner { border: 2px solid #a33; color: #a33; padding: .7rem; text-align: center; font-weight: 600; margin: 1rem 0; }
.invoice-total { text-align: right; font-size: 1.2rem; font-weight: 600; }
.auth-standalone { padding-top: 4rem; padding-bottom: 5rem; }
.alert-success { border-color: #7c9b86; background: #edf4ef; color: #274c35; }

@media (max-width: 1050px) {
  .erp-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .erp-shell { grid-template-columns: 1fr; }
  .erp-sidebar { position: fixed; left: 0; width: 230px; transform: translateX(-100%); transition: transform .2s; }
  .erp-menu-open .erp-sidebar { transform: translateX(0); }
  .erp-topbar { justify-content: space-between; padding: .75rem 1rem; }
  .erp-menu { display: inline-flex; border: 1px solid var(--rule); background: transparent; border-radius: 5px; padding: .45rem .7rem; }
  .erp-content { padding: 1rem; }
  .erp-two-col { grid-template-columns: 1fr; }
  .erp-kpis { grid-template-columns: 1fr 1fr; }
  .erp-form-actions, .erp-search { align-items: stretch; flex-direction: column; }
}

/* ── Fußzeile ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-size: 0.83rem; color: var(--ink-mute);
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a:hover { color: var(--ink); }

/* ── Ornament (Altbestand, jetzt schlichte Linie) ────────────────────── */
.ornament { display: flex; align-items: center; gap: 1rem; }
.ornament-line { flex: 1; height: 1px; background: var(--rule); }
.ornament-icon { color: var(--ink-faint); font-size: 0.7rem; }

/* ── Druck ───────────────────────────────────────────────────────────── */
.print-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: #fff;
  align-items: center; justify-content: center;
  overflow: auto;
}
.print-overlay.active { display: flex; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .qr-shell, .auth-modal { display: none !important; }
  body.printing .print-overlay { display: block !important; position: static !important; background: transparent; }
  @page { margin: 12mm; }

  .ptpl { page-break-after: always; }
  .ptpl-klassisch {
    width: 100%; min-height: 250mm;
    display: flex; align-items: center; justify-content: center;
    background: #fdfaf2;
  }
  .ptpl-border-outer { border: 2pt solid #7d776c; padding: 6pt; width: 150mm; }
  .ptpl-border-inner {
    border: 0.75pt solid #a49d90; padding: 16pt 14pt;
    display: flex; flex-direction: column; align-items: center;
  }
  .ptpl-wuerde {
    width: 100%; min-height: 250mm;
    display: flex; align-items: center; justify-content: center;
    background: #1b1a16;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ptpl-wuerde-inner {
    border: 1pt solid rgba(253,252,249,0.35);
    padding: 20pt 18pt; width: 150mm;
    display: flex; flex-direction: column; align-items: center;
  }
  .ptpl-karte-page {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6mm;
    width: 100%;
  }
  .ptpl-karte {
    border: 0.5pt dashed #a49d90;
    padding: 4mm; height: 55mm;
    display: flex; align-items: center;
  }
  .ptpl-karte-inner { display: flex; gap: 4mm; align-items: center; width: 100%; }
  .ptpl-karte-left { flex: 1; min-width: 0; }
  .ptpl-karte-badge { font-size: 7pt; color: #2f4a3b; letter-spacing: 0.1em; margin-bottom: 2pt; }
  .ptpl-karte-name  { font-size: 13pt; font-weight: 600; color: #1b1a16; line-height: 1.15; margin-bottom: 2pt; }
  .ptpl-karte-dates { font-size: 8pt;  color: #4c4840; margin-bottom: 2pt; }
  .ptpl-karte-loc   { font-size: 7pt;  color: #7d776c; margin-bottom: 3pt; }
  .ptpl-karte-url   { font-size: 6.5pt; color: #7d776c; font-family: monospace; word-break: break-all; }
  .ptpl-karte-right { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2pt; }
  .ptpl-karte-qr    { width: 28mm; height: 28mm; display: block; }
  .ptpl-karte-scan  { font-size: 6pt; color: #7d776c; text-align: center; letter-spacing: 0.05em; }

  .ptpl-schild {
    width: 100%; min-height: 250mm;
    display: flex; align-items: center; justify-content: center;
  }
  .ptpl-schild-inner {
    border: 2pt solid #7d776c; padding: 18pt 16pt; width: 130mm;
    display: flex; flex-direction: column; align-items: center;
    background: #ece8dd;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ptpl-schild-kicker { font-size: 8pt; letter-spacing: 0.22em; color: #4c4840; margin-bottom: 6pt; }
  .ptpl-schild-rule-thin { width: 40pt; height: 0.5pt; background: #7d776c; margin-bottom: 8pt; }
  .ptpl-schild-name  { font-size: 24pt; font-weight: 600; color: #1b1a16; line-height: 1.15; margin-bottom: 4pt; text-align: center; }
  .ptpl-schild-dates { font-size: 11pt; color: #4c4840; margin-bottom: 4pt; }
  .ptpl-schild-loc   { font-size: 9pt;  color: #7d776c; margin-bottom: 6pt; }
  .ptpl-schild-ornament { display: flex; align-items: center; gap: 6pt; width: 60%; margin: 4pt 0 8pt; color: #7d776c; }
  .ptpl-schild-rule { flex: 1; height: 1pt; background: #a49d90; }

  .ptpl-top-ornament, .ptpl-bottom-ornament {
    display: flex; align-items: center; gap: 8pt; width: 70%;
    margin: 6pt 0; color: #7d776c;
  }
  .ptpl-rule { flex: 1; height: 0.5pt; background: currentColor; }
  .ptpl-name  { font-size: 22pt; font-weight: 600; color: #1b1a16; margin: 5pt 0 2pt; text-align: center; line-height: 1.2; }
  .ptpl-dates { font-size: 10pt; color: #4c4840; margin-bottom: 4pt; text-align: center; }
  .ptpl-loc   { font-size: 8pt;  color: #7d776c; margin-bottom: 4pt; text-align: center; }
  .ptpl-qr-wrap { margin: 5pt 0; text-align: center; }
  .ptpl-qr    { width: 70mm; height: 70mm; display: block; margin: 0 auto; }
  .ptpl-scan-hint { font-size: 7pt; color: #7d776c; margin: 3pt 0 0; text-align: center; }
  .ptpl-url   { font-size: 7pt; color: #7d776c; font-family: monospace; text-align: center; margin-top: 4pt; }
}

/* ── Gestaltbare Gedenkseite ─────────────────────────────────────────── */
.memorial-page {
  --mem-radius: 14px;
  --mem-gap: 2.75rem;
  --mem-pad: 1.75rem 1.9rem;
  --mem-hero-pad: 5rem 1.5rem 3.5rem;
  position: relative;
  isolation: isolate;
  min-height: 60vh;
  background: var(--mem-bg, var(--paper));
  color: var(--mem-ink, var(--ink));
}
.memorial-page .memorial-story,
.memorial-page .mem-section-title,
.memorial-page .memorial-name-hero,
.memorial-page .memorial-kicker-hero,
.memorial-page .entry-text {
  font-family: var(--mem-serif, var(--serif));
}
.memorial-page .mem-section-title { color: var(--mem-ink, var(--ink)); }
.memorial-page .memorial-story,
.memorial-page .entry-text { color: var(--mem-soft, var(--ink-soft)); }
.memorial-page .memorial-empty-hint,
.memorial-page .entry-time,
.memorial-page .notif-meta { color: var(--mem-muted, var(--ink-mute)); }
.memorial-page .entry-name { color: var(--mem-ink); }
.memorial-page .mem-section-title::after { background: var(--mem-accent); }
.memorial-page .btn-gold { background: var(--mem-accent); border-color: var(--mem-accent); }
.memorial-page .input {
  background: var(--mem-panel);
  border-color: var(--mem-rule);
  color: var(--mem-ink);
}
.memorial-page .input::placeholder { color: var(--mem-muted); }

/* Flächen: Papier, Milchglas oder nur Linien */
.memorial-page .panel,
.memorial-page .entry-bubble {
  border-radius: var(--mem-radius);
  border: 1px solid var(--mem-rule);
  background: var(--mem-panel);
  color: var(--mem-ink);
}
.panels-glass .panel,
.panels-glass .entry-bubble {
  background: color-mix(in srgb, var(--mem-panel) 58%, transparent);
  border-color: color-mix(in srgb, var(--mem-ink) 14%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}
.panels-outline .panel,
.panels-outline .entry-bubble {
  background: transparent;
  border-color: color-mix(in srgb, var(--mem-ink) 22%, transparent);
}
.radius-sharp { --mem-radius: 0px; }
.radius-soft  { --mem-radius: 14px; }
.radius-round { --mem-radius: 26px; }
.density-airy    { --mem-gap: 3.75rem; --mem-pad: 2.4rem 2.6rem; --mem-hero-pad: 6.5rem 1.5rem 4.5rem; }
.density-normal  { --mem-gap: 2.75rem; --mem-pad: 1.75rem 1.9rem; --mem-hero-pad: 5rem 1.5rem 3.5rem; }
.density-compact { --mem-gap: 1.6rem;  --mem-pad: 1.2rem 1.3rem;  --mem-hero-pad: 3.25rem 1.5rem 2.25rem; }
.memorial-page .memorial-section { margin-bottom: var(--mem-gap); }
.memorial-page .memorial-section.panel,
.memorial-page .guestbook-form-panel { padding: var(--mem-pad); }
.memorial-page .memorial-hero-body { padding: var(--mem-hero-pad); }
.memorial-page .memorial-shell { position: relative; z-index: 1; }

/* Hintergrundbild: eigene Ebene, damit Abdunkeln und Unschärfe die Schrift nicht treffen */
.memorial-bg { display: none; }
.has-bg .memorial-bg {
  display: block;
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.has-bg.bg-fixed .memorial-bg { position: fixed; }
.memorial-bg-layer {
  position: absolute;
  inset: calc(-2px - var(--mem-bg-blur, 0px) * 2.5);
  background-position: var(--mem-bg-pos, center);
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(var(--mem-bg-blur, 0px));
}
.bgfit-contain .memorial-bg-layer { background-size: contain; }
.bgfit-tile .memorial-bg-layer {
  background-size: min(520px, 45vw) auto;
  background-repeat: repeat;
}
.memorial-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--mem-bg);
  opacity: var(--mem-bg-dim, 0.4);
}
.has-vignette .memorial-bg::before {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  box-shadow: inset 0 0 22vw 6vw color-mix(in srgb, var(--mem-ink) 45%, transparent);
}

/* Kopfbereich in drei Charakteren */
.hero-cover .memorial-hero-media {
  position: absolute; inset: 0; z-index: 0;
}
.hero-cover .memorial-hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.12) 0%, var(--mem-overlay, rgba(27,26,22,0.72)) 100%);
}
.hero-cover .memorial-hero-body {
  min-height: clamp(340px, 50vh, 620px);
  justify-content: flex-end;
}
.hero-cover .memorial-name-hero { color: #fdfcf9; }
.hero-cover .memorial-dates-hero { color: rgba(253,252,249,0.80); }
.hero-cover .memorial-location-hero { color: rgba(253,252,249,0.66); }
.hero-cover .memorial-kicker-hero { color: rgba(253,252,249,0.82); }

.hero-split .memorial-hero-media { display: none; }
.hero-split .memorial-hero-body {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(150px, 260px) 1fr;
  gap: 2.5rem; align-items: center; text-align: left;
}
.hero-split .memorial-hero-text { align-items: flex-start; }
.hero-split .memorial-avatar {
  width: 100%; height: auto; aspect-ratio: 3 / 4;
  border-radius: var(--mem-radius);
  border-width: 1px; border-color: var(--mem-rule);
  margin-bottom: 0;
}
.hero-split .memorial-name-hero,
.hero-minimal .memorial-name-hero { color: var(--mem-ink); }
.hero-split .memorial-dates-hero,
.hero-minimal .memorial-dates-hero { color: var(--mem-soft); }
.hero-split .memorial-location-hero,
.hero-minimal .memorial-location-hero { color: var(--mem-muted); }
.hero-split .memorial-kicker-hero,
.hero-minimal .memorial-kicker-hero { color: var(--mem-soft); }

.hero-minimal .memorial-hero-media { display: none; }
.hero-minimal .memorial-avatar {
  width: 104px; height: 104px;
  border-color: var(--mem-rule);
  box-shadow: none;
}

.memorial-ornament {
  display: none; align-items: center; gap: 0.7rem;
  margin: 0.9rem 0 0.1rem;
  color: var(--mem-accent);
}
.memorial-ornament span { width: 40px; height: 1px; background: currentColor; opacity: 0.5; }
.memorial-ornament svg { width: 16px; height: 16px; }
.hero-minimal .memorial-ornament, .hero-split .memorial-ornament { display: flex; }

.memorial-kicker-hero {
  max-width: 36rem;
  margin-top: 0.85rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.memorial-empty-hint { font-size: 0.88rem; margin-top: 0.6rem; color: var(--mem-muted, var(--ink-mute)); }
.memorial-page .memorial-avatar { border-color: var(--mem-panel); }
.memorial-page .memorial-avatar-ph {
  background: color-mix(in srgb, var(--mem-panel) 82%, var(--mem-ink));
  color: var(--mem-muted);
}

/* Galerie in drei Rastern */
.mem-gallery { display: grid; gap: 0.55rem; }
.gallery-grid   .mem-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gallery-rows   .mem-gallery { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gallery-mosaic .mem-gallery {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  grid-auto-rows: 110px;
  grid-auto-flow: dense;
}
.gallery-mosaic .mem-gallery-item { aspect-ratio: auto; height: 100%; }
.gallery-mosaic .mem-gallery-item:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
.gallery-rows .mem-gallery-item { aspect-ratio: 4 / 3; }
.mem-gallery-item {
  position: relative;
  display: block; width: 100%; padding: 0; border: 0;
  background: var(--mem-panel); border-radius: var(--mem-radius, var(--radius));
  overflow: hidden; cursor: zoom-in; aspect-ratio: 1;
}
.mem-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.mem-gallery-item:hover img { transform: scale(1.04); }
.mem-gallery-item.is-inline { aspect-ratio: auto; max-width: 280px; }
.mem-gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.6rem 0.45rem;
  font-size: 0.72rem; line-height: 1.3; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  opacity: 0; transition: opacity 0.2s ease;
}
.mem-gallery-item:hover .mem-gallery-cap,
.mem-gallery-item:focus-visible .mem-gallery-cap { opacity: 1; }
.mem-photo-clear {
  position: absolute; top: 4px; right: 4px;
  background: #c00; color: #fff; border: none;
  border-radius: 50%; width: 26px; height: 26px; cursor: pointer;
}
.mem-lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,10,12,0.90);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
}
.mem-lightbox[hidden] { display: none; }
.mem-lightbox img { max-width: min(92vw, 1100px); max-height: 82vh; object-fit: contain; }
.mem-lightbox p { color: #f5f3ee; margin-top: 0.75rem; }
.mem-lightbox .owner-close { position: absolute; top: 1rem; right: 1rem; color: #f5f3ee; }

/* ── Werkzeugleiste unten (Word-Prinzip) ─────────────────────────────── */
body.has-ribbon { padding-bottom: var(--ribbon-h, 3.5rem); }

/* ── Bearbeiten-Knopf: der Weg in den und aus dem Gestaltungsmodus ───── */
.edit-fab {
  position: fixed; z-index: 69;
  right: 1.1rem;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(20,20,22,0.93);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  color: #ece8df;
  font-size: 0.86rem; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,0.28);
  transition: background-color 0.15s, transform 0.15s;
}
.edit-fab:hover { background: rgba(32,32,35,0.96); transform: translateY(-1px); }
.edit-fab svg { width: 16px; height: 16px; }
.edit-fab[hidden] { display: none; }

.ribbon-done {
  padding: 0 0.85rem; height: 32px;
  border: 0; border-radius: 9px;
  background: var(--ribbon-hi, #96bda6);
  color: var(--ribbon-hi-ink, #12201a);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.ribbon-done:hover { filter: brightness(1.08); }

@media (max-width: 560px) {
  .edit-fab span { display: none; }
  .edit-fab { padding: 0.7rem; }
}

.mem-ribbon[hidden] { display: none; }
.mem-ribbon {
  --ribbon-hi: #96bda6;
  --ribbon-hi-ink: #12201a;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; flex-direction: column;
  font-family: var(--sans, system-ui, sans-serif);
  color: #ece8df;
  pointer-events: none;
}
.mem-ribbon > * { pointer-events: auto; }
.ribbon-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.35rem 0.7rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: rgba(20,20,22,0.93);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-top: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 -8px 28px rgba(0,0,0,0.25);
}
.ribbon-tabs {
  display: flex; gap: 0.15rem; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.ribbon-tabs::-webkit-scrollbar { display: none; }
.ribbon-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border: 0; background: transparent;
  color: rgba(236,232,223,0.70);
  font-size: 0.82rem; font-weight: 500;
  border-radius: 9px 9px 0 0;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.ribbon-tab svg { width: 16px; height: 16px; }
.ribbon-tab:hover { background: rgba(255,255,255,0.07); color: #fff; }
.ribbon-tab.is-on {
  background: rgba(255,255,255,0.12); color: #fff;
  box-shadow: inset 0 -2px 0 var(--ribbon-hi);
}
.ribbon-tools { display: flex; align-items: center; gap: 0.45rem; }
.ribbon-device { display: flex; gap: 2px; padding: 2px; background: rgba(255,255,255,0.07); border-radius: 9px; }
.ribbon-device button {
  display: grid; place-items: center;
  width: 30px; height: 28px;
  border: 0; background: transparent; border-radius: 7px;
  color: rgba(236,232,223,0.6); cursor: pointer;
}
.ribbon-device button.is-on { background: rgba(255,255,255,0.16); color: #fff; }
.ribbon-device svg { width: 15px; height: 15px; }
.ribbon-save {
  font-size: 0.72rem; min-width: 8.5em; text-align: right;
  color: rgba(236,232,223,0.45);
  transition: color 0.2s ease;
}
.ribbon-save[data-state="saving"] { color: var(--ribbon-hi); }
.ribbon-save[data-state="saved"]  { color: #8fc79b; }
.ribbon-save[data-state="error"]  { color: #e69494; }
.ribbon-icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  border-radius: 9px; cursor: pointer;
  color: rgba(236,232,223,0.85); text-decoration: none;
}
.ribbon-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.ribbon-icon-btn:disabled { opacity: 0.32; cursor: default; }
.ribbon-icon-btn svg { width: 15px; height: 15px; }
#ribbonUndo svg { transform: rotate(180deg); }

.ribbon-panels {
  display: none;
  max-height: min(48vh, 400px);
  overflow: auto; overscroll-behavior: contain;
  background: rgba(26,26,28,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.mem-ribbon.is-open .ribbon-panels { display: block; }
.ribbon-panel { display: flex; align-items: stretch; padding: 0.85rem 0.9rem; }
.ribbon-panel[hidden] { display: none; }
.ribbon-group {
  display: flex; flex-direction: column; min-width: 0;
  padding: 0 0.95rem;
  border-right: 1px solid rgba(255,255,255,0.09);
}
.ribbon-group:last-child { border-right: 0; }
.ribbon-group.is-wide { flex: 1; }
.ribbon-group-body {
  flex: 1;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: flex-start; align-content: flex-start;
}
.ribbon-group-body.ribbon-stack { flex-direction: column; flex-wrap: nowrap; }
.ribbon-group-label {
  margin-top: 0.55rem; padding-top: 0.35rem;
  font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(236,232,223,0.42); text-align: center;
}
.ribbon-hint {
  flex: 1 0 100%;
  margin: 0.45rem 0 0; max-width: 34ch;
  font-size: 0.7rem; line-height: 1.5; color: rgba(236,232,223,0.42);
}
.ribbon-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ribbon-chip {
  padding: 0.36rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: rgba(236,232,223,0.82);
  border-radius: 999px; font-size: 0.78rem; cursor: pointer;
  white-space: nowrap;
}
.ribbon-chip:hover { background: rgba(255,255,255,0.11); color: #fff; }
.ribbon-chip.is-on {
  background: var(--ribbon-hi); border-color: transparent;
  color: var(--ribbon-hi-ink); font-weight: 600;
}
.ribbon-slider {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.75rem; color: rgba(236,232,223,0.72);
}
.ribbon-slider span { min-width: 7.5em; }
.ribbon-slider input[type="range"] { width: 130px; accent-color: var(--ribbon-hi); }
.ribbon-slider output { min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }

.theme-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; max-width: 300px; }
.theme-swatch {
  display: flex; flex-direction: column; gap: 0.3rem;
  width: 66px; padding: 0.3rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(236,232,223,0.78);
  border-radius: 10px; font-size: 0.67rem; cursor: pointer;
}
.theme-swatch-preview {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  height: 30px; padding: 0 5px;
  border-radius: 6px;
  background: var(--swatch, #fff);
  border: 1px solid var(--swatch-rule, rgba(0,0,0,0.12));
}
.theme-swatch-preview i { display: block; height: 3px; border-radius: 2px; background: var(--swatch-ink, #111); opacity: 0.7; }
.theme-swatch-preview i:last-child { width: 58%; opacity: 0.4; }
.theme-swatch.is-on { border-color: var(--ribbon-hi); box-shadow: 0 0 0 1px var(--ribbon-hi); color: #fff; }

.accent-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; max-width: 220px; }
.accent-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18); cursor: pointer;
}
.accent-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--ribbon-hi); }
.accent-custom {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.22rem 0.5rem 0.22rem 0.25rem;
  border: 1px solid rgba(255,255,255,0.16); border-radius: 999px;
  font-size: 0.72rem; color: rgba(236,232,223,0.8); cursor: pointer;
}
.accent-custom.is-on { border-color: var(--ribbon-hi); color: #fff; }
.accent-custom input[type="color"] {
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.font-picks { display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 240px; }
.font-pick {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: rgba(236,232,223,0.85);
  border-radius: 9px; cursor: pointer; font-size: 0.85rem;
}
.font-pick.is-on { border-color: var(--ribbon-hi); color: #fff; background: rgba(150,189,166,0.16); }

.bg-dropzone {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 0.35rem 0.7rem;
  align-items: center;
  min-width: 320px; padding: 0.55rem;
  border: 1px dashed rgba(255,255,255,0.24);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bg-dropzone.is-drag { border-color: var(--ribbon-hi); background: rgba(150,189,166,0.12); }
.bg-thumb {
  grid-row: span 2;
  width: 78px; height: 54px; border-radius: 8px;
  background: rgba(255,255,255,0.07) center/cover no-repeat;
}
.bg-dropzone-text strong { display: block; font-size: 0.8rem; color: #f3efe6; font-weight: 600; }
.bg-dropzone-text span { font-size: 0.7rem; color: rgba(236,232,223,0.45); }
.bg-dropzone-acts { display: flex; gap: 0.35rem; grid-column: 2; }
.ribbon-panel .btn-ghost-sm {
  border-color: rgba(255,255,255,0.18);
  color: rgba(236,232,223,0.85);
  background: rgba(255,255,255,0.04);
}
.ribbon-panel .btn-ghost-sm:hover { background: rgba(255,255,255,0.12); color: #fff; }
.ribbon-panel .btn-ghost-sm.is-danger { color: #e69494; }
.ribbon-panel .input,
.ribbon-panel .textarea {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
  color: #f3efe6;
}
.ribbon-panel .input::placeholder { color: rgba(236,232,223,0.4); }
.ribbon-panel .form-label,
.ribbon-panel .toggle-label { color: rgba(236,232,223,0.72); font-size: 0.75rem; }
.ribbon-panel .memorial-empty-hint { color: rgba(236,232,223,0.5); }

.section-order { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; min-width: 210px; }
.section-order li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 8px;
  font-size: 0.78rem;
}
.section-order-btns { display: flex; gap: 0.2rem; }
.section-order-btns button {
  width: 26px; height: 26px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: rgba(236,232,223,0.85);
  border-radius: 6px; cursor: pointer;
}
.section-order-btns button:hover { background: rgba(255,255,255,0.14); }

.owner-gallery { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.owner-gallery-card {
  width: 108px;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 9px;
  overflow: hidden; background: rgba(255,255,255,0.04);
}
.owner-gallery-card img { width: 100%; height: 70px; object-fit: cover; display: block; }
.owner-gallery-move, .owner-gallery-card form { display: flex; gap: 0.2rem; padding: 0.22rem; }
.owner-gallery-move button, .owner-del {
  flex: 1; font-size: 0.7rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: rgba(236,232,223,0.85);
  border-radius: 5px; cursor: pointer; padding: 0.2rem;
}
.owner-del { color: #e69494; }
.owner-upload { flex-direction: column; gap: 0.4rem; min-width: 230px; }
.owner-upload .input { font-size: 0.78rem; padding: 0.4rem 0.5rem; }

.meta-form { flex-direction: column; gap: 0.6rem; }
.meta-grid {
  display: grid; gap: 0.6rem 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100%;
}
.meta-grid .form-group.is-span { grid-column: 1 / -1; }

.inbox-card {
  padding: 0.7rem 0.85rem; margin-bottom: 0.5rem;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  background: rgba(255,255,255,0.03);
  max-width: 520px;
}
.inbox-who { display: flex; gap: 0.7rem; align-items: center; }
.inbox-msg { font-family: var(--serif); margin: 0.55rem 0; color: rgba(236,232,223,0.85); font-size: 0.88rem; }
.inbox-photo { max-height: 140px; border-radius: 8px; margin-bottom: 0.5rem; }
.inbox-actions { display: flex; gap: 0.45rem; }
.owner-bar-badge {
  position: absolute; top: 1px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--clay, #8c4b32); color: #fff;
  font-size: 0.65rem; font-style: normal; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.owner-close {
  width: 36px; height: 36px; border: 0; background: transparent;
  font-size: 1.4rem; cursor: pointer; border-radius: 50%;
}

/* Gerätevorschau direkt in der Seite */
.memorial-page.is-device-mobile {
  max-width: 420px; margin: 0 auto;
  overflow: hidden;
  border-left: 1px solid var(--mem-rule);
  border-right: 1px solid var(--mem-rule);
  box-shadow: 0 0 70px rgba(0,0,0,0.35);
}
.memorial-page.is-device-mobile .memorial-bg { position: absolute; }
.memorial-page.is-device-mobile .memorial-shell { max-width: 100%; padding-left: 1.1rem; padding-right: 1.1rem; }
.memorial-page.is-device-mobile .memorial-hero-body { padding: 3.25rem 1.1rem 2.25rem; }
.memorial-page.is-device-mobile.hero-cover .memorial-hero-body { min-height: 380px; }
.memorial-page.is-device-mobile.hero-split .memorial-hero-body {
  grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 1.5rem;
}
.memorial-page.is-device-mobile.hero-split .memorial-hero-text { align-items: center; }
.memorial-page.is-device-mobile.hero-split .memorial-avatar { max-width: 190px; }
.memorial-page.is-device-mobile .memorial-name-hero { font-size: 1.85rem; }
.memorial-page.is-device-mobile .mem-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.memorial-page.is-device-mobile.gallery-mosaic .mem-gallery { grid-auto-rows: 88px; }

.memorial-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.memorial-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.memorial-card-cover {
  display: block; height: 140px;
  background: linear-gradient(160deg,#1c1206,#3a3228) center/cover no-repeat;
}
.memorial-card-body { padding: 1rem 1.1rem 1.15rem; }
.memorial-card .memorial-actions { margin-top: 0.9rem; flex-wrap: wrap; }
.pending-badge { color: var(--clay); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .hero-split .memorial-hero-body {
    grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 1.6rem;
  }
  .hero-split .memorial-hero-text { align-items: center; }
  .hero-split .memorial-avatar { max-width: 220px; }
}
@media (max-width: 760px) {
  .ribbon-device, .ribbon-save { display: none; }
  .ribbon-tab span { display: none; }
  .ribbon-tab.is-on span { display: inline; }
  .ribbon-tab { padding: 0.55rem 0.7rem; }
  .ribbon-panels { max-height: 56vh; }
  .ribbon-panel { flex-direction: column; padding: 0.7rem 0.9rem; }
  .ribbon-group {
    padding: 0.55rem 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.09);
  }
  .ribbon-group:last-child { border-bottom: 0; }
  .ribbon-group-label { text-align: left; margin-top: 0.4rem; }
  .bg-dropzone { min-width: 0; }
  .ribbon-slider span { min-width: 6.5em; }
  .ribbon-slider input[type="range"] { flex: 1; width: auto; }
  .theme-swatches, .accent-swatches, .font-picks { max-width: none; }
  .memorial-page.is-device-mobile { max-width: none; border: 0; box-shadow: none; }
}

/* ── Feingriff ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
