/* ═══════════════════════════════════════════════════════════════════════
   GrabBuch Digital
   Gedenkseiten mit QR-Code. Warm, weich, Glas — hoffnungsvoll statt schwer.
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }

@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: var(--dur-fast) var(--ease-ios) both fade-out;
}
::view-transition-new(root) {
  animation: var(--dur-base) var(--ease-ios) both slide-in-from-right;
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-in-from-right {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: var(--dur-fast) linear both fade-out;
  }
  ::view-transition-new(root) { animation-name: fade-in; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}

:root {
  /* GrabBuch Digital: Papier, braune Tinte, Tannengrün */
  --paper:        #f5ece1;
  --paper-raised: #fdf9f4;
  --paper-sunken: #ede3d6;
  --ink:          #33200f;
  --ink-soft:     #5b4636;
  --ink-mute:     #75614f;
  --ink-faint:    #a6968a;

  /* Linien */
  --rule:         rgba(95, 65, 35, 0.16);
  --rule-strong:  rgba(95, 65, 35, 0.28);

  /* Tannengrün (Buttons, Akzente) */
  --ivy:          #3a4a3e;
  --ivy-hover:    #2e3c32;
  --ivy-soft:     #5d7062;
  --ivy-pale:     #e4e8df;

  /* Warmes Signal */
  --clay:         #a35d34;
  --clay-pale:    #f3e2d2;

  /* Glas — deckender, damit man es sieht */
  --glass:        rgba(255, 253, 249, 0.88);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-edge:   rgba(255, 255, 255, 0.95);
  --shadow-soft:  0 12px 36px rgba(60, 40, 20, 0.12), 0 2px 8px rgba(60, 40, 20, 0.06);
  --shadow-lift:  0 22px 50px rgba(60, 40, 20, 0.16), 0 6px 16px rgba(60, 40, 20, 0.08);

  --radius:       14px;
  --radius-lg:    24px;
  --radius-xl:    32px;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans:  'Figtree', 'Avenir Next', 'Segoe UI', Helvetica, sans-serif;

  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --dur-fast: .18s;
  --dur-base: .3s;
  --dur-sheet: .45s;

  /* 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%;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background-color: #f5ece1;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, #fbf6ee 0%, transparent 65%),
    linear-gradient(180deg, #f6eee4 0%, #f3e9dc 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
svg[hidden],
svg[aria-hidden="true"][width="0"],
[hidden] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  pointer-events: none !important;
}
button { font: inherit; color: inherit; }

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


/* ── 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; }

@media (max-width: 640px) {
  .shell { padding: 0 1rem; }
}

/* ── 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(--ivy-soft);
}

/* ── Kopfzeile ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 249, 0.72);
  border-bottom: 1px solid rgba(255,255,255,0.85);
  backdrop-filter: saturate(170%) blur(20px);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 10px 28px rgba(60, 40, 20, 0.08);
}
.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;
  flex: none; min-width: 0;
}

/* Der Markenname ist lang — auf dem Handy Logo kürzen, Buttons kompakter. */
@media (max-width: 640px) {
  .header-inner {
    gap: 0.45rem;
    padding: 0.7rem 0;
  }
  .site-logo {
    font-size: 0.95rem;
    gap: 0.3rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .logo-mark { width: 12px; height: 12px; flex: none; }
  .logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-nav { gap: 0.3rem; flex: 0 0 auto; }
  .header-nav .btn-ghost-sm,
  .header-nav .btn.btn-sm {
    padding: 0.42rem 0.72rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}
@media (max-width: 420px) {
  /* Registrieren steckt im Hero („Konto anlegen“) und im Anmelde-Dialog. */
  .header-nav [data-auth-open="register"] { display: none; }
  .site-logo { font-size: 0.9rem; }
}

/* ── Flächen (Glas) ──────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(165deg, rgba(255,255,255,0.95), rgba(255,252,248,0.82));
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.panel-strong {
  background: linear-gradient(165deg, #ffffff, #fffaf4);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

/* ── Schaltflächen ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.btn-gold {
  background: var(--ivy);
  color: #fffef9;
  border-color: transparent;
  box-shadow: var(--shadow-1, 0 1px 2px rgba(40, 25, 10,.06));
}
.btn-sm { padding: 0.5rem 1.05rem; 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.55rem 1.05rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  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, select, textarea, .input {
  font-size: 16px;
}
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 2px rgba(55, 75, 62, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus {
  outline: none;
  border-color: var(--ivy-soft);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(58, 74, 62, 0.12);
}
.textarea { resize: vertical; line-height: 1.6; min-height: 120px; }

/* Dropdowns: klar als Auswahlfeld erkennbar */
select.input,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 2.5rem;
  background-color: rgba(255, 255, 255, 0.72);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%),
    linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%),
    linear-gradient(to right, transparent 0, transparent 100%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.4rem 100%;
  background-repeat: no-repeat;
}
select.input:hover,
select:hover {
  border-color: var(--ivy-soft);
  background-color: rgba(255, 255, 255, 0.92);
}
select.input:focus,
select:focus {
  outline: none;
  border-color: var(--ivy-soft);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(58, 74, 62, 0.12);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ivy) 50%),
    linear-gradient(135deg, var(--ivy) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select.input:disabled,
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.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.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid;
  transition: opacity var(--dur-base, 240ms);
}
.flash-error   { background: rgba(248, 238, 232, 0.85); border-color: rgba(176,106,74,0.28); color: #7a452e; }
.flash-success { background: rgba(58, 74, 62, 0.1);  border-color: rgba(58, 74, 62,0.22);  color: var(--ivy); }
.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 1rem; border: 1px solid; }
.alert-error   { background: rgba(248, 238, 232, 0.85); border-color: rgba(176,106,74,0.28); color: #7a452e; }
.alert-success { background: rgba(58, 74, 62, 0.1);  border-color: rgba(58, 74, 62,0.22);  color: var(--ivy); }
.alert-warning { background: #fff7d6; border-color: #d9bd55; color: #66520d; }
.btn-danger { background: #8f2f2f; border-color: #8f2f2f; color: #fff; }
.btn-danger:hover { background: #742424; border-color: #742424; color: #fff; }

/* ═══ STARTSEITE (Runde 20) ════════════════════════════════════════════ */
/* Tokens: --sp-*, --r-phone, --ease-soft, --dur-reveal/hero, --stagger, --vignette (siehe Ende der Datei) */
.home { padding-bottom: 0; }
.home h1, .home h2, .home h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; }

/* Textlink (hell auf dunklem Grund) */
.home-textlink {
  color: rgb(255 255 255 / .86);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / .35);
  text-underline-offset: .28em;
  padding: var(--sp-2) var(--sp-1);
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}
.home-textlink:hover { color: #fff; text-decoration-color: rgb(255 255 255 / .8); }
.home-textlink:focus-visible { box-shadow: 0 0 0 2px rgb(0 0 0 / .6), 0 0 0 4px rgb(255 255 255 / .85); border-radius: var(--r-sm); }

/* Primärer Pill-Button auf dunklem Marketing-Grund */
.home-hero .btn-gold,
.home-steps .btn-gold {
  background: #d4b886;
  background-image: none;
  color: #1b1815;
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  .home-hero .btn-gold:hover { background-color: #e0c796; }
}

/* ── 2.1 Hero ──────────────────────────────────────────────────────── */
.home-hero {
  position: relative;
  min-height: min(92svh, 860px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
.home-hero-plane {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #1b1815;
}
.home-hero-plane picture,
.home-hero-plane img {
  width: 100%;
  height: 100%;
  display: block;
}
.home-hero-plane img {
  object-fit: cover;
  object-position: 58% 35%;
  opacity: 1;
  transform-origin: 58% 35%;
  animation: home-hero-photo 600ms var(--ease-out) both;
}
@keyframes home-hero-photo {
  from { transform: scale(1.02); }
  to { transform: none; }
}
.home-hero-plane::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(0 0 0 / .55), transparent 60%),
    linear-gradient(105deg, rgba(30, 20, 10, 0.72) 0%, rgba(30, 20, 10, 0.42) 45%, rgba(30, 20, 10, 0.12) 100%),
    var(--vignette, radial-gradient(120% 100% at 50% 40%, transparent 55%, rgb(0 0 0 / .35) 100%));
  pointer-events: none;
}
.home-hero > .shell {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-top: calc(var(--sp-9) + var(--sp-5));
  padding-bottom: var(--sp-8);
  align-self: end;
}
.home-hero-copy { max-width: 40rem; }
.home-headline {
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  color: #fff;
  margin: 0 0 var(--sp-5);
  text-shadow: 0 2px 24px rgb(0 0 0 / .4);
}
.home-headline-line { display: block; }
.home-headline-line--2 { padding-left: 0; }
@media (min-width: 768px) {
  .home-headline-line--2 { padding-left: clamp(0.5rem, 3vw, 1.5rem); }
}
.home-lead {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgb(255 255 255 / .78);
  max-width: 34ch;
  margin: 0 0 var(--sp-6);
}
.home-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
}
.home-hero .home-headline-line,
.home-hero .home-lead,
.home-hero .home-cta {
  animation: home-hero-in var(--dur-hero) var(--ease-out) both;
}
.home-hero .home-headline-line { animation-delay: 1.1s; }
.home-hero .home-headline-line--2 { animation-delay: 1.5s; }
.home-hero .home-lead { animation-delay: 1.85s; }
.home-hero .home-cta { animation-delay: 2.15s; }
@keyframes home-hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
/* Kleiner Scroll-Hinweis im Hero */
.home-scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: rgb(255 255 255 / .85);
  text-decoration: none;
}
.home-scroll-chevron {
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: home-scroll-bounce 1.8s var(--ease-out) infinite;
}
@keyframes home-scroll-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: .55; }
  50% { transform: rotate(45deg) translate(3px, 3px); opacity: 1; }
}

/* Scroll-Reveal (mem-reveal.js setzt html.js-reveal) */
html.js-reveal .home [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 220ms);
}
html.js-reveal .home [data-reveal="slide"] { transform: translateX(-36px) translateY(0); }
html.js-reveal .home [data-reveal].is-visible { opacity: 1; transform: none; }

/* ── 2.2 Mockup auf Pergament ──────────────────────────────────────── */
.home-mockup {
  padding: clamp(3.5rem, 9vw, 6rem) 0;
  color: #2b2217;
  background:
    radial-gradient(90% 70% at 20% 0%, rgb(255 250 238 / .75), transparent 70%),
    linear-gradient(180deg, #efe5d1 0%, #e6d9bf 100%);
}
.home-mockup-grid {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: var(--sp-8);
  text-align: center;
}
.home-phone {
  position: relative;
  width: clamp(210px, 62vw, 280px);
  aspect-ratio: 780 / 1688;
  border: 8px solid #111;
  border-radius: var(--r-phone);
  background: #111;
  box-shadow: 0 30px 60px -20px rgb(43 34 23 / .5), 0 8px 18px rgb(43 34 23 / .18);
  overflow: hidden;
}
.home-phone-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: calc(var(--r-phone) - 8px);
  background:
    radial-gradient(90% 55% at 50% 30%, #f6eedd 0%, transparent 70%),
    linear-gradient(180deg, #e9dfca 0%, #cdbf9f 100%);
}
.home-diamond {
  position: relative;
  width: 64px;
  height: 64px;
  transform: rotate(45deg);
  border: 1px solid rgb(139 111 58 / .7);
}
.home-diamond::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(139 111 58 / .45);
}
.home-diamond::after {
  content: '';
  position: absolute;
  inset: 26px;
  background: rgb(139 111 58 / .55);
}
.home-mockup-copy { max-width: 26rem; }
.home-mockup-copy h2 {
  font-size: clamp(1.55rem, 3.4vw, 2.2rem);
  line-height: 1.22;
  margin: 0 0 var(--sp-4);
  color: #2b2217;
}
.home-mockup-copy p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #5b4a33;
  margin: 0;
}
@media (min-width: 800px) {
  .home-mockup-grid {
    grid-template-columns: auto minmax(0, 26rem);
    justify-content: center;
    align-items: center;
    gap: clamp(var(--sp-8), 8vw, var(--sp-9));
    text-align: left;
  }
}

/* ── 2.3 So funktioniert's ─────────────────────────────────────────── */
.home-steps {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 6rem) 0;
  background: #14110e;
  color: #fff;
}
/* eigene Ebene, damit nur der Hintergrund unscharf ist, nicht der Text */
.home-steps-bg {
  position: absolute;
  inset: -48px;
  z-index: -2;
  filter: blur(18px);
  background:
    radial-gradient(40% 50% at 18% 30%, #4a3f33 0%, transparent 70%),
    radial-gradient(45% 55% at 82% 70%, #3a3a33 0%, transparent 70%),
    linear-gradient(160deg, #2a241e 0%, #14110e 100%);
}
.home-steps-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(10 8 6 / .65);
}
.home-steps-title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  color: #d4b886;
  text-align: center;
  margin: 0 0 var(--sp-8);
}
.home-steps-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 44rem;
  display: grid;
  gap: var(--sp-7);
}
.home-step {
  display: grid;
  grid-template-columns: minmax(3.2rem, 4.5rem) 1fr;
  align-items: start;
  gap: var(--sp-4);
}
.home-step-no {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 10vw, 5rem);
  line-height: .9;
  color: #d4b886;
  font-variant-numeric: lining-nums;
  text-align: right;
}
.home-step h3 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.2;
  color: #fff;
  margin: var(--sp-1) 0 var(--sp-2);
}
.home-step p {
  margin: 0;
  color: rgb(255 255 255 / .72);
  line-height: 1.55;
  max-width: 38ch;
}
.home-steps-domain {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  letter-spacing: .06em;
  text-align: center;
  color: rgb(255 255 255 / .9);
  margin: var(--sp-9) 0 0;
}

/* ── 2.4 Produkt, FAQ, Kontakt, Abschluss ──────────────────────────── */
.home-product {
  padding: clamp(3.5rem, 9vw, 6rem) 0;
}
.home-product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(var(--sp-7), 6vw, var(--sp-9));
  align-items: center;
}
.home-product-tile {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 460px;
  box-shadow: var(--shadow-lift);
}
.home-product-tile img { width: 100%; height: 100%; object-fit: cover; }
.home-product-copy h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 var(--sp-4);
}
.home-product-copy > p {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 40ch;
  margin: 0 0 var(--sp-5);
}
.home-product-copy ul { list-style: none; display: grid; gap: var(--sp-3); margin: 0; padding: 0; }
.home-product-copy li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: .95rem;
}
.home-product-copy li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--ivy);
}

.home-faq,
.home-contact {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
  border-top: 1px solid var(--rule);
}
.home-faq h2,
.home-contact h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 var(--sp-4);
}
.home-contact p { max-width: 42ch; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.home-contact a { color: var(--ink); font-weight: 600; }
.home-faq-list { margin: var(--sp-6) 0 0; display: grid; gap: var(--sp-3); }
.home-faq-item {
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--paper);
  padding: 0 var(--sp-5);
  overflow: hidden;
}
.home-faq-item summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  padding: var(--sp-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.home-faq-item summary::-webkit-details-marker { display: none; }
.home-faq-item summary::after {
  content: '';
  width: .55rem;
  height: .55rem;
  border-right: 2px solid var(--ink-mute);
  border-bottom: 2px solid var(--ink-mute);
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-out);
  flex: none;
}
.home-faq-item[open] summary::after { transform: rotate(225deg); margin-top: .25rem; }
.home-faq-item p {
  margin: 0;
  padding: 0 0 var(--sp-4);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 52ch;
}
.home-close {
  padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(4rem, 10vw, 6.5rem);
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgb(58 74 62 / .08) 100%);
}
.home-close h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 var(--sp-6);
}
.order-meta {
  display: block;
  margin-top: .25rem;
  color: var(--ink-mute);
  font-size: .82rem;
}

@media (max-width: 900px) {
  .home-product-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .home-product-tile { max-width: none; }
}
@media (max-width: 640px) {
  .home-hero > .shell { padding-top: var(--sp-9); padding-bottom: var(--sp-7); }
  .home-lead { max-width: none; }
  .home-cta { flex-direction: column; align-items: stretch; gap: var(--sp-3); text-align: center; }
  .home-cta .btn { width: 100%; min-height: 48px; justify-content: center; }
  .home-step { grid-template-columns: 2.6rem 1fr; gap: var(--sp-3); }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    font-size: .82rem;
  }
  .auth-modal { padding: .85rem; padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px)); }
  .auth-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 1.7rem);
    padding: 1.4rem 1.2rem 1.5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero .home-headline-line,
  .home-hero .home-lead,
  .home-hero .home-cta,
  .home-hero-plane img,
  .home-scroll-chevron { animation: none !important; }
  .home-scroll { display: none; }
  html.js-reveal .home [data-reveal],
  html.js-reveal .home [data-reveal="slide"] {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0s;
  }
}

/* ── 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(36, 48, 40, 0.38);
  backdrop-filter: blur(6px);
}
.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(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(24px) saturate(150%);
}
.auth-modal-close {
  position: absolute; top: 0.55rem; right: 0.55rem;
  width: 44px; height: 44px;
  border: 0; background: transparent;
  color: var(--ink-mute);
  font-size: 1.45rem; line-height: 1;
  cursor: pointer; border-radius: var(--radius);
  display: grid; place-items: center;
}
.auth-modal-close:hover { color: var(--ink); background: var(--paper-sunken); }
.auth-pass-wrap { position: relative; }
.auth-pass-wrap .input { padding-right: 3rem; }
.auth-pass-toggle {
  position: absolute; right: 0.25rem; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0; background: transparent;
  color: var(--ink-mute); cursor: pointer;
  display: grid; place-items: center;
  border-radius: 10px;
}
.auth-pass-toggle svg { width: 1.25rem; height: 1.25rem; }
.auth-pass-toggle.is-on { color: var(--ivy); }
.konto-logout { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.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;
}
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.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: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
}
.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(--glass-strong);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(20px) saturate(150%);
  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: 1rem; }
.guestbook-entry { display: flex; gap: 0.85rem; align-items: flex-start; }
.entry-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 0.9rem;
  flex: none;
  margin-top: 0.15rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.entry-bubble {
  flex: 1; min-width: 0;
  padding: 0.95rem 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.4rem;
}
.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: 1.02rem; 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: 2.1rem 2.35rem;
  background: linear-gradient(155deg, #ffffff 0%, #faf4ec 55%, #fff6ec 100%);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lift), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  flex-wrap: wrap;
}
.qr-hero-left {
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.qr-frame-wrap {
  position: relative;
  padding: 0.95rem;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(55, 75, 62, 0.08);
}
.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; }

.tile-order { display: grid; gap: 1.5rem; }
.design-picker {
  background: linear-gradient(165deg, rgba(255,255,255,0.95), rgba(250, 244, 236, 0.88));
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: var(--radius-xl);
  padding: 1.45rem 1.5rem 1.6rem;
  box-shadow: var(--shadow-lift), inset 0 1px 0 #fff;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.design-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}
.design-step {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ivy);
  font-weight: 600;
  margin-bottom: .2rem;
}
.design-picker-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--ink);
  margin: 0;
}
.design-picker-hint {
  font-size: .84rem;
  color: var(--ink-mute);
  max-width: 28ch;
  line-height: 1.45;
  margin: 0;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.design-grid:has(input:checked) .design-card:not(:has(input:checked)) {
  opacity: .72;
}
.design-grid:has(input:checked) .design-card:not(:has(input:checked)):hover {
  opacity: 1;
}

.design-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg, 20px);
  background: rgba(255, 252, 248, 0.55);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-1, 0 1px 2px rgba(40, 25, 10,.06));
  transition: border-color .18s, box-shadow .18s, transform .18s, opacity .18s, background .18s;
}
.design-card:has(input:checked),
.design-card.is-selected {
  border-color: var(--ivy);
  box-shadow:
    0 0 0 3px rgba(58, 74, 62, 0.18),
    var(--shadow-lift);
  opacity: 1;
  background: rgba(255, 255, 255, 0.92);
}
.design-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.design-card-media {
  position: relative;
  display: block;
  margin: .6rem .6rem 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, #f3ece2, #e2d7c8 70%);
  aspect-ratio: 1;
  box-shadow: inset 0 0 0 1px rgba(55, 75, 62, 0.06);
}
.design-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.design-card { content-visibility: auto; contain-intrinsic-size: auto 280px; }
.design-card-pending { cursor: default; opacity: .72; }
.design-card-pending .design-card-media {
  display: grid;
  place-items: center;
  background: rgba(255, 252, 248, 0.6);
  box-shadow: inset 0 0 0 1px rgba(55, 75, 62, 0.1);
}
.design-card-pending-text {
  font-size: .8125rem;
  color: var(--ink-mute);
  letter-spacing: .02em;
}
.design-card-pending .design-card-state { visibility: hidden; }
.design-card-check {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--ivy);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s, transform .15s;
  box-shadow: 0 2px 8px rgba(47,74,59,.35);
}
.design-card-check svg { width: 14px; height: 14px; }
.design-card:has(input:checked) .design-card-check,
.design-card.is-selected .design-card-check {
  opacity: 1;
  transform: scale(1);
}
.design-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .8rem .85rem;
}
.design-card-name {
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.design-card-state {
  flex: none;
  font-size: .8125rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: .28rem .55rem;
  background: var(--paper);
  font-weight: 500;
}
.design-card:has(input:checked) .design-card-state,
.design-card.is-selected .design-card-state {
  color: #fff;
  background: var(--ivy);
  border-color: var(--ivy);
  font-weight: 600;
}
.design-card:has(input:checked) .design-card-name,
.design-card.is-selected .design-card-name {
  color: var(--ivy);
}

.shop-options, .checkout-form { margin-top: 0; padding: 1.5rem; }
.size-options { display: flex; flex-wrap: wrap; gap: .65rem; }
.size-option { cursor: pointer; position: relative; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option span {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  min-width: 4.5rem;
  justify-content: center;
  border: 2px solid var(--rule-strong);
  padding: .7rem .95rem;
  border-radius: 8px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.size-option span strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
}
.size-option:hover span { border-color: var(--ivy-soft); }
.size-option input:checked + span {
  border-color: var(--ivy);
  background: var(--ivy-pale);
  color: var(--ivy);
  box-shadow: 0 0 0 3px rgba(47,74,59,.12);
}
.size-option input:checked + span strong { 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; }

/* Floating Warenkorb */
.qr-shop-section {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}
.tile-cart-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.1rem .75rem .8rem;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  background: linear-gradient(165deg, #4a5c4f, var(--ivy));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-2, 0 4px 12px rgba(40, 25, 10,.08));
  transition: transform .15s, background .15s, box-shadow .15s;
}
.tile-cart-fab-icon {
  width: 2.4rem; height: 2.4rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tile-cart-fab-icon svg { width: 1.15rem; height: 1.15rem; }
.tile-cart-fab-text {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
  text-align: left;
  min-width: 0;
}
.tile-cart-fab-text strong { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.tile-cart-fab-text span { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.tile-cart-fab-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.35rem; height: 1.35rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: #e8c9a0;
  color: #2a342e;
  font-size: .68rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid rgba(255,252,248,0.9);
  pointer-events: none;
}
.tile-cart-fab-badge[hidden] { display: none !important; }
.checkout-block-reason {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #8a3b2e;
}
.checkout-block-reason a { color: inherit; font-weight: 600; }
.tile-cart-backdrop {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(36, 48, 40, 0.32);
  backdrop-filter: blur(6px);
}
.tile-cart-backdrop[hidden] { display: none !important; }
.tile-cart {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 90;
  width: min(400px, 100%);
  background: rgba(255, 252, 248, 0.78);
  border-left: 1px solid var(--glass-edge);
  box-shadow: -20px 0 56px rgba(55, 75, 62, 0.16);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  visibility: hidden;
}
.tile-cart.is-open {
  transform: translateX(0);
  visibility: visible;
}
body.tile-cart-open { overflow: hidden; }
.tile-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.tile-cart-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0;
}
.tile-cart-close {
  width: 2.2rem; height: 2.2rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-mute);
  cursor: pointer;
}
.tile-cart-close:hover { color: var(--ink); background: var(--paper-sunken); }
.tile-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 1.2rem;
  align-content: start;
}
.tile-cart-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: .9rem;
  align-items: center;
  padding: .9rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 4px 14px rgba(55, 75, 62, 0.05);
}
.tile-cart-thumb {
  width: 84px; height: 84px;
  border-radius: 14px;
  overflow: hidden;
  background: #e4ebe4;
  border: 1px solid var(--rule-strong);
  display: grid; place-items: center;
}
.tile-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile-cart-thumb.is-empty {
  background: repeating-linear-gradient(-45deg, #ebe7dd, #ebe7dd 6px, #e3ded2 6px, #e3ded2 12px);
  font-size: .65rem; color: var(--ink-mute); text-align: center; padding: .35rem;
}
.tile-cart-item-label {
  display: block;
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ivy);
  font-weight: 600;
}
.tile-cart-item-meta strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-top: .1rem;
}
.tile-cart-item-note {
  display: block;
  margin-top: .3rem;
  font-size: .76rem;
  color: var(--ink-mute);
  line-height: 1.35;
}
.tile-cart-field { display: grid; gap: .55rem; }
.tile-qty {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.tile-qty-btn {
  width: 2.35rem; height: 2.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--paper);
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--ink);
}
.tile-qty-btn:hover { border-color: var(--ivy); background: var(--ivy-pale); color: var(--ivy); }
.tile-qty-input {
  width: 3.6rem !important;
  text-align: center;
  font-weight: 600;
  padding-left: .3rem !important;
  padding-right: .3rem !important;
}
.tile-qty-hint { font-size: .78rem; color: var(--ink-mute); margin-left: .2rem; }
.tile-cart-lines {
  list-style: none;
  margin: 0;
  padding: .85rem 0 0;
  border-top: 1px dashed var(--rule-strong);
  display: grid;
  gap: .55rem;
}
.tile-cart-lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .88rem;
  color: var(--ink-soft);
}
.tile-cart-lines strong { color: var(--ink); font-weight: 600; }
.tile-cart-lines em { font-style: normal; font-weight: 600; }
.tile-cart-foot {
  padding: 1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(255,255,255,0.25), rgba(245, 238, 228, 0.55));
  display: grid;
  gap: .65rem;
}
.tile-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .25rem;
}
.tile-cart-total span { color: var(--ink-soft); font-size: .88rem; }
.tile-cart-total small { color: var(--ink-mute); }
.tile-cart-total strong {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--ink);
}

/* ── 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: .28rem .6rem;
  font-size: .8125rem !important;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 500;
}
.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: 15px; }
.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);
  background: var(--paper-sunken);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.admin-table tbody tr:hover td { background: rgba(58, 74, 62, 0.045); }
.admin-table td small { display: block; color: var(--ink-mute); margin-top: .2rem; }
.admin-actions { white-space: nowrap; }
.admin-actions > * { margin-right: .35rem; }
.admin-actions-wrap {
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}
.admin-actions-wrap > * {
  margin-right: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.admin-audit-action {
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 760px) {
  .design-grid { grid-template-columns: 1fr 1fr; }
  .design-picker { padding: 1.1rem; }
  .design-card-foot { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .subscription-card { align-items: flex-start; }
  .customer-order { grid-template-columns: 1fr; }
  .admin-kpis { grid-template-columns: 1fr; }
  .qr-shop-section {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
  .tile-cart-fab {
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    gap: 0;
    padding: 0.55rem;
    width: 3.4rem;
    height: 3.4rem;
    justify-content: center;
  }
  .tile-cart-fab-text { display: none; }
  .tile-cart-fab-icon {
    width: 2.3rem;
    height: 2.3rem;
    background: transparent;
  }
  .tile-cart-fab-badge {
    top: -0.2rem;
    right: -0.2rem;
  }
}
@media (max-width: 460px) {
  .design-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .design-card-name { font-size: .78rem; }
  .design-card-state { font-size: .8125rem; padding: .28rem .55rem; }
  .subscription-card { flex-direction: column; }
  .subscription-price { text-align: left; }
  .tile-cart { width: 100%; }
}

/* ── 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; }
.erp-sidebar a { font-size: 15px; }
.admin-nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; padding: .68rem .75rem; border: 1px solid transparent; 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 { color: #fff; background: rgba(255,255,255,.12); }
.admin-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.14);
  border-color: rgba(232, 201, 160, 0.35);
  box-shadow: inset 3px 0 0 #e8c9a0;
}
.admin-nav-link:focus-visible {
  outline: 2px solid #e8c9a0;
  outline-offset: 2px;
  color: #fff;
}
.admin-nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  border-radius: 999px; background: #e8c9a0; color: #33200f;
  font-size: .68rem; font-weight: 700;
}
.erp-inbox-pill {
  margin-left: auto;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--ivy-pale);
  color: var(--ivy);
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid rgba(58, 74, 62,.2);
}
.admin-notif-unread td { background: rgba(58, 74, 62, 0.06); }
.admin-notif-unread strong { color: var(--ivy); }
.admin-next-step {
  margin: 1rem 0 1.25rem;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(228, 232, 223,.9), rgba(255,252,248,.95));
  border: 1px solid rgba(58, 74, 62,.18);
}
.admin-next-step h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  margin: .15rem 0 .35rem;
}
.admin-next-step > p { color: var(--ink-soft); font-size: .9rem; margin-bottom: .85rem; }
.admin-next-step-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.inline-form { display: inline; }
.admin-order-next { color: var(--ivy); font-size: .86rem; font-weight: 600; }
.admin-order-urgent td { background: rgba(58, 74, 62, 0.05); }
.admin-table .order-status {
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .72rem;
  letter-spacing: .02em;
  background: var(--paper-sunken);
}
.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .25rem;
  padding: .35rem;
  background: rgba(255,255,255,.45);
  border: 1px solid var(--glass-edge, var(--rule));
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.catalog-tab {
  padding: .55rem 1.1rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.catalog-tab:hover { color: var(--ivy); background: rgba(58, 74, 62,.08); }
.catalog-tab.is-active {
  background: var(--ivy);
  color: #fff;
}
.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 > .panel { min-width: 0; }
.erp-kpis > .panel strong,
.admin-kpis .panel strong { font-size: clamp(1.25rem, 5vw, 1.75rem); }
.erp-kpis a { color: inherit; text-decoration: none; }
.erp-sidebar-close {
  display: none;
  position: absolute;
  top: .65rem;
  right: .65rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.erp-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, .25);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  overscroll-behavior: contain;
  touch-action: none;
}
.erp-sidebar {
  position: relative;
  z-index: 30;
  overscroll-behavior: contain;
}
.admin-orders-toggle-card { margin-bottom: 1rem; }
.admin-orders-toggle-card .admin-orders-status {
  margin-left: 0;
}
.admin-orders-toggle-form { margin: .85rem 0 0; }
.admin-orders-switch {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  min-height: 44px;
  padding: .35rem .85rem .35rem .4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.admin-orders-switch:focus {
  outline: none;
}
.admin-orders-switch:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  box-shadow: none;
}
.admin-orders-switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c9b8a8;
  flex-shrink: 0;
  transition: background .15s ease;
}
.admin-orders-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.admin-orders-switch.is-on .admin-orders-switch-track { background: var(--ivy); }
.admin-orders-switch.is-on .admin-orders-switch-knob { transform: translateX(20px); }
.admin-orders-switch-label { font-weight: 600; }
.section-header-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}
.admin-intro {
  display: block;
  text-align: left !important;
  width: 100%;
  max-width: 60ch;
  margin: 0 !important;
}
.admin-pager {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.admin-panel-gap { margin-top: 1rem; }
.admin-access-block h3 { margin-top: 1.25rem; }
.admin-orders-paused-banner {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border: 1px solid #d8a0a0;
  border-radius: 8px;
  background: #f8ecec;
  color: #6a2e2e;
}
.admin-support-banner {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border: 1px solid #c9b896;
  border-radius: 8px;
  background: #f6f0e4;
  color: #4a3d28;
}
.admin-flow-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .35rem;
  margin: 0 0 1.25rem;
  padding: .45rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(255, 252, 248, 0.72);
}
.admin-flow-step {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  flex: 1 1 auto;
  min-width: 7.5rem;
  padding: .45rem .65rem;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
  line-height: 1.15;
}
.admin-flow-step:hover { background: rgba(58, 74, 62, 0.06); }
.admin-flow-step strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-mute);
}
.admin-flow-step span {
  font-size: .74rem;
  color: var(--ink-mute);
  white-space: nowrap;
}
.admin-flow-step.has-work {
  background: rgba(228, 232, 223, 0.75);
}
.admin-flow-step.has-work strong { color: var(--ivy); }
.admin-flow-step.has-work span { color: var(--ink-soft); font-weight: 600; }
.admin-flow-step.stock.has-work {
  background: rgba(232, 201, 160, 0.35);
}
.admin-flow-step.stock.has-work strong { color: #8a5a22; }
.admin-flow-sep {
  width: 1px;
  align-self: stretch;
  margin: .25rem 0;
  background: var(--rule);
  flex: 0 0 1px;
}
.admin-section-count {
  display: inline-block;
  margin-left: .35rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: var(--ivy-pale);
  color: var(--ivy);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}
.admin-notif-type {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: rgba(36, 55, 45, 0.06);
  color: var(--ink-soft);
  font-size: .72rem;
  white-space: nowrap;
}
.admin-empty-hint {
  margin: .85rem 0 0;
  color: var(--ink-mute);
  font-size: .9rem;
}
.admin-kpis.stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-range { margin-top: 1rem; }
.stats-chart-wrap { width: 100%; overflow-x: auto; margin-top: .75rem; }
.stats-chart { display: block; width: 100%; height: auto; }
.stats-chart .bar { fill: var(--ivy); }
.stats-chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.stats-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 1rem;
  align-items: start;
}
@media (max-width: 760px) {
  .stats-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .admin-kpis.stats-kpis { grid-template-columns: 1fr; }
}
.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; }
.customer-filter { margin-top: 1.25rem; }
.erp-search .input { margin: 0; }
.admin-order-detail .input { margin-bottom: .75rem; }
.inventory-select { width: 100%; }
.supplier-panel { box-sizing: border-box; }
.supplier-panel *, .supplier-panel *::before, .supplier-panel *::after { box-sizing: border-box; }
.admin-dialog {
  width: min(30rem, calc(100% - 2rem));
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-raised);
  box-shadow: 0 24px 70px rgba(20, 28, 23, .28);
}
.admin-dialog::backdrop { background: rgba(20, 28, 23, .55); }
.admin-dialog h2 { margin: 0 0 .65rem; font-family: var(--serif); font-weight: 500; }
.admin-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: .65rem; margin-top: 1.25rem; }
.admin-dialog-actions form { margin: 0; }
.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; }
.admin-doc-date { color: var(--ink-mute); font-size: .9rem; margin: -.35rem 0 1rem; }
.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-menu-open .erp-backdrop { display: block; }
  .erp-menu-open { overflow: hidden; }
  .erp-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .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; }
  .admin-flow-sep { display: none; }
  .admin-flow-step { flex: 1 1 calc(50% - .35rem); min-width: 0; }
  .erp-form-actions, .erp-search { align-items: stretch; flex-direction: column; }
  .admin-actions { white-space: normal; display: flex; flex-wrap: wrap; gap: 8px; }
  .admin-actions > * { margin-right: 0; flex-shrink: 0; }
}
@media (max-width: 600px) {
  .erp-kpis,
  .admin-kpis.erp-kpis { grid-template-columns: 1fr; }
}
.section-header .checkout-hint,
.admin-table-panel > .section-header .checkout-hint {
  text-align: left;
  margin: .35rem 0 0;
}
.section-header-stack .mem-section-title { margin-bottom: 0; }

@media (max-width: 640px) {
  .admin-table-wrap { overflow: visible; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .admin-table tbody { display: grid; gap: .85rem; }
  .admin-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper-raised);
  }
  .admin-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 40%) minmax(0, 1fr);
    gap: .75rem;
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--rule);
    overflow-wrap: anywhere;
  }
  .admin-table td:last-child { border-bottom: 0; }
  .admin-table td::before {
    content: attr(data-label);
    color: var(--ink-mute);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .admin-table td.admin-actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    overflow-wrap: normal;
    word-break: normal;
  }
  .admin-table td.admin-actions-wrap::before {
    flex: 0 0 100%;
  }
  .admin-table td.admin-actions-wrap > * {
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .admin-table td.admin-audit-action {
    overflow-wrap: normal;
    word-break: normal;
  }
  .admin-table tr.admin-empty td { display: block; }
  .admin-table tr.admin-empty td::before { content: none; }
}

/* ── Fußzeile ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--glass-edge);
  padding: 2rem 0;
  margin-top: auto;
  background: rgba(255, 252, 248, 0.55);
}
.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; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.1rem;
  color: var(--ink-mute);
  text-decoration: none;
}
.footer-links a:hover { color: var(--ink); }

.legal-page { padding: 3rem 1rem 4.5rem; }
.legal-page .headline { font-size: clamp(1.75rem, 4vw, 2.4rem); margin: 0.35rem 0 0.75rem; }
.legal-lead { color: var(--ink-mute); margin: 0 0 1.75rem; max-width: 48ch; }
.legal-body { max-width: 62ch; line-height: 1.65; color: var(--ink-soft); }
.legal-body h2 { font-size: 1.1rem; margin: 1.75rem 0 0.55rem; color: var(--ink); }
.legal-body p, .legal-body ul { margin: 0 0 0.9rem; }
.legal-body ul { padding-left: 1.2rem; }
.legal-body a { color: var(--ink); }

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.auth-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.auth-check-box {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 0.1rem;
  border: 2px solid var(--rule-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.auth-check input:focus-visible + .auth-check-box {
  outline: 2px solid var(--ivy);
  outline-offset: 2px;
}
.auth-check input:checked + .auth-check-box {
  background: var(--ivy);
  border-color: var(--ivy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}
.auth-check-text a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.auth-check-text { flex: 1; padding-top: 0.1rem; }

.checkout-legal {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-mute);
}
.checkout-legal a { 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 ─────────────────────────────────────────── */
body:has(.memorial-page) {
  background: var(--mem-bg, #f3f6f2);
  background-attachment: scroll;
}
.memorial-page {
  --mem-radius: 18px;
  --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);
  color: var(--mem-accent-ink, #fffef9);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--mem-accent) 35%, transparent);
}
.memorial-page .input {
  background-color: var(--mem-panel);
  border-color: var(--mem-rule);
  color: var(--mem-ink);
}
.memorial-page .input::placeholder { color: var(--mem-muted); }
.memorial-page select.input,
.memorial-page select {
  background-color: var(--mem-panel);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--mem-muted, var(--ink-mute)) 50%),
    linear-gradient(135deg, var(--mem-muted, var(--ink-mute)) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Flächen: Papier, Milchglas oder nur Linien */
.memorial-page .panel {
  border-radius: var(--mem-radius);
  border: 1px solid var(--mem-rule);
  background: var(--mem-panel);
  color: var(--mem-ink);
}
.panels-glass .panel {
  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 {
  background: transparent;
  border-color: color-mix(in srgb, var(--mem-ink) 22%, transparent);
}
.radius-sharp { --mem-radius: 0px; }
.radius-soft  { --mem-radius: 10px; } /* Reel / --r-md */
.radius-round { --mem-radius: 26px; }
.density-normal  { --mem-gap: 3rem; --mem-pad: 1.75rem 1.9rem; --mem-hero-pad: 5rem 1.5rem 3.5rem; }
@media (min-width: 768px) {
  .density-normal  { --mem-gap: 3.5rem; }
  }
.memorial-page .memorial-section { margin-bottom: var(--mem-gap); }
.memorial-page .memorial-section.panel { padding: var(--mem-pad); }
.memorial-page .memorial-hero-body { padding: var(--mem-hero-pad); }
.memorial-page .memorial-shell { position: relative; z-index: 1; }

/* ── Galerie-Pager (App-Style) ────────────────────────────────────────── */
.mem-gallery-section .mem-section-title { margin-bottom: 0.85rem; }
.mem-carousel {
  position: relative;
  width: 100%;
  outline: none;
}
.mem-carousel-stage {
  position: relative;
  width: 100%;
}
.mem-carousel-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: var(--mem-radius, 14px);
  touch-action: pan-y;
  background: color-mix(in srgb, var(--mem-panel) 35%, transparent);
}
.mem-carousel-nav {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 1px solid color-mix(in oklab, var(--mem-ink) 14%, transparent);
  border-radius: 50%;
  background: color-mix(in oklab, var(--mem-panel) 88%, transparent);
  color: var(--mem-ink);
  box-shadow: 0 4px 16px color-mix(in oklab, var(--mem-ink) 12%, transparent);
  cursor: pointer;
  place-items: center;
  padding: 0;
}
.mem-carousel-nav:hover:not(:disabled) {
  background: var(--mem-panel);
}
.mem-carousel-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.mem-carousel-prev { left: 0.65rem; }
.mem-carousel-next { right: 0.65rem; }
@media (min-width: 768px) {
  .mem-carousel-nav { display: grid; }
  .mem-carousel-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
  }
  .mem-carousel-dot.is-on { transform: scaleX(1.8); }
  .mem-carousel-count { display: block; }
}
.mem-carousel-track {
  display: flex;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.mem-carousel-track.is-animating {
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.mem-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  min-width: 0;
}
.mem-carousel-photo {
  aspect-ratio: 1;
  width: 100%;
  border-radius: var(--mem-radius, 14px);
  background: color-mix(in srgb, var(--mem-panel) 55%, transparent);
}
.mem-carousel-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.mem-carousel-photo:hover img { transform: none; }
.mem-carousel-cap {
  margin: 0.55rem 0.15rem 0;
  font-family: var(--mem-serif, var(--serif));
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--mem-soft, var(--ink-soft));
  text-align: center;
}
.mem-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  min-height: 14px;
}
.mem-carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mem-ink) 28%, transparent);
  cursor: pointer;
  transform-origin: center;
  transition: background-color var(--dur-fast, 160ms) var(--ease-out, ease), transform var(--dur-fast, 160ms) var(--ease-out, ease);
}
.mem-carousel-dot.is-on {
  background: var(--mem-accent, var(--ivy));
  transform: scaleX(2.4);
}
.mem-carousel-count {
  display: none;
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--mem-muted);
}
@media (max-width: 560px) {
  .mem-carousel-count { display: block; }
}

/* ── Gästebuch: eigenes aufgeschlagenes Buch (getrennt von der Seite) ─── */
.guestbook-book {
  position: relative;
  z-index: 2;
  margin-top: 2.5rem;
  scroll-margin-top: 4.75rem;
}
.guestbook-form .input,
.guestbook-form .textarea {
  scroll-margin-top: 5.25rem;
  scroll-margin-bottom: max(1.25rem, 18vh);
}
.guestbook-book-band {
  padding: 2.75rem 0 3.5rem;
  background: transparent;
  border-top: 0;
  box-shadow: none;
}
.guestbook-book-shell {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
}
.guestbook-book-open {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  border-radius: 4px 18px 18px 4px;
  /* clip statt hidden: kein Scroll-Container, damit iOS das Feld über die Tastatur schieben kann. */
  overflow: hidden;
  overflow: clip;
  box-shadow:
    0 22px 50px rgba(40, 30, 18, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.55) inset;
  background: #fbf7ef;
}
.guestbook-book-bind {
  background:
    linear-gradient(90deg, #5c4630 0%, #8a6a45 35%, #6e5336 70%, #4a3724 100%);
  box-shadow: inset -4px 0 10px rgba(0, 0, 0, 0.28);
}
.guestbook-book-page {
  padding: 1.75rem 1.5rem 2rem;
  background:
    linear-gradient(90deg, rgba(70, 50, 30, 0.07), transparent 18px),
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      rgba(90, 70, 45, 0.07) 28px
    ),
    #fbf7ef;
  color: #2a2118;
}
.guestbook-book-head {
  margin-bottom: 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(70, 55, 35, 0.16);
  text-align: center;
}
.guestbook-book-mark {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a6a45;
}
.guestbook-book-title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.15;
  color: #1f1810;
}
.guestbook-book-lead {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #5a4c3c;
}
.guestbook-book .guestbook-form .form-label { color: #5a4c3c; }
.guestbook-book .guestbook-form .input,
.guestbook-book .guestbook-form .textarea {
  background: rgba(255, 252, 246, 0.92);
  border-color: rgba(90, 70, 45, 0.22);
  color: #2a2118;
}
.guestbook-book .guestbook-form .photo-upload-label {
  border-color: rgba(90, 70, 45, 0.28);
  background: rgba(255, 252, 246, 0.75);
  color: #2a2118;
}
.guestbook-book .guestbook-form .photo-upload-hint,
.guestbook-book .guestbook-form .photo-upload-icon { color: #8a7b68; }
.guestbook-book .guestbook-submit { margin-top: 1.1rem; }
.guestbook-book .guestbook-note {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: #8a7b68;
}
.guestbook-book .guestbook-feed {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(70, 55, 35, 0.16);
}
.guestbook-book .guestbook-feed-title {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  color: #1f1810;
  text-align: center;
}
.guestbook-book .entry-bubble {
  background: rgba(255, 252, 246, 0.88);
  border: 1px solid rgba(90, 70, 45, 0.16);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(40, 30, 18, 0.06);
  color: #2a2118;
}
.guestbook-book .entry-name { color: #1f1810; }
.guestbook-book .entry-text { color: #4a3d2e; }
.guestbook-book .entry-time { color: #8a7b68; }
.guestbook-book .entry-photo {
  display: block;
  margin-top: 0.75rem;
  max-width: 220px;
  border-radius: 10px;
  overflow: hidden;
}
.guestbook-book .entry-photo img {
  width: 100%;
  height: auto;
  display: block;
}
.guestbook-book .guestbook-feed.is-solo {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.guestbook-book .entry-reply {
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid #8a6a45;
  background: rgba(138, 106, 69, 0.08);
  border-radius: 0 10px 10px 0;
}
.guestbook-book .entry-reply-label {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6a45;
}
.guestbook-book .entry-reply-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.55;
  color: #3a3024;
}
.guestbook-book .entry-reply-edit {
  margin-top: 0.85rem;
}
.guestbook-book .entry-reply-edit summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: #8a6a45;
  list-style: none;
}
.guestbook-book .entry-reply-edit summary::-webkit-details-marker { display: none; }
.guestbook-book .entry-reply-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.55rem;
}
.guestbook-book .entry-reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
body.is-quiet-memorial .site-header,
body.is-quiet-memorial .site-footer { display: none; }
/* QR-Scan ohne Menü: kein Kopfzeilen-Abstand, Seite bündig oben */
body.is-quiet-memorial .main-content { padding-top: 0; }
body.is-quiet-memorial .memorial-page {
  --mem-hero-pad: max(0.85rem, env(safe-area-inset-top, 0px)) 1.25rem 2.5rem;
}
body.is-quiet-memorial .memorial-page .memorial-hero-body,
body.is-quiet-memorial .hero-portrait .memorial-hero-body,
body.is-quiet-memorial .hero-cover .memorial-hero-body,
body.is-quiet-memorial .hero-minimal .memorial-hero-body,
body.is-quiet-memorial .hero-split .memorial-hero-body,
body.is-quiet-memorial .memorial-page.is-device-mobile .memorial-hero-body {
  padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
}
@media (max-width: 560px) {
  .guestbook-book { margin-top: 1.75rem; }
  .guestbook-book-band { padding: 2rem 0 2.75rem; }
  .guestbook-book-open { grid-template-columns: 5px 1fr; }
  .guestbook-book-page { padding: 1.25rem 0.95rem 1.5rem; }
  .guestbook-book .guestbook-entry { gap: 0.55rem; }
  .guestbook-book .entry-avatar { width: 32px; height: 32px; font-size: 0.78rem; }
  .guestbook-book .entry-bubble { padding-left: 0.15rem; }
  .qr-shop-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .qr-shop-section .shop-price {
    display: block;
  }
}

/* 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;
  /* Sanfte Tönung statt helles Auswaschen des Fotos */
  background: color-mix(in oklab, var(--mem-ink) 42%, var(--mem-bg));
  opacity: calc(var(--mem-bg-dim, 0.28) * 0.5);
}
.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 — Maske in --mem-bg (Runde 20) */
.hero-cover .memorial-hero-media {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover;
  background-position: 50% 22%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
}
.has-bg.hero-cover .memorial-hero-media {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 85%);
}
.hero-cover .memorial-hero-media::after,
.hero-portrait .memorial-hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 58%,
    color-mix(in oklab, var(--mem-bg) 32%, transparent) 100%
  );
  pointer-events: none;
}
@supports not ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
  .hero-cover .memorial-hero-media::after,
  .hero-portrait .memorial-hero-media::after {
    background: linear-gradient(
      to bottom,
      transparent 45%,
      color-mix(in oklab, var(--mem-bg) 40%, transparent) 100%
    );
  }
}
.hero-cover .memorial-hero {
  isolation: isolate;
  width: 100%;
}
.hero-cover .memorial-hero-body {
  min-height: min(62svh, 520px);
  aspect-ratio: auto;
  max-height: none;
  width: 100%;
  justify-content: flex-end;
}
@media (min-width: 768px) {
  .hero-cover .memorial-hero-body { min-height: min(70vh, 640px); }
}
.hero-cover .memorial-hero-text {
  text-shadow: 0 1px 14px rgba(0,0,0,0.45);
}
/* Farben kommen von .hero-has-media / --mem-hero-ink (Runde 22) */

.hero-split .memorial-hero-media { display: none; }
.hero-split .memorial-hero-body {
  max-width: 960px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 2rem; /* ≤ 48px */
  align-items: center; text-align: left;
  justify-content: center;
}
.hero-split .memorial-hero-text { align-items: flex-start; }
.hero-split .memorial-avatar {
  width: 100%; height: auto; aspect-ratio: 1;
  border-radius: 50%; /* Porträt immer Kreis, unabhängig von „Ecken“ */
  border-width: 3px; border-color: var(--mem-panel);
  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;
}
/* Titelbild: Hintergrundbild dominant, Porträt kleiner */
.hero-cover .memorial-avatar,
.hero-cover .memorial-avatar-add {
  width: clamp(72px, 22vw, 96px);
  margin-bottom: 1rem;
}
/* Schlicht: kein Hintergrundbild (bereits display:none auf media), Text im Vordergrund */

.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; }
/* Akzent an 2–3 ruhigen Stellen (alle Themes): Strich unter Name, Datums-Trenner-Farbe, GB-Links. */
.memorial-page .memorial-name-hero {
  position: relative;
  display: inline-block;
}
.memorial-page .memorial-name-hero::after {
  content: '';
  display: block;
  width: min(4.5rem, 40%);
  height: 2px;
  margin: 0.45rem auto 0;
  background: var(--mem-accent);
  opacity: 0.75;
  border-radius: 1px;
}
.memorial-page.hero-split .memorial-dates-hero,
.memorial-page.hero-minimal .memorial-dates-hero {
  color: color-mix(in srgb, var(--mem-accent) 35%, var(--mem-soft, var(--mem-ink)));
}
.memorial-page .guestbook-book a:not(.btn):not(.btn-gold) {
  color: var(--mem-accent);
}
.memorial-page .memorial-gb-jump .btn-ghost-sm {
  color: var(--mem-accent);
  border-color: color-mix(in srgb, var(--mem-accent) 50%, transparent);
}

.memorial-kicker-hero {
  max-width: 36rem;
  margin-top: 0.85rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.memorial-gb-jump {
  margin: 1rem 0 0;
}
.memorial-gb-jump .btn-ghost-sm {
  min-height: 44px;
  padding-inline: 1rem;
}
.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 var(--dur-base, 240ms) var(--ease-out, ease); }
.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: #000;
  display: flex; flex-direction: column;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
.mem-lightbox[hidden] { display: none; }
.mem-lightbox-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
}
.mem-lightbox-track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.mem-lightbox-track.is-animating {
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.mem-lightbox-slide {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 0 3rem;
  box-sizing: border-box;
}
.mem-lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.mem-lightbox-cap {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  margin: 0;
  padding: 0 1.25rem;
  color: rgba(255,255,255,0.85);
  text-align: center;
  font-size: 0.9rem;
  pointer-events: none;
}
.mem-lightbox-count {
  position: absolute;
  top: calc(1.1rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  z-index: 2;
}
.mem-lightbox .owner-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: 0.85rem;
  color: #fff;
  z-index: 2;
  background: rgba(0,0,0,0.35);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
}
.mem-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}
.mem-lightbox-nav:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.7);
}
.mem-lightbox-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
.mem-lightbox-nav[hidden] { display: none; }
.mem-lightbox-prev { left: max(0.75rem, env(safe-area-inset-left, 0px)); }
.mem-lightbox-next { right: max(0.75rem, env(safe-area-inset-right, 0px)); }
@media (min-width: 768px) {
  .mem-lightbox-nav { width: 52px; height: 52px; margin-top: -26px; }
  .mem-lightbox-prev { left: max(1.25rem, env(safe-area-inset-left, 0px)); }
  .mem-lightbox-next { right: max(1.25rem, env(safe-area-inset-right, 0px)); }
}
body.lightbox-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

/* ── 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: var(--shadow-2, 0 4px 12px rgba(40, 25, 10,.08));
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.edit-fab svg { width: 16px; height: 16px; }
.edit-fab[hidden] { display: none; }

.ribbon-done {
  padding: 0 0.85rem; height: 32px;
  border: 0; border-radius: var(--r-md, 14px);
  background: var(--ribbon-hi, #b8c4b0);
  color: var(--ribbon-hi-ink, #12201a);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: filter var(--dur-fast, 160ms) var(--ease-out, ease), background-color var(--dur-fast, 160ms) var(--ease-out, ease);
}

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

.mem-ribbon[hidden] { display: none; }
.mem-ribbon {
  --ribbon-hi: #b8c4b0;
  --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-mobile-chrome { display: none; }
.ribbon-tabs-mobile { display: none; }
.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 {
  gap: 0.15rem; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.ribbon-tabs-desktop { display: flex; }
.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.75rem; min-width: 8.5em; text-align: right;
  color: rgba(236,232,223,0.82);
  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; }

.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[hidden],
.memorial-empty-hint[hidden],
.field-error[hidden] { display: none !important; }
.field-error { margin: 0.35rem 0 0; color: #ffb4b4; font-size: 0.78rem; line-height: 1.4; }
.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: 0 0 0.55rem;
  padding: 0;
  font-size: 0.82rem; letter-spacing: 0; text-transform: none;
  color: rgba(236,232,223,0.78); text-align: left;
  font-weight: 600;
}
.ribbon-hint {
  flex: 1 0 100%;
  margin: 0.45rem 0 0; max-width: 34ch;
  font-size: 0.75rem; line-height: 1.5; color: rgba(236,232,223,0.82);
}
.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.82);
}
.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: 340px; }
.accent-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.35rem 0.4rem;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  font-size: 0.78rem; color: rgba(236,232,223,0.85); cursor: pointer;
}
.accent-chip i {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
}
.accent-chip.is-on {
  background: var(--ribbon-hi); border-color: transparent;
  color: var(--ribbon-hi-ink); font-weight: 600;
}
.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(184, 196, 176,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(184, 196, 176,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.75rem; color: rgba(236,232,223,0.82); }
.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.66); }
.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.8); }

.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; }
.owner-upload-actions { display: contents; }
.owner-upload-pick { display: block; }
.owner-upload-pick.is-camera { display: none; }
.owner-upload-cta { display: none; }
.meta-file-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.meta-file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: rgba(236,232,223,0.9);
  font-size: 0.82rem;
  cursor: pointer;
}
.meta-file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.meta-file-btn span { pointer-events: none; }

.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; }
.meta-form textarea.meta-grow {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  line-height: 1.55;
  resize: vertical;
  overflow-y: hidden;
  field-sizing: content; /* moderne Browser: wächst mit Inhalt */
}
.meta-form textarea.meta-grow[name="shortDescription"] {
  min-height: 3.2rem;
  font-size: 0.95rem;
}
.meta-form textarea.meta-grow[name="story"] {
  min-height: 12rem;
  font-size: 0.95rem;
}

.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; }
}
/* Handy-Editor (Runde 14): Inspektor und Dock siehe Abschnitt „Runde 14“ am Dateiende. */
@media (max-width: 767px) {
  .memorial-page.is-device-mobile { max-width: none; border: 0; box-shadow: none; }
}

/* Geführter Start (nur Mobile). Kein Schleier über der Seite: Tippen trifft die Ziele. */
.mem-onboard[hidden] { display: none !important; }
.mem-onboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: none;
  pointer-events: none;
}
.mem-onboard-card {
  width: min(420px, 100%);
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: 18px;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f3efe6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: mem-onboard-in var(--dur-sheet, 420ms) var(--ease-ios, ease);
}
.mem-onboard.is-leaving .mem-onboard-card {
  animation: mem-onboard-out 280ms var(--ease-ios, ease) forwards;
}
@keyframes mem-onboard-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes mem-onboard-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
  .mem-onboard-card,
  .mem-onboard.is-leaving .mem-onboard-card { animation: none; }
}
.mem-onboard-step {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(236, 232, 223, 0.72);
}
.mem-onboard-title {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
}
.mem-onboard-text {
  margin: 0 0 1.15rem;
  color: rgba(236, 232, 223, 0.72);
  font-size: 0.95rem;
  line-height: 1.5;
}
.mem-onboard-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.mem-onboard-actions .btn {
  min-height: 48px;
  width: 100%;
}
@media (min-width: 768px) {
  .mem-onboard { display: none !important; }
}

/* ── Admin Fliesen-Designs ───────────────────────────────────────────── */
.design-admin-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 640px);
  gap: 1.75rem;
  align-items: start;
}
.design-admin-preview-wrap {
  position: sticky;
  top: 1rem;
  width: 100%;
  max-width: 640px;
}
.qr-num-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.design-admin-form input[type="number"] { min-width: 5.5rem; }
.qr-stepper {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--rule, #e3ded2);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  position: relative;
  z-index: 1;
}
.qr-stepper-input.input {
  margin: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
  min-height: 52px;
  min-width: 5.5rem;
  pointer-events: auto;
}
.qr-stepper-input.input::-webkit-outer-spin-button,
.qr-stepper-input.input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qr-stepper-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: #ece8df;
  color: #2a2824;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  min-height: 52px;
  min-width: 56px;
  user-select: none;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}
.qr-stepper-btn:hover:not(:disabled) { background: #e0dbd0; }
.qr-stepper-btn:active:not(:disabled) { background: #cfc8ba; }
.qr-stepper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #8a857c;
  background: #e8e4db;
}
.qr-stepper.is-locked {
  background: #ebe7df;
  border-color: #d5d0c6;
  opacity: 0.72;
  pointer-events: none;
}
.qr-stepper.is-locked .qr-stepper-input.input {
  background: #ebe7df;
  color: #7a756c;
  cursor: not-allowed;
}
.qr-stepper.is-locked .qr-stepper-btn {
  background: #e0dbd2;
  color: #9a958c;
  cursor: not-allowed;
  opacity: 1;
}
.design-admin-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid var(--rule, #e3ded2);
  background: #ece8df;
  object-fit: cover;
}
.qr-calib {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--rule, #e3ded2);
  background: #111;
  touch-action: none;
  user-select: none;
}
.qr-calib-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.qr-calib-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #6fcf97;
  background: #12110f;
  cursor: grab;
  z-index: 2;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.qr-calib-box:active { cursor: grabbing; }
.qr-calib-plate {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.qr-calib-stamp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.qr-calib-handle {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-radius: 4px 0 2px 0;
  background: #6fcf97;
  border: 2px solid #fff;
  cursor: nwse-resize;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  z-index: 3;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.85rem 0 1rem;
  font-size: 0.95rem;
}
.design-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.design-admin-card {
  border: 1px solid var(--rule, #e3ded2);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel, #fdfcf9);
}
.design-admin-card.is-inactive { opacity: 0.55; }
.design-admin-card-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
}
.design-admin-card-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.design-admin-card-qr {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 2px;
  pointer-events: none;
}
.design-admin-card-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.design-admin-card-meta {
  padding: 0.75rem 0.85rem 0.9rem;
  display: grid;
  gap: 0.25rem;
}
.design-admin-card-meta strong { font-size: 0.95rem; }
.design-admin-card-meta small { color: var(--muted, #7d776c); }
.design-admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
@media (max-width: 980px) {
  .design-admin-editor { grid-template-columns: 1fr; }
  .design-admin-preview-wrap {
    position: static;
    max-width: min(640px, 100%);
    margin-inline: auto;
  }
}

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

/* ── Runde 2: Editor-Sheet + iOS-Chrome ───────────────────────────────── */
.mem-edit-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 52px;
  padding: max(0.35rem, env(safe-area-inset-top)) 0.75rem 0.35rem;
  background: rgba(26, 26, 28, 0.92);
  color: #ece8df;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.mem-edit-top[hidden] { display: none !important; }
.mem-edit-top-btn {
  min-width: 44px; min-height: 44px;
  border: 0; background: transparent; color: inherit;
  border-radius: 12px; cursor: pointer;
  display: grid; place-items: center;
}
.mem-edit-top-btn.is-done {
  padding: 0 0.9rem;
  background: var(--ribbon-hi, #b8c4b0);
  color: var(--ribbon-hi-ink, #12201a);
  font-weight: 600;
}
.mem-edit-top .ribbon-save { flex: 1; text-align: center; font-size: 0.85rem; }

.mem-sheet {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 100dvh;
  z-index: 71;
  display: flex;
  flex-direction: column;
  background: #1a1a1c;
  color: #ece8df;
  border-radius: 18px 18px 0 0;
  transform: translate3d(0, 110%, 0);
  will-change: transform;
  pointer-events: none;
  box-shadow: 0 -16px 48px rgba(0,0,0,0.35);
}
.mem-sheet.is-open { pointer-events: auto; }
.sheet-handle {
  width: 42px; height: 4px;
  margin: 0.55rem auto 0.2rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  flex-shrink: 0;
  touch-action: none;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 1rem 0.55rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sheet-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.sheet-close {
  width: 44px; height: 44px;
  border: 0; border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: inherit; font-size: 1.35rem; cursor: pointer;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 calc(var(--tabbar-h, 4.5rem) + env(safe-area-inset-bottom) + 12px);
  -webkit-overflow-scrolling: auto;
}

.style-rows { display: flex; flex-direction: column; gap: 0.85rem; width: 100%; min-width: 0; }
/* Reihe = feste Beschriftung (nur am Handy sichtbar) + Spur mit den Chips. */
.style-row, .opt-row { display: block; min-width: 0; max-width: 100%; }
.style-row-label { display: none; }
.style-track {
  display: flex; gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0.15rem 0.1rem 0.45rem;
}
.opt-row .style-track { padding: 0; gap: 0.3rem; }
/* Steuerungen in der Leiste: kein Systemmenü, kein Textmarkieren, schneller Tap (P4). */
.style-dot, .font-chip, .ribbon-chip, .section-order-btns button, .gb-switch,
.owner-gallery-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.style-dot {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
  scroll-snap-align: start;
  position: relative;
}
.style-dot-fill {
  display: block; width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--dot, #ccc);
  border: 1px solid rgba(255,255,255,0.2);
}
.style-dot.is-on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--ribbon-hi, #b8c4b0);
}
.style-dot.is-on::after {
  content: '✓';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #12201a;
  font-size: 0.85rem; font-weight: 700;
  text-shadow: 0 0 2px #fff;
}
.font-chip {
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 56px;
  padding: 0.45rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: #ece8df;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  cursor: pointer;
  scroll-snap-align: start;
}
.font-chip em { font-style: normal; font-size: 1.15rem; line-height: 1.2; }
.font-chip span { font-size: 0.68rem; opacity: 0.65; font-family: var(--sans); }
.font-chip.is-on {
  border-color: var(--ribbon-hi);
  background: rgba(184, 196, 176,0.18);
}

.inbox-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: rgba(236,232,223,0.78);
  font-size: 0.92rem;
  line-height: 1.5;
}

body.is-editing .mem-ribbon {
  pointer-events: none;
}
body.is-editing .mem-ribbon .ribbon-bar,
body.is-editing .mem-ribbon .mem-sheet.is-open {
  pointer-events: auto;
}

/* Nie anzeigen, wenn nicht im Bearbeiten-Modus (auch nicht „angedockt“). */
body:not(.is-editing) .mem-ribbon,
body:not(.is-editing) .mem-edit-top,
.mem-ribbon[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 767px) {
  body.is-editing .app-tabbar { display: none !important; }
  .memorial-page {
    transition: background-color var(--dur-base) var(--ease-ios), color var(--dur-base) var(--ease-ios);
  }
}

@media (min-width: 768px) {
  .mem-edit-top { display: none !important; }
  /* Runde 16: Der Inspektor ist eine feste Seitenleiste (siehe Abschnitt „Runde 16“ am Dateiende). */
  .sheet-handle { display: none; }
  .meta-quick { display: none; }
  body.is-editing .mem-ribbon .ribbon-bar {
    position: fixed; left: 0; right: 0; bottom: 0;
  }
}

@media (display-mode: standalone) {
  html { overscroll-behavior-y: none; }
  .site-header {
    padding-top: env(safe-area-inset-top);
  }
}

.shell {
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}

.shop-price, .tile-cart-total strong, .subscription-price strong {
  font-variant-numeric: tabular-nums;
}

/* ── QR Segmente ─────────────────────────────────────────────────────── */
.qr-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.3rem;
  margin: 0 0 1.5rem;
  border-radius: 14px;
  background: rgba(36, 48, 40, 0.06);
  border: 1px solid var(--rule);
}
.qr-segments:has(.qr-seg:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
}
.qr-seg {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  min-height: 44px;
  border-radius: 11px;
  cursor: pointer;
  padding: 0.6rem 0.4rem;
}
.qr-seg:focus:not(:focus-visible) { outline: none; }
.qr-seg.is-on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(40, 25, 10, 0.1);
}
.qr-seg-secondary {
  font-weight: 500;
  color: var(--ink-soft);
  opacity: 0.85;
  border: 1px solid transparent;
}
.qr-seg-secondary.is-on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  opacity: 1;
  box-shadow: 0 1px 4px rgba(40, 25, 10, 0.1);
  border-color: transparent;
}
.tile-catalog,
.design-grid {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 720px) {
  .qr-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: hidden;
    gap: 0.2rem;
    scrollbar-width: none;
  }
  .qr-segments::-webkit-scrollbar { display: none; }
  .qr-seg {
    flex: none;
    min-width: 0;
    font-size: 0.68rem;
    padding: 0.45rem 0.2rem;
    white-space: normal;
    line-height: 1.15;
  }
}
.qr-pane[hidden] { display: none !important; }

/* ── App Tabbar (angemeldet, Handy) ──────────────────────────────────── */
.app-tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.15rem;
  padding: 0.35rem 0.45rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(245, 243, 238, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid rgba(36, 48, 40, 0.1);
  box-shadow: 0 -8px 28px rgba(40, 25, 10, 0.08);
}
.app-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 52px;
  min-width: 0;
  padding: 0.2rem 0.15rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-decoration: none;
  color: var(--ink-mute);
  font-family: var(--sans, inherit);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: hidden;
}
.app-tab span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-tab svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
}
.app-tab.is-on {
  color: var(--ivy);
  background: rgba(58, 74, 62, 0.12);
}
@media (max-width: 767px) {
  .has-app-tabbar .app-tabbar { display: grid; }
  .has-app-tabbar .header-profile { display: none; }
  .has-app-tabbar .tile-cart-fab {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
  .has-app-tabbar .edit-fab { display: none !important; }
  body.is-editing .app-tabbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(110%);
    transition: opacity var(--dur-sheet, 420ms) var(--ease-ios, ease), transform var(--dur-sheet, 420ms) var(--ease-ios, ease);
  }
}
@media (min-width: 768px) {
  .app-tabbar { display: none !important; }
}

.app-tabbar {
  transition: opacity var(--dur-sheet, 420ms) var(--ease-ios, ease), transform var(--dur-sheet, 420ms) var(--ease-ios, ease);
}
.konto-logout {
  margin-top: 2rem;
  text-align: center;
}
.konto-logout-link {
  border: 0;
  background: none;
  color: #a33;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  padding: 0.5rem;
}
.konto-card .konto-actions { gap: 0.65rem; }
#billing_same + .toggle-track,
label[for="billing_same"] { margin-bottom: 0; }
form.konto-card #billing-fields,
form.konto-card > .btn-gold { margin-top: 1.5rem; }

html { scrollbar-gutter: stable; }
body.is-editing { overflow: hidden; }
/* Im Editor: Kopfzeile komplett weg (kein Reststreifen im Layout). */
body.is-editing .site-header {
  display: none !important;
}
.site-header {
  transition: opacity var(--dur-base, 240ms) var(--ease-out, ease), transform var(--dur-base, 240ms) var(--ease-out, ease), background-color var(--dur-base, 240ms) var(--ease-out, ease), color var(--dur-base, 240ms) var(--ease-out, ease), border-color var(--dur-base, 240ms) var(--ease-out, ease), box-shadow var(--dur-base, 240ms) var(--ease-out, ease), backdrop-filter var(--dur-base, 240ms) var(--ease-out, ease);
}
body.has-mem-hero .site-header {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/*
 * Header über der Gedenkseite (Runde 14). Der Header sitzt im Dokumentfluss, das Titelbild
 * beginnt darunter — oben liegt die Fläche der Seite (Pergament: #f5ece1) dahinter.
 * Darum dunkle Schrift; Weiß nur bei dunklem Theme (Nacht, Schiefer). Nach dem Scrollen
 * (.is-solid) bleibt dunkle Schrift auf der hellen Fläche.
 */
body.has-mem-hero .site-header:not(.is-solid) .site-logo,
body.has-mem-hero .site-header:not(.is-solid) .profile-name,
body.has-mem-hero .site-header:not(.is-solid) .logo-mark,
body.has-mem-hero .site-header:not(.is-solid) .profile-chevron {
  color: var(--mem-ink, var(--ink));
  text-shadow: none;
}
body.has-mem-hero .site-header.is-solid {
  background: rgba(255, 253, 249, 0.82);
  border-bottom-color: rgba(255,255,255,0.85);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 10px 28px rgba(60, 40, 20, 0.08);
  backdrop-filter: saturate(170%) blur(20px);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
}
body.has-mem-hero .site-header.is-solid .site-logo,
body.has-mem-hero .site-header.is-solid .profile-name,
body.has-mem-hero .site-header.is-solid .profile-chevron {
  color: var(--ink);
  text-shadow: none;
}
body.has-mem-hero .site-header.is-solid .logo-mark { color: var(--ivy); text-shadow: none; }/* Dunkles Theme {
  background: rgba(18, 20, 24, 0.86);
  border-bottom-color: rgba(255,255,255,0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Handy: im Editor nirgends Scrollbalken. Desktop (Runde 16): nur die Werkzeugleiste ohne Balken,
   der Inspektor bekommt eine dünne, sichtbare Scrollleiste (siehe „Runde 16“). */
.ribbon-bar *,
.ribbon-bar { scrollbar-width: none; }
.ribbon-bar *::-webkit-scrollbar { display: none; }
@media (max-width: 767px) {
  .mem-ribbon *,
  .mem-sheet * {
    scrollbar-width: none;
  }
  .mem-ribbon *::-webkit-scrollbar,
  .mem-sheet *::-webkit-scrollbar { display: none; }
}

/* ===== Interaktionssystem (Apple-artig) ===== */
:root{
  --ease-out: cubic-bezier(.25,.1,.25,1);
  --ease-ios: cubic-bezier(.32,.72,0,1);
  --dur-press: 90ms; --dur-fast: 160ms; --dur-base: 240ms; --dur-sheet: 420ms;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(40, 25, 10,.06), 0 1px 1px rgba(40, 25, 10,.04);
  --shadow-2: 0 4px 12px rgba(40, 25, 10,.08), 0 1px 3px rgba(40, 25, 10,.06);
  --shadow-3: 0 12px 32px rgba(40, 25, 10,.12), 0 2px 6px rgba(40, 25, 10,.06);
  --focus-ring: 0 0 0 3px var(--paper,#f5ece1), 0 0 0 5px color-mix(in srgb,var(--ivy) 70%,transparent);
  --btn-bg: var(--ivy); --btn-bg-hover: color-mix(in srgb,var(--ivy) 88%,#000);
  --btn-bg-press: color-mix(in srgb,var(--ivy) 78%,#000);
  --tabbar-h: 4.5rem;
}
.btn,.btn-ghost-sm,.tile-cart-fab,.edit-fab,.qr-copy-btn,.tile-qty-btn,
.ribbon-done,.btn-approve,.btn-reject,.btn-text,.ribbon-tab,.ribbon-icon-btn,.ribbon-chip,.app-tab{
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-press) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out);
  -webkit-user-select:none; user-select:none; touch-action:manipulation;
}
.btn-gold{
  background: var(--btn-bg);
  background-image: linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,0));
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,.18);
  transform:none;
}
.btn-ghost-sm{ backdrop-filter:none; -webkit-backdrop-filter:none; }

@media (hover:hover) and (pointer:fine){
  .btn-gold:hover{ background-color: var(--btn-bg-hover); transform:none; box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.18); }
  .btn-ghost-sm:hover{ background: color-mix(in srgb,var(--ivy) 7%,transparent); border-color: color-mix(in srgb,var(--ivy) 45%,var(--rule-strong)); color: var(--ink); }
  .btn-text:hover,.footer-links a:hover{ color: var(--ink); }
  .tile-cart-fab:hover,.edit-fab:hover{ transform:none; box-shadow: var(--shadow-3); }
  .design-card:hover{ transform:none; box-shadow: var(--shadow-2); border-color: color-mix(in srgb,var(--ivy) 35%,transparent); }
  .mem-gallery-item:hover img{ transform: scale(1.02); }
  .tpl-card:hover,.size-option:hover span,.img-upload-box:hover,.photo-upload-label:hover{ border-color: color-mix(in srgb,var(--ivy) 45%,transparent); }
  .ribbon-done:hover{ filter: brightness(1.06); }
}
@media (hover:none){
  .btn-gold:hover,.tile-cart-fab:hover,.edit-fab:hover,.design-card:hover{ transform:none; }
  .mem-gallery-item:hover img{ transform:none; }
}
.btn:active:not(:disabled),.btn-ghost-sm:active,.tile-cart-fab:active,.edit-fab:active,.tile-qty-btn:active,.design-card:active{
  transform: scale(.97); transition-duration: var(--dur-press);
}
.btn-gold:active:not(:disabled){ background-color: var(--btn-bg-press); box-shadow: var(--shadow-1); }
:focus{ outline:none; }
:focus-visible{ outline:none; box-shadow: var(--focus-ring); border-radius: inherit; }
.btn:focus-visible,.btn-ghost-sm:focus-visible{ box-shadow: var(--focus-ring); }
a:focus-visible{ border-radius: 4px; }
.input:focus,select.input:focus{ box-shadow:none; }
.input:focus-visible,.input:focus,select:focus{
  border-color: var(--ivy); background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--ivy) 20%,transparent);
}
.mem-ribbon :focus-visible, .app-tabbar :focus-visible {
  box-shadow: 0 0 0 2px #1c1c1e, 0 0 0 4px rgba(255,255,255,.85);
}
.btn:disabled,.btn[aria-disabled="true"],button:disabled,.input:disabled,select:disabled{
  opacity:.4; cursor:not-allowed; transform:none; box-shadow:none; pointer-events:none;
}
.input,select.input{ border-radius: var(--r-md); }
.panel,.design-card,.tile-cart-item{ border-radius: var(--r-lg); }
.qr-seg{ border-radius: var(--r-md); }
.auth-modal-dialog,.mem-sheet{ border-radius: var(--r-lg); }
a{ transition: color var(--dur-fast) var(--ease-out); text-underline-offset: .18em; }
.kicker{ color: color-mix(in srgb,var(--ivy) 80%,#000); }
.faq-item summary::after,.home-faq-item summary::after{ transition: transform var(--dur-base) var(--ease-out); }
.tile-cart{ transition: transform var(--dur-sheet) var(--ease-ios); }
.auth-modal-dialog{ transition: transform var(--dur-sheet) var(--ease-ios), opacity var(--dur-sheet) var(--ease-ios); }
.mem-carousel-track.is-animating,.mem-lightbox-track.is-animating{ transition: transform var(--dur-sheet) var(--ease-ios); }
@media (prefers-reduced-motion:reduce){ *{ animation:none!important; transition-duration:1ms!important; } }

/* ════════════════════════════════════════════════════════════════════════════
   Runde 14 — Gestalten am Handy neu
   Die Seite bleibt das große Bild. Unten ein Dock (5 Tabs), darüber bei Stil,
   Hintergrund und Bildern eine schmale Leiste (nur ihre Höhe ändert sich), bei
   Freigaben ein größeres Panel. Texte werden direkt auf der Seite angetippt;
   das Eingabefeld sitzt über der Tastatur. Desktop (≥768 px) bleibt Seitenleiste.
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --dock-h: 56px;
  --dock-gap: 10px;
  --edit-top-h: 48px;
  --insp-h: clamp(148px, 22vh, 200px);
  --insp-tall-h: min(52vh, 440px);
}

/* ── Scrollbehälter im Editor (body ist gesperrt, .page-wrap scrollt) ─────── */
body.is-editing .page-wrap {
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* Kein Abstand an body: der Platz für Leiste/Dock steckt im Scrollbehälter. */
body.is-editing.has-ribbon { padding-bottom: 0; }
@media (min-width: 768px) {
  body.is-editing .page-wrap {
    padding-bottom: calc(var(--ribbon-h, 4.5rem) + env(safe-area-inset-bottom, 0px));
  }
}

/* Platzhalter für leere Textstellen: nur im Handy-Editor sichtbar. */
.memorial-page [data-empty] { display: none; }


/* ── Footer hinter der unteren Leiste (nur Handy) ─────────────────────────── */
@media (max-width: 767px) {
  /* Leseansicht: Bottom-Nav (fixed). Abstand am Footer, nicht zusätzlich an body/page-wrap. */
  .has-app-tabbar .site-footer {
    padding-bottom: calc(var(--tabbar-h, 4.5rem) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  }
  /* Editor: Bottom-Nav bleibt ausgeblendet, das Dock ist die untere Leiste. */
  body.is-editing .site-footer {
    padding-bottom: calc(var(--dock-h) + var(--dock-gap) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  }
  body.is-editing .app-tabbar { display: none !important; }
  /* Der Inspektor liegt über der Seite: so viel mehr Scrollweg, damit sich alles darüber schieben lässt. */
  body.is-editing[data-insp="design"] { --insp-cur-h: calc(var(--insp-h) + 8px); }
  body.is-editing[data-insp="photos"] { --insp-cur-h: calc(var(--insp-photos-h, var(--insp-h)) + 8px); }
  body.is-editing[data-insp="bg"] { --insp-cur-h: calc(var(--insp-bg-h, var(--insp-h)) + 8px); }
  body.is-editing[data-insp="meta"] { --insp-cur-h: calc(var(--insp-meta-h, var(--insp-h)) + 8px); }
  body.is-editing[data-insp="inbox"] { --insp-cur-h: calc(var(--insp-inbox-h, var(--insp-tall-h)) + 8px); }
  body.is-editing .page-wrap {
    padding-top: calc(var(--edit-top-h) + env(safe-area-inset-top, 0px));
    padding-bottom: max(var(--insp-cur-h, 0px), var(--kb-pad, 0px));
  }
  /* Der (unsichtbare) Header würde im Editor sonst Platz im Fluss belegen. */
  /* site-header bleibt display:none (siehe oben); kein Platzhalter. */
}

/* ── Handy-Editor: Kopfleiste, Dock, Inspektor ────────────────────────────── */
@media (max-width: 767px) {
  body.is-editing.is-mobile-editor { overscroll-behavior: none; }

  .mem-edit-top {
    min-height: 0;
    height: calc(var(--edit-top-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 0.5rem 0;
    background: rgba(26, 26, 28, 0.94);
  }
  .mem-edit-top .ribbon-save { color: rgba(236, 232, 223, 0.86); }
  .mem-edit-top .ribbon-save[data-state="saving"] { color: #b6d3c2; }
  .mem-edit-top .ribbon-save[data-state="saved"]  { color: #a7dbb2; }
  .mem-edit-top .ribbon-save[data-state="error"]  { color: #ffb4b4; }

  .mem-ribbon {
    max-height: none;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    touch-action: manipulation;
  }
  .ribbon-mobile-chrome { display: none !important; }

  /* Dock: eigener, unbewegter Layer, immer antippbar. */
  body.is-editing .ribbon-bar {
    position: fixed;
    left: var(--dock-gap);
    right: var(--dock-gap);
    bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom, 0px));
    height: var(--dock-h);
    z-index: 80;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 4px;
    border-radius: 18px;
    background: rgba(26, 26, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
  }
  body.is-editing .ribbon-tools { display: none !important; }
  body.is-editing .ribbon-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    overflow: visible;
  }
  body.is-editing .ribbon-tabs .ribbon-tab {
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 2px 0;
    border-radius: 14px;
    color: rgba(236, 232, 223, 0.78);
    font-size: 0.62rem;
    line-height: 1.1;
    touch-action: manipulation;
  }
  body.is-editing .ribbon-tabs .ribbon-tab span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body.is-editing .ribbon-tabs .ribbon-tab svg { width: 20px; height: 20px; }
  body.is-editing .ribbon-tabs .ribbon-tab.is-on {
    background: rgba(184, 196, 176, 0.26);
    box-shadow: none;
    color: #fff;
  }

  /* Inspektor: fest über dem Dock, nur die Höhe ändert sich (kein Durchfahren der Tabs). */
  body.is-editing .mem-sheet {
    position: fixed;
    top: auto;
    left: var(--dock-gap);
    right: var(--dock-gap);
    bottom: calc(var(--dock-h) + var(--dock-gap) + env(safe-area-inset-bottom, 0px) + 8px);
    width: auto;
    max-height: none;
    height: 0;
    z-index: 78;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: none !important;
    will-change: height;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1c;   /* voll deckend: kein Seitentext scheint zwischen den Reihen durch */
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    transition:
      height var(--dur-base, 300ms) var(--ease-ios),
      opacity var(--dur-fast, 180ms) linear,
      visibility 0s linear var(--dur-base, 300ms);
  }
  body.is-editing[data-insp="design"] .mem-sheet,
  body.is-editing[data-insp="bg"] .mem-sheet,
  body.is-editing[data-insp="meta"] .mem-sheet,
  body.is-editing[data-insp="photos"] .mem-sheet {
    height: var(--insp-h);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
      height var(--dur-base, 300ms) var(--ease-ios),
      opacity var(--dur-fast, 180ms) linear,
      visibility 0s;
  }
  /* Hintergrund (vier Reihen) und Texte (Schalter + Reihenfolge) brauchen etwas mehr Höhe.
     Bilder: Inhaltshöhe (Miniaturen), kein Leerraum unter der Reihe. */
  body.is-editing[data-insp="bg"] .mem-sheet { height: var(--insp-bg-h, var(--insp-h)); }
  body.is-editing[data-insp="meta"] .mem-sheet { height: var(--insp-meta-h, var(--insp-h)); }
  body.is-editing[data-insp="photos"] .mem-sheet { height: var(--insp-photos-h, var(--insp-h)); }
  body.is-editing[data-insp="inbox"] .mem-sheet {
    height: var(--insp-inbox-h, var(--insp-tall-h));
    max-height: var(--insp-tall-h);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
      height var(--dur-base, 300ms) var(--ease-ios),
      opacity var(--dur-fast, 180ms) linear,
      visibility 0s;
  }
  /* Während der Höhenänderung nicht antippbar (bis transitionend); das Dock nie. */
  body.is-editing .mem-sheet.is-moving { pointer-events: none; }

  /* Kein Zieh-Sheet: Handle und Kopf nur bei Freigaben (Schließen). */
  body.is-editing .mem-sheet .sheet-handle,
  body.is-editing .mem-sheet .sheet-head { display: none; }
  body.is-editing[data-insp="inbox"] .mem-sheet .sheet-handle {
    display: block;
    box-sizing: content-box;
    margin: 0 auto;
    padding: 10px 40px 6px;
    background-clip: content-box;
    cursor: pointer;
    touch-action: manipulation;
  }
  body.is-editing[data-insp="inbox"] .mem-sheet .sheet-head {
    display: flex;
    padding: 0 0.75rem 0.4rem 1rem;
    touch-action: manipulation;
  }
  body.is-editing .mem-sheet .sheet-close { width: 44px; height: 44px; }

  body.is-editing .mem-sheet .sheet-body.ribbon-panels,
  body.is-editing .mem-sheet .ribbon-panels {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.is-editing .mem-sheet .ribbon-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
  }
  body.is-editing .mem-sheet .ribbon-panel[hidden] { display: none; }
  /* „Texte“: schmale Leiste mit Hinweis, Gästebuch-Schalter und Reihenfolge (Namensformular bleibt verborgen). */
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="meta"] { gap: 2px; padding: 2px 10px 4px; }
  body.is-editing .mem-sheet .meta-form-group { display: none; }
  body.is-editing .mem-sheet .meta-quick { display: flex; flex-direction: column; gap: 0; min-width: 0; }
  /* Hinweis: genau eine Zeile (16 px), nie umbrechen. */
  body.is-editing .mem-sheet .meta-quick-tip {
    margin: 0;
    padding: 0 2px;
    height: 16px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(236, 232, 223, 0.88);
    font-size: 0.8rem;
    line-height: 16px;
  }
  body.is-editing .mem-sheet .meta-order-group { padding: 0; }
  body.is-editing .mem-sheet .meta-order-group .ribbon-group-body { gap: 0; }
  body.is-editing .mem-sheet .section-order { width: 100%; min-width: 0; gap: 2px; }
  body.is-editing .mem-sheet .section-order li {
    height: 42px;
    min-height: 42px;
    padding: 0 0.3rem 0 0.75rem;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #f3efe6;
  }
  body.is-editing .mem-sheet .section-order li.is-muted { color: rgba(236, 232, 223, 0.8); background: transparent; border-style: dashed; opacity: 1; }
  body.is-editing .mem-sheet .section-order li.is-muted small { font-size: 0.74rem; opacity: 1; }
  body.is-editing .mem-sheet .section-order-btns { gap: 4px; }
  /* Zeile 42 px (40 px innen), Pfeile 44 px breit; die Tippfläche reicht per ::after auf 44 px Höhe. */
  body.is-editing .mem-sheet .section-order-btns button {
    position: relative;
    width: 44px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #f3efe6;
    touch-action: manipulation;
  }
  body.is-editing .mem-sheet .section-order-btns button::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: -2px; bottom: -2px;
  }
  body.is-editing .mem-sheet .section-order-btns button:disabled { opacity: 0.32; }
  body.is-editing .mem-sheet .gb-switch { min-height: 44px; width: 100%; font-size: 0.9rem; color: #f3efe6; }
  body.is-editing .mem-sheet .ribbon-group {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    gap: 6px;
  }
  body.is-editing .mem-sheet .ribbon-group-label { display: none; }
  body.is-editing .mem-sheet .ribbon-group-body { gap: 6px; min-width: 0; }

  /* Die Kette bis zur Reihe darf nie breiter werden als der Bildschirm (P1). */
  body.is-editing #memSheet,
  body.is-editing .mem-sheet .sheet-body,
  body.is-editing .mem-sheet .ribbon-panel,
  body.is-editing .mem-sheet .style-rows,
  body.is-editing .mem-sheet .ribbon-stack,
  body.is-editing .mem-sheet .ribbon-chips { min-width: 0; max-width: 100%; }

  /* Der Handy-Editor scrollt seitlich nie: weder die Seite noch das Sheet geben nach. */
  html:has(body.is-editing) { overflow: hidden; overscroll-behavior: none; }
  body.is-editing,
  body.is-editing .page-wrap,
  body.is-editing #memSheet,
  body.is-editing .mem-sheet .sheet-body,
  body.is-editing .mem-sheet .sheet-body.ribbon-panels {
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  /* Chips: waagerecht scrollen, nie umbrechen, nie senkrecht scrollen. */
  body.is-editing .mem-sheet .ribbon-chips {
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }
  body.is-editing .mem-sheet .ribbon-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 0.95rem;
    font-size: 0.85rem;
    color: #ece8df;
  }
  body.is-editing .mem-sheet .ribbon-chip.is-on { color: var(--ribbon-hi-ink, #12201a); }

  /*
   * Reihen (Stil und Hintergrund): zweispaltig. Links eine feste Beschriftung, die nie
   * mitscrollt und nie über Chips liegt; rechts die Spur, der einzige waagerechte Scrollport.
   */
  body.is-editing .mem-sheet .style-rows { gap: 0; width: 100%; }
  /* DOM-Reihenfolge ist Farbe, Akzent, Schrift (Desktop); am Handy bleibt es Farbe, Schrift, Akzent. */
  body.is-editing .mem-sheet .style-row.accent-swatches { order: 3; }
  /* Karten-/Namensteile der Desktop-Ansicht gibt es am Handy nicht. */
  body.is-editing .mem-sheet .theme-card-aa,
  body.is-editing .mem-sheet .theme-card-acc,
  body.is-editing .mem-sheet .theme-card-name,
  body.is-editing .mem-sheet .accent-name { display: none; }
  body.is-editing .mem-sheet .owner-upload-cta-desk { display: none; }
  body.is-editing .mem-sheet .style-row,
  body.is-editing .mem-sheet .opt-row {
    display: grid;
    grid-template-columns: 3.9rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    overflow: visible;
  }
  body.is-editing .mem-sheet .style-row-label {
    display: block;
    margin: 0;
    padding: 0 4px 0 2px;
    color: rgba(236, 232, 223, 0.86);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.15;
  }
  body.is-editing .mem-sheet .style-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 3px 6px 3px 3px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 18px), transparent);
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] {
    position: relative;
    padding-bottom: 12px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"]::after {
    content: '';
    position: sticky;
    bottom: 0;
    display: block;
    height: 16px;
    margin-top: -16px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, #1a1a1c 90%);
  }
  body.is-editing .mem-sheet .style-dot { width: 38px; height: 38px; flex: 0 0 auto; }
  /* Handy: „Eigene“ als Chip mit Kegelverlauf und Plus. */
  body.is-editing .mem-sheet .theme-card-custom,
  body.is-editing .mem-sheet .accent-dot-custom {
    position: relative;
    background:
      conic-gradient(
        from 180deg,
        hsl(0 70% 60%), hsl(60 70% 60%), hsl(120 70% 60%),
        hsl(180 70% 60%), hsl(240 70% 60%), hsl(300 70% 60%), hsl(360 70% 60%));
  }
  body.is-editing .mem-sheet .theme-card-custom.is-on,
  body.is-editing .mem-sheet .accent-dot-custom.is-on {
    background: var(--dot, #f5ece1);
  }
  body.is-editing .mem-sheet .theme-card-custom .theme-card-aa,
  body.is-editing .mem-sheet .theme-card-custom .theme-card-acc,
  body.is-editing .mem-sheet .theme-card-custom .theme-card-name,
  body.is-editing .mem-sheet .accent-dot-custom .accent-name { display: none; }
  body.is-editing .mem-sheet .theme-card-custom .style-dot-fill,
  body.is-editing .mem-sheet .accent-dot-custom .style-dot-fill {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.45);
  }
  body.is-editing .mem-sheet .theme-card-custom .theme-custom-plus {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: #1a1a1c;
    font-size: 1.15rem;
    font-weight: 600;
    pointer-events: none;
  }
  body.is-editing .mem-sheet .theme-card-custom.is-on .theme-custom-plus { color: var(--tc-ink, #1a1a1c); }

  /* Farbwähler: Stil-Zeilen aus, eigene Höhe ≤ ~200 px, kein vertikales Scrollen. */
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"].is-picking {
    padding: 6px 10px 10px;
    gap: 6px;
    overflow: hidden;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"].is-picking [data-style-main] {
    display: none !important;
  }
  body.is-editing[data-insp="design"].is-picking-color {
    /* Platzhalter: Höhe setzt JS über --insp-picker-h */
  }
  body.is-editing .mem-sheet .color-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-height: 188px;
    padding: 0;
    overflow: hidden;
  }
  body.is-editing .mem-sheet .color-picker[hidden] { display: none; }
  body.is-editing .mem-sheet .color-picker-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  body.is-editing .mem-sheet .color-picker-back {
    align-self: flex-start;
    min-height: 36px;
    padding: 0 0.4rem;
    border: 0;
    background: transparent;
    color: #f3efe6;
    font-size: 0.92rem;
    cursor: pointer;
  }
  body.is-editing .mem-sheet .color-hue {
    position: relative;
    width: 100%;
    height: 44px;
    border-radius: 12px;
    touch-action: none;
    cursor: pointer;
    background: linear-gradient(
      90deg,
      hsl(0 85% 55%), hsl(60 85% 55%), hsl(120 85% 55%),
      hsl(180 85% 55%), hsl(240 85% 55%), hsl(300 85% 55%), hsl(360 85% 55%)
    );
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  }
  body.is-editing .mem-sheet .color-hue::after {
    content: '';
    position: absolute;
    top: 4px; bottom: 4px;
    left: calc(var(--hue, 95) / 360 * 100%);
    width: 4px;
    margin-left: -2px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    pointer-events: none;
  }
  body.is-editing .mem-sheet .color-picker-hint {
    margin: 0;
    min-height: 20px;
    height: 20px;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgba(236, 232, 223, 0.88);
  }
  body.is-editing .mem-sheet .color-picker-back:focus-visible {
    outline: 2px solid var(--ed-accent, #c4a47c);
    outline-offset: -2px;
  }
  body.is-editing .mem-sheet .color-hex-field {
    flex-wrap: wrap;
  }
  body.is-editing .mem-sheet .color-hex-error,
  body.is-editing .mem-sheet .field-error.color-hex-error {
    flex-basis: 100%;
    width: 100%;
  }
  body.is-editing .mem-sheet .color-level {
    font-size: 0.72rem;
    white-space: nowrap;
  }
  body.is-editing .mem-sheet .accent-dot-custom {
    position: relative;
  }
  body.is-editing .mem-sheet .accent-dot-custom .style-dot-fill {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
  }
  body.is-editing .mem-sheet .accent-dot-custom .accent-name {
    position: absolute;
    left: 8px;
    bottom: 6px;
    right: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.is-editing .mem-sheet .color-levels {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
  }
  body.is-editing .mem-sheet .color-level {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(236, 232, 223, 0.86);
    font-size: 0.68rem;
    cursor: pointer;
  }
  body.is-editing .mem-sheet .color-level.is-on {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  body.is-editing .mem-sheet .color-level-swatch {
    display: grid;
    place-items: center;
    width: 100%;
    height: 28px;
    border-radius: 8px;
    background: var(--sw, #f5ece1);
    color: var(--sw-ink, #1a1a1c);
    font-family: var(--ed-font, serif);
    font-size: 0.9rem;
  }
  body.is-editing .mem-sheet .color-picker-hint {
    min-height: 2.7em;
    margin: 0;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
  }
  body.is-editing .mem-sheet .color-hex-err {
    margin: 0;
    font-size: 0.72rem;
    color: #e69494;
  }
  body.is-editing .mem-sheet .color-hex-input[aria-invalid="true"] {
    border-color: #e69494 !important;
  }
  body.is-editing .mem-sheet .color-hex-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  body.is-editing .mem-sheet .color-hex-toggle {
    min-height: 36px;
    padding: 0 0.6rem;
    border: 0;
    background: transparent;
    color: rgba(184, 196, 176, 0.95);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
  }
  body.is-editing .mem-sheet .color-hex-input {
    min-height: 36px;
    width: 7.5rem;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
  }
  body.is-editing .mem-sheet .color-native-fallback {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  body.is-editing .mem-sheet .font-chip {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 38px;
    height: 38px;
    padding: 0 0.85rem;
    border-radius: 19px;
  }
  body.is-editing .mem-sheet .font-chip em { font-size: 1rem; line-height: 1; }
  body.is-editing .mem-sheet .font-chip span { font-size: 0.68rem; opacity: 0.8; white-space: nowrap; }

  /* Hintergrund: Bild-Zeile, Lage, Abdunkeln. */
  body.is-editing .mem-sheet .bg-dropzone {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 0 8px;
    min-width: 0;
    width: 100%;
    padding: 4px 6px;
    border-radius: 12px;
  }
  body.is-editing .mem-sheet .bg-thumb { grid-row: auto; width: 44px; height: 34px; }
  body.is-editing .mem-sheet .bg-dropzone-text { min-width: 0; }
  body.is-editing .mem-sheet .bg-dropzone-text strong {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  body.is-editing .mem-sheet .bg-dropzone-text span { display: none; }
  body.is-editing .mem-sheet .bg-dropzone-acts { grid-column: 3; grid-row: 1; flex-wrap: nowrap; }
  body.is-editing .mem-sheet .bg-dropzone-acts .btn-ghost-sm { min-height: 36px; padding: 0 0.7rem; white-space: nowrap; }
  body.is-editing .mem-sheet .ribbon-stack { gap: 4px; }
  body.is-editing .mem-sheet .ribbon-slider { width: 100%; min-height: 30px; gap: 0.5rem; font-size: 0.78rem; color: rgba(236, 232, 223, 0.86); }
  body.is-editing .mem-sheet .ribbon-slider span { min-width: 5.4em; }
  body.is-editing .mem-sheet .ribbon-slider input[type="range"] { flex: 1; width: auto; min-height: 28px; }
  body.is-editing .mem-sheet .ribbon-slider output { min-width: 2.8em; }

  /* Bilder: beide Karten nebeneinander, Feineinstellung hinter „Anpassen“ */
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    overflow: hidden;
    min-width: 0;
    padding: 8px 10px 8px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-head-tiles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: none;
    min-width: 0;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-head-tiles > .ribbon-group-label {
    display: none;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    overflow: visible;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile--row {
    flex: none;
    width: auto;
    min-width: 0;
    max-height: none;
    min-height: 52px;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 6px;
    row-gap: 2px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f3efe6;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile--row .photo-tile-thumb {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    align-self: center;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile--row .photo-tile-title {
    grid-column: 2;
    font-size: 0.72rem;
    line-height: 1.15;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile--row .photo-tile-acts {
    grid-column: 2;
    justify-content: flex-start;
    gap: 0;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-tile-title,
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-icon-btn {
    color: #f3efe6;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-icon-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-icon-btn svg {
    width: 20px;
    height: 20px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-adjust-btn {
    display: flex;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-adjust:not(.is-open) .photo-hero-opts {
    display: none;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-adjust.is-open .photo-hero-opts {
    display: grid;
    gap: 2px;
    padding: 4px 0 2px;
    color: #f3efe6;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-hero-opts .ribbon-check {
    color: rgba(236, 232, 223, 0.92);
    font-size: 0.78rem;
    margin: 0;
    min-height: 34px;
    align-items: center;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-hero-opts .style-row-label {
    color: rgba(243, 239, 230, 0.9);
    font-size: 0.72rem;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-hero-opts .ribbon-slider {
    min-height: 30px;
    margin: 0;
    color: #f3efe6;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .photo-hero-opts .ribbon-chip {
    min-height: 34px;
    padding: 0 0.65rem;
  }
  body.is-editing .mem-sheet .photo-gallery-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: none;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body.is-editing .mem-sheet .photo-gallery-strip::-webkit-scrollbar { display: none; }
  body.is-editing .mem-sheet .photo-gallery-strip > .ribbon-group {
    display: contents;
  }
  body.is-editing .mem-sheet .photo-gallery-strip > .ribbon-group > .ribbon-group-label { display: none; }
  body.is-editing .mem-sheet .photo-gallery-strip .ribbon-group-body,
  body.is-editing .mem-sheet .photo-gallery-strip .owner-gallery { display: contents; }
  /* Sortieren per Ziehen */
  body.is-editing .mem-sheet .owner-gallery-card { position: relative; }
  body.is-editing .mem-sheet .owner-gallery-card img { -webkit-user-drag: none; pointer-events: auto; }
  body.is-editing .mem-sheet .owner-gallery-card.is-lifted {
    z-index: 5;
    transform: translate3d(var(--drag-x, 0px), 0, 0) scale(1.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 2px var(--ribbon-hi, #b8c4b0);
    transition: box-shadow var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  body.is-editing .mem-sheet .owner-gallery-card.is-settling {
    transition: transform 180ms var(--ease-out, ease), box-shadow 180ms var(--ease-out, ease);
  }
  body.is-editing .mem-sheet .ribbon-panel.is-reordering { touch-action: none; }
  @media (prefers-reduced-motion: reduce) {
    body.is-editing .mem-sheet .owner-gallery-card.is-lifted {
      transform: translate3d(var(--drag-x, 0px), 0, 0);
      transition: none;
    }
  }
  body.is-editing .mem-sheet .owner-gallery-card {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    cursor: pointer;
  }
  body.is-editing .mem-sheet .owner-gallery-card img { width: 100%; height: 100%; object-fit: cover; }
  body.is-editing .mem-sheet .owner-gallery-move,
  body.is-editing .mem-sheet .owner-gallery-del { display: none; }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .memorial-empty-hint {
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
    max-width: 11rem;
    font-size: 0.82rem;
    color: rgba(236, 232, 223, 0.8);
  }
  body.is-editing .mem-sheet .owner-upload {
    display: block;
    flex: 0 0 auto;
    width: 72px;
    min-width: 0;
    height: 72px;
  }
  body.is-editing .mem-sheet .owner-upload-actions { display: block; height: 100%; }
  body.is-editing .mem-sheet .owner-upload-pick.is-camera,
  body.is-editing .mem-sheet .owner-upload > input[name="caption"],
  body.is-editing .mem-sheet .owner-upload > button { display: none; }
  body.is-editing .mem-sheet .owner-upload-pick {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1.5px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
  }
  body.is-editing .mem-sheet .owner-upload-pick input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
  }
  body.is-editing .mem-sheet .owner-upload-cta {
    display: block;
    padding: 0 0.3rem;
    color: #f3efe6;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
  }

  /* Freigaben: größeres Panel, Warteschlange und „+ Eintrag schreiben“. */
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="inbox"] { padding: 4px 12px 14px; gap: 10px; }
  /* Leer: kompakt, damit das Panel etwa 240–280 px hoch wird. */
  body.is-editing .mem-sheet .inbox-empty { padding: 0.6rem 0.4rem; font-size: 0.86rem; line-height: 1.4; }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="inbox"] .ribbon-group-label { display: none; }
  body.is-editing .mem-sheet .inbox-write { width: 100%; min-height: 48px; justify-content: center; }
  @media (max-height: 700px) {
    body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="inbox"] .ribbon-hint { display: none; }
    body.is-editing .mem-sheet .inbox-empty { padding: 0.35rem 0.25rem; font-size: 0.8rem; }
  }
  body.is-editing .mem-sheet .inbox-card { max-width: none; }
  body.is-editing .mem-sheet .inbox-actions .btn-approve,
  body.is-editing .mem-sheet .inbox-actions .btn-reject { min-height: 44px; flex: 1; }
  body.is-editing .mem-sheet .inbox-msg { color: rgba(243, 239, 230, 0.92); }
  body.is-editing .mem-sheet .ribbon-hint { flex: 0 0 auto; max-width: none; color: rgba(236, 232, 223, 0.86); font-size: 0.82rem; }
}

/* ── Texte direkt auf der Seite ───────────────────────────────────────────── */
@media (max-width: 767px) {
  body.is-mobile-editor .memorial-page [data-inline-edit]:not(.memorial-avatar):not(.memorial-avatar-add) {
    cursor: pointer;
    border-radius: 8px;
    outline: 1.5px dashed transparent;
    outline-offset: 4px;
    -webkit-tap-highlight-color: rgba(184, 196, 176, 0.35);
    transition: outline-color var(--dur-fast, 160ms) var(--ease-out, ease), background-color var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  body.is-mobile-editor .memorial-page .memorial-avatar[data-inline-edit],
  body.is-mobile-editor .memorial-page .memorial-avatar-add[data-inline-edit] {
    cursor: pointer;
    border-radius: 50%;
    outline: 1.5px dashed transparent;
    outline-offset: 4px;
    -webkit-tap-highlight-color: rgba(184, 196, 176, 0.35);
  }
  /* Texte (mit schmaler Leiste oder ohne Inspektor): alle antippbaren Stellen sichtbar markieren. */
  body.is-mobile-editor:not([data-insp]) .memorial-page [data-inline-edit],
  body.is-mobile-editor[data-insp="meta"] .memorial-page [data-inline-edit] {
    outline-color: color-mix(in srgb, var(--mem-accent, #8a6b1e) 65%, transparent);
  }
  body.is-mobile-editor .memorial-page [data-inline-edit]:focus-visible {
    outline: 2px solid var(--mem-accent, #8a6b1e);
    box-shadow: none;
  }
  body.is-mobile-editor .memorial-page [data-inline-edit].is-composing-target {
    outline: 2px solid var(--mem-accent, #8a6b1e);
    background-color: color-mix(in srgb, var(--mem-accent, #8a6b1e) 12%, transparent);
  }
  body.is-mobile-editor .memorial-page [data-empty] { display: block; }
  body.is-mobile-editor .memorial-page [data-empty]::before {
    content: attr(data-placeholder);
    font-style: italic;
    color: inherit;
    opacity: 0.9;
  }
  body.is-mobile-editor [data-story-hint] { display: none; }
}

/* ── Eingabefeld über der Tastatur ────────────────────────────────────────── */
.mem-composer[hidden] { display: none; }
.mem-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: var(--composer-max, 60vh);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px 18px 0 0;
  background: #1a1a1c;
  color: #f3efe6;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.35);
  font-family: var(--sans, system-ui, sans-serif);
}
/* Mit Tastatur deckt sie den Home-Indikator schon ab. */
.mem-composer.has-kb { padding-bottom: 10px; }
/* Lesen am Handy: über der App-Leiste, bis das Skript die genaue Höhe setzt. */
@media (max-width: 767px) {
  body.has-app-tabbar:not(.is-editing) .mem-composer:not(.has-kb) {
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 768px) {
  .mem-composer {
    left: 50%;
    right: auto;
    width: min(560px, 96vw);
    transform: translateX(-50%);
  }
}
.mem-composer-head { display: flex; align-items: center; gap: 8px; }
.mem-composer-title { flex: 1; font-size: 0.88rem; font-weight: 600; color: #f3efe6; }
.mem-composer-count { font-size: 0.74rem; color: #d6d1c5; font-variant-numeric: tabular-nums; }
.mem-composer-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: transparent;
  color: #f3efe6;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.mem-composer-btn[hidden] { display: none; }
.mem-composer-btn.is-primary { border-color: transparent; background: #b8c4b0; color: #12201a; }
.mem-composer-btn:disabled { opacity: 0.55; }
.mem-composer-btn:focus-visible,
.mem-composer-input:focus-visible,
.mem-composer-file:focus-within {
  outline: 2px solid #b8c4b0;
  outline-offset: 2px;
  box-shadow: none;
}
.mem-composer-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mem-composer-field { display: flex; flex-direction: column; gap: 6px; }
.mem-composer-field[hidden] { display: none; }
.mem-composer-dates { flex-direction: row; gap: 10px; }
.mem-composer-dates > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mem-composer-sublabel { font-size: 0.78rem; color: #d6d1c5; }
.mem-composer-input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}
textarea.mem-composer-input { resize: none; max-height: 22vh; }
.mem-composer-file {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #f3efe6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.mem-composer-file[hidden] { display: none; }
.mem-composer-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mem-composer-profile { flex-direction: row; gap: 8px; }
.mem-composer-profile .mem-composer-file { flex: 1; }
.mem-composer-error { margin: 0; color: #ffb4b4; font-size: 0.84rem; line-height: 1.4; }
.mem-composer-error[hidden] { display: none; }

/* ── Felder: Hintergrund, Schrift, Cursor, Autofill und Datum fest gesetzt ────
   Nie vom Theme der Gedenkseite erben (--mem-panel/--mem-ink), nie vom hellen
   .input:focus (weiß) überschreiben lassen. Dunkle Felder: #f3efe6 auf #2a2a2e
   (≈ 11:1). Gästebuch (cremefarbenes Buch): #2a2118 auf #fffcf6 (≈ 15:1).     */
.ribbon-panel .input,
.ribbon-panel .textarea,
.mem-ribbon .input,
.mem-composer-input {
  background-color: #2a2a2e !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #f3efe6 !important;
  -webkit-text-fill-color: #f3efe6;
  caret-color: #f3efe6;
  color-scheme: dark;
}
.ribbon-panel .input:focus,
.ribbon-panel .textarea:focus,
.ribbon-panel .input:focus-visible,
.mem-ribbon .input:focus,
.mem-composer-input:focus {
  background-color: #2a2a2e !important;
  border-color: #b8c4b0 !important;
  color: #f3efe6 !important;
  -webkit-text-fill-color: #f3efe6;
  box-shadow: 0 0 0 3px rgba(184, 196, 176, 0.35);
}
.ribbon-panel .input::placeholder,
.ribbon-panel .textarea::placeholder,
.mem-composer-input::placeholder {
  color: #a9a498;
  -webkit-text-fill-color: #a9a498;
  opacity: 1;
}
.ribbon-panel .input:-webkit-autofill,
.ribbon-panel .input:-webkit-autofill:hover,
.ribbon-panel .input:-webkit-autofill:focus,
.ribbon-panel .input:-webkit-autofill:active,
.mem-composer-input:-webkit-autofill,
.mem-composer-input:-webkit-autofill:hover,
.mem-composer-input:-webkit-autofill:focus,
.mem-composer-input:-webkit-autofill:active {
  -webkit-text-fill-color: #f3efe6 !important;
  caret-color: #f3efe6;
  -webkit-box-shadow: 0 0 0 1000px #2a2a2e inset !important;
  box-shadow: 0 0 0 1000px #2a2a2e inset !important;
  transition: background-color 600000s 0s, color 600000s 0s;
}
.ribbon-panel input[type="date"],
.mem-composer-input[type="date"] { color-scheme: dark; min-height: 44px; }
.ribbon-panel input[type="date"]::-webkit-datetime-edit,
.ribbon-panel input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.mem-composer-input[type="date"]::-webkit-datetime-edit,
.mem-composer-input[type="date"]::-webkit-datetime-edit-fields-wrapper { color: #f3efe6; -webkit-text-fill-color: #f3efe6; }
/* color-scheme: dark liefert schon ein helles Symbol — keine pauschale Invertierung. */
.ribbon-panel input[type="date"]::-webkit-calendar-picker-indicator,
.mem-composer-input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.85;
  filter: none;
}
.ribbon-panel .form-label,
.ribbon-panel .toggle-label { color: rgba(236, 232, 223, 0.86); }

.guestbook-book .input,
.guestbook-book .textarea,
.guestbook-book .guestbook-form .input,
.guestbook-book .guestbook-form .textarea {
  background-color: #fffcf6 !important;
  border-color: rgba(90, 70, 45, 0.5) !important;
  color: #2a2118 !important;
  -webkit-text-fill-color: #2a2118;
  caret-color: #2a2118;
  color-scheme: light;
}
.guestbook-book .input:focus,
.guestbook-book .textarea:focus,
.guestbook-book .input:focus-visible {
  background-color: #fffcf6 !important;
  border-color: #8a6a45 !important;
  color: #2a2118 !important;
  -webkit-text-fill-color: #2a2118;
  box-shadow: 0 0 0 3px rgba(138, 106, 69, 0.28);
}
.guestbook-book .input::placeholder,
.guestbook-book .textarea::placeholder {
  color: #6f6150;
  -webkit-text-fill-color: #6f6150;
  opacity: 1;
}
.guestbook-book .input:-webkit-autofill,
.guestbook-book .input:-webkit-autofill:hover,
.guestbook-book .input:-webkit-autofill:focus,
.guestbook-book .input:-webkit-autofill:active {
  -webkit-text-fill-color: #2a2118 !important;
  caret-color: #2a2118;
  -webkit-box-shadow: 0 0 0 1000px #fffcf6 inset !important;
  box-shadow: 0 0 0 1000px #fffcf6 inset !important;
  transition: background-color 600000s 0s, color 600000s 0s;
}
.guestbook-book .guestbook-form .form-label { color: #4a3d2e; }
.guestbook-book .guestbook-note { color: #6f6150; }

/* ── Gästebuch: eigene Einträge ───────────────────────────────────────────── */
.owner-entry-add { display: none; margin: 0.9rem auto 0; }
body.is-editing .owner-entry-add { display: inline-flex; }
.owner-entry-actions { display: none; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
body.is-editing .owner-entry-actions { display: flex; }
.guestbook-book .owner-entry-actions .btn-ghost-sm {
  min-height: 40px;
  border-color: rgba(90, 70, 45, 0.45);
  background: transparent;
  color: #4a3d2e;
}
.guestbook-book .owner-entry-actions .btn-ghost-sm.is-danger { color: #9a2f2f; border-color: rgba(154, 47, 47, 0.45); }

/* ── Action-Sheet (Dialog mit Fokusfang) ──────────────────────────────────── */
.mem-actionsheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mem-actionsheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 9, 0.5);
  animation: mem-as-fade var(--dur-base, 240ms) var(--ease-out, ease);
}
.mem-actionsheet-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 20px));
  margin: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  padding: 14px;
  border-radius: 18px;
  background: #1f1f22;
  color: #f3efe6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-family: var(--sans, system-ui, sans-serif);
  animation: mem-as-rise var(--dur-sheet, 420ms) var(--ease-ios, ease);
}
@media (min-width: 768px) {
  .mem-actionsheet { align-items: center; }
  .mem-actionsheet-panel { margin: 0; }
}
.mem-as-title { margin: 0; font-size: 1rem; font-weight: 600; text-align: center; color: #f3efe6; }
.mem-as-message { margin: 0 0 4px; text-align: center; font-size: 0.88rem; line-height: 1.45; color: #d6d1c5; }
.mem-as-btn {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #f3efe6;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
.mem-as-btn.is-danger { color: #ffb4b4; }
.mem-as-btn.is-cancel { background: #f3efe6; color: #1a1a1c; font-weight: 600; }
.mem-as-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #1f1f22, 0 0 0 4px #fff; }
@keyframes mem-as-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mem-as-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ════════════════════════════════════════════════════════════════════════════
   Runde 15 — Nachzüge: Reihen, Schalter, Fußzeile, Bilder sortieren
   ════════════════════════════════════════════════════════════════════════════ */

/* Eingeblendet/ausgeblendet per [hidden] gewinnt immer (Gästebuch-Schalter, Hinweise). */
.guestbook-book[hidden],
[data-gb-when][hidden],
[data-gb-link][hidden] { display: none !important; }

/* Gästebuch-Schalter (Texte, Freigaben, Desktop-Formular): Eingabe unsichtbar, Spur sichtbar. */
.gb-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  cursor: pointer;
}
.gb-switch .toggle-track { width: 46px; height: 28px; flex: none; }
.gb-switch .toggle-thumb { top: 3px; left: 3px; width: 20px; height: 20px; }
.gb-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.gb-switch input:focus-visible + .toggle-track { box-shadow: 0 0 0 2px #1c1c1e, 0 0 0 4px rgba(255, 255, 255, 0.85); }
.ribbon-panel .toggle-track {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
}
.ribbon-panel .toggle-thumb { background: #fff; border-color: transparent; }
.ribbon-panel .toggle-label input:checked + .toggle-track {
  background: var(--ribbon-hi, #b8c4b0);
  border-color: transparent;
}
.ribbon-panel .toggle-label input:checked + .toggle-track .toggle-thumb { border-color: transparent; }
.ribbon-panel .gb-switch-text { font-size: 0.9rem; color: #f3efe6; }
.section-order li.is-muted { opacity: 1; color: rgba(236, 232, 223, 0.78); }
.section-order-name small { opacity: 1; font-size: 0.85em; }
.section-order-btns button:disabled { opacity: 0.32; cursor: default; }

/* Desktop: Beschriftung über den Chip-Reihen im Hintergrund-Panel (Lage / Einpassen). */
@media (min-width: 768px) {
  .opt-row .style-row-label {
    display: block;
    margin: 0.1rem 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(236, 232, 223, 0.7);
  }
  .section-order-btns button { cursor: pointer; }
}

/* Handy: Reihen der Hintergrund-Leiste etwas enger, damit vier Zeilen ohne Scrollen passen. */
@media (max-width: 767px) {
  body.is-editing .mem-sheet .opt-row .style-track { padding: 1px 6px 1px 3px; }
}

/* Fußzeile in der Leseansicht am Handy: undurchsichtig, über dem festen Titelbild. */
@media (max-width: 767px) {
  .site-footer { position: relative; z-index: 1; }
  body:has(.memorial-page) .site-footer {
    background: var(--mem-bg, #f7f1e4);
    border-top: 1px solid var(--mem-rule, rgba(60, 50, 30, 0.18));
  }
  body:has(.memorial-page) .site-footer {
    border-top-color: rgba(255, 255, 255, 0.14);
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   Runde 16 — Gestalten am Desktop neu (≥ 768 px): feste Seitenleiste rechts
   Der Inspektor reicht von oben bis zur Werkzeugleiste (kein schwebendes Kärtchen).
   Die Seite daneben bekommt padding-right in Inspektorbreite und bleibt live sichtbar.
   Handy-Regeln stehen unverändert in den (max-width: 767px)-Blöcken weiter oben.
   ════════════════════════════════════════════════════════════════════════════ */
:root { --inspector-w: clamp(340px, 28vw, 420px); }

/* Grüne Knöpfe im Panel und im Gästebuch: dunkle Schrift auf hellem Grün (≈ 8:1) bzw. dunkleres Grün mit Weiß (≥ 4,5:1). */
.ribbon-panel .btn-gold,
.mem-sheet .btn-gold {
  background: var(--ribbon-hi, #b8c4b0);
  background-image: none;
  color: var(--ribbon-hi-ink, #12201a);
  border-color: transparent;
  box-shadow: none;
  font-weight: 600;
}
.ribbon-panel .btn-gold:hover,
.mem-sheet .btn-gold:hover { background-color: #a8cbb6; box-shadow: none; }
.ribbon-panel .btn-gold:active:not(:disabled),
.mem-sheet .btn-gold:active:not(:disabled) { background-color: #86ad96; box-shadow: none; }
.owner-entry-add {
  --btn-bg: color-mix(in srgb, var(--ivy, #3a4a3e) 74%, #000);
  --btn-bg-hover: color-mix(in srgb, var(--ivy, #3a4a3e) 64%, #000);
  --btn-bg-press: color-mix(in srgb, var(--ivy, #3a4a3e) 56%, #000);
  color: #fff;
}
.inbox-write { color: var(--ribbon-hi-ink, #12201a); }

/* Titelbild liegt unter dem Textblock. Leere Fläche öffnet „Bilder“,
   Name, Daten, Ort, Zitat, Porträt und der Gästebuch-Knopf bleiben eigene Ziele.
   Nur im Editor — die veröffentlichte Seite ändert sich nicht. */
body.is-editing .memorial-hero-body,
body.is-editing .memorial-hero-text,
body.is-editing .memorial-hero .mem-ornament {
  pointer-events: none;
}
body.is-editing .memorial-hero-body [data-inline-edit],
body.is-editing .memorial-hero-body a,
body.is-editing .memorial-hero-body button {
  pointer-events: auto;
}

/* Karten-Teile (nur Desktop sichtbar) */
.theme-card-aa, .theme-card-acc, .theme-card-name, .accent-name { display: none; }
.owner-upload-cta-desk { display: none; }
body.is-photo-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }

@media (min-width: 768px) {
  /* ── Seite neben dem Inspektor ───────────────────────────────────────────── */
  body.is-editing .page-wrap {
    transition: padding-right var(--dur-sheet, 420ms) var(--ease-ios, ease);
  }
  body.is-editing.has-inspector .page-wrap { padding-right: var(--inspector-w); }
  /* Schmalere Restbreite (768–1000 px): Hero einspaltig, wie am Handy. */
}
@media (min-width: 768px) and (max-width: 1000px) {
  body.is-editing.has-inspector .hero-split .memorial-hero-body {
    grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 1.6rem;
  }
  body.is-editing.has-inspector .hero-split .memorial-hero-text { align-items: center; }
  body.is-editing.has-inspector .hero-split .memorial-avatar { max-width: 220px; }
}

@media (min-width: 768px) {
  /* ── Der Inspektor: volle Höhe, nur translateX ────────────────────────────── */
  .mem-sheet {
    left: auto; right: 0; top: 0;
    /* 4 px Lücke zur Toolbar schließen (gemessen: Seite schien dazwischen durch). */
    bottom: calc(var(--ribbon-h, 56px) - 4px);
    width: var(--inspector-w);
    height: auto;
    max-height: none;
    border-radius: 0;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1c;
    box-shadow: -14px 0 36px rgba(0, 0, 0, 0.28);
    transform: translateX(100%);
    visibility: hidden;
    will-change: transform;
    transition:
      transform var(--dur-sheet, 420ms) var(--ease-ios, ease),
      visibility 0s linear var(--dur-sheet, 420ms);
  }
  .mem-sheet.is-open {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform var(--dur-sheet, 420ms) var(--ease-ios, ease),
      visibility 0s linear 0s;
  }
  .sheet-handle { display: none; }

  /* Kopf bleibt oben stehen; nur .sheet-body scrollt. */
  .mem-sheet .sheet-head {
    position: sticky; top: 0; z-index: 4;
    flex: 0 0 auto;
    padding: 0.8rem 1.1rem 0.7rem;
    background: #1a1a1c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    touch-action: auto;
  }
  .mem-sheet .sheet-title { font-size: 1.05rem; }
  .mem-sheet .sheet-close { width: 40px; height: 40px; font-size: 1.3rem; }

  body.is-editing .mem-sheet .sheet-body,
  body.is-editing .mem-sheet .sheet-body.ribbon-panels,
  .mem-sheet .sheet-body.ribbon-panels {
    container-type: inline-size;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: transparent;
    border-top: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  }
  .mem-sheet .sheet-body::-webkit-scrollbar { display: block; width: 8px; }
  .mem-sheet .sheet-body::-webkit-scrollbar-track { background: transparent; }
  .mem-sheet .sheet-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.28); border-radius: 8px; }
  .mem-sheet .sheet-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.42); }
  /* 16-px-Verlauf oben und unten: zeigt, dass mehr kommt (liegt über dem Polster, nie über dem Text am Anfang/Ende). */
  .mem-sheet .sheet-body::before,
  .mem-sheet .sheet-body::after {
    content: '';
    display: block;
    position: sticky;
    z-index: 3;
    height: 16px;
    pointer-events: none;
  }
  .mem-sheet .sheet-body::before { top: 0; margin-bottom: -16px; background: linear-gradient(#1a1a1c, rgba(26, 26, 28, 0)); }
  .mem-sheet .sheet-body::after { bottom: 0; margin-top: -16px; background: linear-gradient(rgba(26, 26, 28, 0), #1a1a1c); }

  /* ── Eine Spalte ─────────────────────────────────────────────────────────── */
  body.is-editing .mem-sheet .ribbon-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    padding: 1rem 1.1rem 1.75rem;
  }
  body.is-editing .mem-sheet .ribbon-panel[hidden] { display: none; }
  .mem-sheet .ribbon-group {
    width: 100%;
    min-width: 0;
    padding: 0;
    border-right: 0;
  }
  .mem-sheet .ribbon-group.is-wide { flex: none; }
  .mem-sheet .ribbon-group + .ribbon-group {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
  }
  .mem-sheet .ribbon-group-label {
    display: block;
    margin: 0 0 0.6rem;
    font-size: 0.86rem;
    color: rgba(236, 232, 223, 0.88);
  }
  .mem-sheet .ribbon-group-body { flex: 0 0 auto; width: 100%; min-width: 0; }
  .mem-sheet .ribbon-hint { max-width: none; flex: 0 0 auto; }

  /* ── Texte ───────────────────────────────────────────────────────────────── */
  .mem-sheet .meta-form { flex-direction: column; flex-wrap: nowrap; gap: 0.6rem; width: 100%; }
  .mem-sheet .meta-grid {
    grid-template-columns: 1fr 1fr;   /* nur die Daten stehen nebeneinander */
    gap: 0.95rem 0.75rem;
  }
  .mem-sheet .meta-grid .form-group { grid-column: 1 / -1; min-width: 0; margin: 0; }
  .mem-sheet .meta-grid .form-group.is-half { grid-column: auto; }
  .mem-sheet .meta-grid .form-label { display: block; margin: 0 0 0.35rem; }
  .mem-sheet .meta-grid .input { width: 100%; min-width: 0; }
  .mem-sheet .meta-grid input[aria-invalid="true"] { border-color: #ffb4b4 !important; }
  /* Datumsfelder: Jahr und Icon müssen in 340-px-Inspektor passen (Chrome + Firefox). */
  .mem-sheet .ribbon-panel input[type="date"] {
    padding-inline: 12px 8px;
    font-size: 0.94rem;
  }
  .mem-sheet .ribbon-panel input[type="date"]::-webkit-calendar-picker-indicator {
    margin-inline-start: 2px;
  }
  /* Schmaler Inspector: Daten untereinander, damit „08/02/2024“ / „02.08.2024“ vollständig bleibt. */
  @container (max-width: 360px) {
    .mem-sheet .meta-grid { grid-template-columns: 1fr; }
    .mem-sheet .meta-grid .form-group.is-half { grid-column: 1 / -1; }
  }
  @media (max-width: 1100px) {
    .mem-sheet .meta-grid { grid-template-columns: 1fr; }
    .mem-sheet .meta-grid .form-group.is-half { grid-column: 1 / -1; }
  }
  .meta-profile-row { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.1rem; }
  .meta-profile-thumb {
    flex: none;
    display: grid; place-items: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07) center / cover no-repeat;
    color: rgba(236, 232, 223, 0.78);
  }
  .meta-profile-thumb svg { width: 24px; height: 24px; }
  .mem-sheet .meta-file-btn { min-height: 44px; padding: 0 1rem; }
  .mem-sheet .meta-file-btn:hover { background: rgba(255, 255, 255, 0.12); }
  .mem-sheet .meta-file-btn:focus-within { outline: 2px solid var(--ribbon-hi, #b8c4b0); outline-offset: 2px; }
  .mem-sheet .meta-gb-row { padding-top: 0.2rem; }
  .mem-sheet .section-order { min-width: 0; width: 100%; gap: 0.4rem; }
  .mem-sheet .section-order li {
    min-height: 44px;
    padding: 0.3rem 0.5rem 0.3rem 0.8rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
    color: #f3efe6;
  }
  .mem-sheet .section-order li.is-muted { background: transparent; border-style: dashed; color: rgba(236, 232, 223, 0.8); }
  .mem-sheet .section-order-btns button { width: 34px; height: 34px; color: #f3efe6; font-size: 1rem; }
  .mem-sheet .gb-switch { width: 100%; }

  /* ── Stil: Seitenfarbe als Karten, Akzente mit Namen, Schrift als Raster ─────── */
  .mem-sheet .style-rows { gap: 0.6rem; }
  .mem-sheet .style-rows > .ribbon-group-label:not(:first-child) {
    margin-top: 0.9rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
  }
  .mem-sheet .style-row { display: block; }
  .mem-sheet .style-row:not(.opt-row) > .style-row-label { display: none; }
  .mem-sheet .style-track { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; }

  .mem-sheet #themeSwatches .style-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .mem-sheet #themeSwatches .theme-card-custom {
    grid-column: 1 / -1;
    height: 52px;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    background:
      linear-gradient(90deg,
        hsl(0 70% 70%), hsl(60 70% 70%), hsl(120 70% 70%),
        hsl(180 70% 70%), hsl(240 70% 70%), hsl(300 70% 70%), hsl(360 70% 70%));
  }
  .mem-sheet #themeSwatches .theme-card-custom.is-on {
    background: var(--dot, #f5ece1);
  }
  .mem-sheet #themeSwatches .theme-card-custom .theme-card-aa { font-size: 1.25rem; }
  .mem-sheet #themeSwatches .theme-card-custom:not(.is-on) .theme-card-aa,
  .mem-sheet #themeSwatches .theme-card-custom:not(.is-on) .theme-card-acc { display: none; }
  .mem-sheet #themeSwatches .theme-card-custom .theme-custom-plus { display: none; }
  .mem-sheet .accent-dot-custom .style-dot-fill {
    background:
      conic-gradient(
        hsl(0 70% 55%), hsl(60 70% 55%), hsl(120 70% 55%),
        hsl(180 70% 55%), hsl(240 70% 55%), hsl(300 70% 55%), hsl(360 70% 55%));
  }
  .mem-sheet .accent-dot-custom.is-on .style-dot-fill {
    background: var(--dot, #8a6b1e);
  }
  /* Desktop-Farbwähler (gleiche Struktur wie am Handy). */
  .mem-sheet .color-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 0.2rem 0 0.4rem;
  }
  .mem-sheet .color-picker[hidden] { display: none !important; }
  .mem-sheet .color-picker-back {
    align-self: flex-start;
    min-height: 36px;
    padding: 0 0.35rem;
    border: 0;
    background: transparent;
    color: #f3efe6;
    font-size: 0.95rem;
    cursor: pointer;
  }
  .mem-sheet .color-hue {
    position: relative;
    width: 100%;
    height: 44px;
    border-radius: 12px;
    touch-action: none;
    cursor: pointer;
    background: linear-gradient(
      90deg,
      hsl(0 85% 55%), hsl(60 85% 55%), hsl(120 85% 55%),
      hsl(180 85% 55%), hsl(240 85% 55%), hsl(300 85% 55%), hsl(360 85% 55%)
    );
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  }
  .mem-sheet .color-hue::after {
    content: '';
    position: absolute;
    top: 4px; bottom: 4px;
    left: calc(var(--hue, 95) / 360 * 100%);
    width: 4px;
    margin-left: -2px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    pointer-events: none;
  }
  .mem-sheet .color-picker-hint {
    margin: 0;
    min-height: 2.7em;
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgba(236, 232, 223, 0.88);
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .mem-sheet .color-levels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .mem-sheet .color-picker[data-picker-mode="accent"] .color-levels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mem-sheet .color-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(236, 232, 223, 0.86);
    font-size: 0.78rem;
    cursor: pointer;
  }
  .mem-sheet .color-level.is-on {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .mem-sheet .color-level-swatch {
    display: grid;
    place-items: center;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: var(--sw, #f5ece1);
    color: var(--sw-ink, #1a1a1c);
    font-family: var(--ed-font, serif);
    font-size: 1rem;
  }
  .mem-sheet .color-hex-wrap { display: flex; align-items: center; gap: 10px; }
  .mem-sheet .color-hex-toggle {
    min-height: 36px;
    padding: 0 0.5rem;
    border: 0;
    background: transparent;
    color: rgba(184, 196, 176, 0.95);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
  }
  .mem-sheet .color-hex-input {
    min-height: 36px;
    width: 8rem;
    font-family: ui-monospace, monospace;
  }
  .mem-sheet .color-hex-field:not([hidden]) { display: inline-flex; }
  .mem-sheet .color-native-fallback {
    position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  }
  .mem-sheet .style-dot.theme-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    height: 84px;
    padding: 9px 11px 8px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: var(--dot, #f5ece1);
    color: var(--tc-ink, #1a1a1c);
    text-align: left;
    overflow: hidden;
    box-shadow: none;
  }
  .mem-sheet .style-dot.theme-card:hover { border-color: rgba(255, 255, 255, 0.5); }
  .mem-sheet .style-dot.theme-card .style-dot-fill { display: none; }
  .mem-sheet .theme-card-aa {
    display: block;
    font-family: var(--ed-font, var(--serif, serif));
    font-size: 1.6rem;
    line-height: 1;
    color: var(--tc-ink, #1a1a1c);
  }
  .mem-sheet .theme-card-acc {
    display: block;
    position: absolute; top: 11px; right: 11px;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--ed-accent, #8a6b1e);
    box-shadow: 0 0 0 1px var(--tc-ink, #1a1a1c), 0 0 0 2px rgba(255, 255, 255, 0.35);
  }
  .mem-sheet .theme-card-name {
    display: block;
    font-family: var(--sans, system-ui, sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--tc-ink, #1a1a1c);
  }
  .mem-sheet .style-dot.theme-card.is-on { border-color: var(--ribbon-hi, #b8c4b0); box-shadow: none; }
  .mem-sheet .style-dot.theme-card.is-on::after {
    inset: auto 8px 7px auto;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--ribbon-hi, #b8c4b0);
    color: #12201a;
    font-size: 0.72rem;
    text-shadow: none;
  }
  /* „Eigene“: Häkchen und Akzentpunkt rechts oben, Name nicht überdecken. */
  .mem-sheet #themeSwatches .theme-card-custom {
    padding-right: 2.4rem;
  }
  .mem-sheet #themeSwatches .theme-card-custom .theme-card-acc {
    top: 8px; right: 8px;
  }
  .mem-sheet #themeSwatches .theme-card-custom.is-on::after {
    inset: 8px 8px auto auto;
    top: 8px; right: 8px; bottom: auto; left: auto;
  }
  .mem-sheet #themeSwatches .theme-card-custom.is-on .theme-card-acc {
    right: 34px;
  }
  .mem-sheet #themeSwatches .theme-card-custom .theme-card-name {
    max-width: calc(100% - 0.5rem);
    overflow: visible;
    white-space: nowrap;
  }

  .mem-sheet .accent-swatches .style-track {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .mem-sheet .style-dot.accent-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    height: auto;
    min-width: 0;
    padding: 3px 0 2px;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
  }
  .mem-sheet .style-dot.accent-dot .style-dot-fill {
    width: 40px; height: 40px;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.35);   /* löst die dunklen Akzente vom Grund */
  }
  .mem-sheet .accent-name {
    display: block;
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.74rem;
    line-height: 1.2;
    color: rgba(236, 232, 223, 0.86);
  }
  .mem-sheet .style-dot.accent-dot.is-on { border: 0; box-shadow: none; }
  .mem-sheet .style-dot.accent-dot.is-on .style-dot-fill { box-shadow: 0 0 0 2px #1a1a1c, 0 0 0 4px #fff; }
  .mem-sheet .style-dot.accent-dot.is-on .accent-name { color: #fff; font-weight: 600; }
  .mem-sheet .style-dot.accent-dot.is-on::after {
    inset: 3px auto auto 50%;
    width: 40px; height: 40px;
    margin-left: -20px;
    border-radius: 50%;
    color: #fff;                                 /* Akzente sind dunkel: weißes Häkchen */
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.75);
  }
  /* Eigene-Akzent: Name links, Punkt + Häkchen rechts oben (6 px Abstand) */
  .mem-sheet .accent-dot-custom {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.35rem;
    min-height: 64px;
    padding: 0.45rem 0.55rem 0.4rem;
  }
  .mem-sheet .accent-dot-custom .accent-name {
    position: static;
    text-align: left;
    align-self: end;
  }
  .mem-sheet .accent-dot-custom .style-dot-fill {
    width: 18px; height: 18px;
    justify-self: end;
    align-self: start;
    margin: 0;
  }
  .mem-sheet .accent-dot-custom.is-on::after {
    inset: 4px 4px auto auto;
    width: 18px; height: 18px;
    margin: 0;
    margin-right: 24px; /* 18px Punkt + 6px Abstand */
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 0.7rem;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.75);
  }

  .mem-sheet .font-picks .style-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .mem-sheet .font-chip {
    width: 100%;
    min-width: 0;
    min-height: 68px;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    align-items: flex-start;
  }
  .mem-sheet .font-chip em { font-size: 1.5rem; line-height: 1.15; }
  .mem-sheet .font-chip span { font-size: 0.75rem; opacity: 1; color: rgba(236, 232, 223, 0.82); }
  .mem-sheet .font-chip.is-on { border-color: var(--ribbon-hi, #b8c4b0); box-shadow: 0 0 0 1px var(--ribbon-hi, #b8c4b0); }

  /* ── Hintergrund: eine Spalte ─────────────────────────────────────────────── */
  .mem-sheet .bg-dropzone {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.55rem 0.85rem;
    min-width: 0;
    width: 100%;
    padding: 0.7rem;
  }
  .mem-sheet .bg-thumb { grid-row: auto; width: 96px; height: 64px; border-radius: 8px; }
  .mem-sheet .bg-dropzone-text { min-width: 0; }
  .mem-sheet .bg-dropzone-text strong { font-size: 0.88rem; }
  .mem-sheet .bg-dropzone-acts { grid-column: 1 / -1; flex-wrap: wrap; }
  .mem-sheet .bg-dropzone-acts .btn-ghost-sm { min-height: 40px; padding: 0 1rem; }
  .mem-sheet .ribbon-group-body.ribbon-stack { gap: 0.9rem; }
  .mem-sheet .opt-row { display: block; width: 100%; }
  .mem-sheet .opt-row .style-row-label { font-size: 0.78rem; color: rgba(236, 232, 223, 0.86); }
  .mem-sheet .opt-row .style-track { gap: 0.35rem; }
  .mem-sheet .ribbon-chip { min-height: 38px; padding: 0 0.95rem; }
  .mem-sheet .ribbon-slider { width: 100%; min-height: 36px; font-size: 0.8rem; }
  .mem-sheet .ribbon-slider span { min-width: 6em; }
  .mem-sheet .ribbon-slider input[type="range"] { flex: 1; width: auto; }

  .mem-sheet .photo-hero-opts .ribbon-check,
  .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .ribbon-check {
    color: rgba(236, 232, 223, 0.92);
  }
  .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] .ribbon-group-label,
  .mem-sheet .ribbon-panel[data-ribbon-panel="photos"] [data-photo-title] {
    color: rgba(243, 239, 230, 0.95);
  }

  /* ── Bilder: Miniaturraster, Ablagefläche ─────────────────────────────────── */
  .mem-sheet .owner-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
  }
  .mem-sheet .owner-gallery .memorial-empty-hint { grid-column: 1 / -1; margin: 0; }
  .mem-sheet .owner-gallery-card {
    position: relative;
    width: auto;
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: grab;
    -webkit-user-select: none; user-select: none;
  }
  .mem-sheet .owner-gallery-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    cursor: inherit;
  }
  /* Pfeile und Entfernen: nur bei Hover oder Fokus (Tastaturweg bleibt), 28 px. */
  .mem-sheet .owner-gallery-move,
  .mem-sheet .owner-gallery-del {
    position: absolute;
    display: flex;
    gap: 3px;
    padding: 0;
    opacity: 0;
    transition: opacity var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  .mem-sheet .owner-gallery-move { left: 4px; bottom: 4px; }
  .mem-sheet .owner-gallery-del { top: 4px; right: 4px; }
  .mem-sheet .owner-gallery-card:hover .owner-gallery-move,
  .mem-sheet .owner-gallery-card:hover .owner-gallery-del,
  .mem-sheet .owner-gallery-card:focus-within .owner-gallery-move,
  .mem-sheet .owner-gallery-card:focus-within .owner-gallery-del { opacity: 1; }
  .mem-sheet .owner-gallery-move button,
  .mem-sheet .owner-del {
    flex: none;
    width: 28px; height: 28px;
    padding: 0;
    display: grid; place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(20, 20, 22, 0.86);
    color: #f3efe6;
    font-size: 0.85rem;
    line-height: 1;
  }
  .mem-sheet .owner-del { border-radius: 50%; color: #ffb4b4; }
  .mem-sheet .owner-gallery-move button:hover { background: rgba(60, 60, 64, 0.95); }
  .mem-sheet .owner-del:hover { background: rgba(80, 30, 30, 0.95); }
  .mem-sheet .owner-gallery-card.is-lifted {
    z-index: 6;
    cursor: grabbing;
    transform: translate3d(var(--drag-x, 0px), var(--drag-y, 0px), 0) scale(1.05);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--ribbon-hi, #b8c4b0);
    transition: box-shadow var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  .mem-sheet .owner-gallery-card.is-lifted .owner-gallery-move,
  .mem-sheet .owner-gallery-card.is-lifted .owner-gallery-del { opacity: 0; }
  .mem-sheet .owner-gallery-card.is-settling {
    transition: transform 180ms var(--ease-out, ease), box-shadow 180ms var(--ease-out, ease);
  }

  .mem-sheet .owner-upload {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem;
    min-width: 0;
    width: 100%;
  }
  .mem-sheet .owner-upload-actions { display: block; flex: 1 0 100%; }
  .mem-sheet .owner-upload-pick.is-camera { display: none; }
  .mem-sheet .owner-upload-pick {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 72px;
    padding: 0 0.9rem;
    border: 1.5px dashed rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--dur-fast, 160ms) var(--ease-out, ease), background var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  .mem-sheet .owner-upload-pick:hover { background: rgba(255, 255, 255, 0.09); }
  .mem-sheet .owner-upload-pick.is-drag { border-color: var(--ribbon-hi, #b8c4b0); background: rgba(184, 196, 176, 0.14); }
  .mem-sheet .owner-upload-pick:focus-within { outline: 2px solid var(--ribbon-hi, #b8c4b0); outline-offset: 2px; }
  .mem-sheet .owner-upload-pick input[type="file"] {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    margin: 0; padding: 0; border: 0;
    opacity: 0;
    cursor: pointer;
  }
  .mem-sheet .owner-upload-cta { display: none; }
  .mem-sheet .owner-upload-cta-desk {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 100%;
    font-size: 0.86rem;
    font-weight: 600;
    color: #f3efe6;
    pointer-events: none;
  }
  .mem-sheet .owner-upload-cta-desk svg { flex: none; width: 22px; height: 22px; }
  .mem-sheet .owner-upload-cta-desk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mem-sheet .owner-upload > input[name="caption"] { flex: 1 1 0; min-width: 0; min-height: 44px; }
  .mem-sheet .owner-upload > button { flex: none; min-height: 44px; padding: 0 1.1rem; }
  .mem-sheet .owner-upload-msg { flex: 1 0 100%; margin: 0; }

  /* ── Freigaben ───────────────────────────────────────────────────────────── */
  .mem-sheet .ribbon-panel[data-ribbon-panel="inbox"] .ribbon-group { display: flex; flex-direction: column; gap: 0.7rem; }
  .mem-sheet .inbox-write { width: 100%; min-height: 44px; justify-content: center; }
  .mem-sheet .inbox-card { max-width: none; margin-bottom: 0.6rem; }
  .mem-sheet .inbox-actions .btn-approve,
  .mem-sheet .inbox-actions .btn-reject { min-height: 40px; flex: 1; }
  .mem-sheet .inbox-msg { color: rgba(243, 239, 230, 0.92); }
  .mem-sheet .inbox-empty { padding: 0.75rem 0.25rem; font-size: 0.88rem; }

  /* Eingabefeld für Gästebuch-Einträge: in der Mitte der Restbreite, nie über dem Inspektor. */
  body.has-inspector .mem-composer {
    left: calc((100vw - var(--inspector-w)) / 2);
    width: min(560px, calc(100vw - var(--inspector-w) - 32px));
  }

  /* ── Texte direkt auf der Seite: Klick öffnet „Texte“ und fokussiert das Feld ── */
  body.is-editing .memorial-page [data-inline-edit]:not(.memorial-avatar):not(.memorial-avatar-add) {
    cursor: pointer;
    border-radius: 8px;
    outline: 1.5px dashed transparent;
    outline-offset: 4px;
    transition: outline-color var(--dur-fast, 160ms) var(--ease-out, ease), background-color var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  body.is-editing .memorial-page .memorial-avatar[data-inline-edit],
  body.is-editing .memorial-page .memorial-avatar-add[data-inline-edit] {
    cursor: pointer;
    border-radius: 50%;
    outline: 1.5px dashed transparent;
    outline-offset: 4px;
    transition: outline-color var(--dur-fast, 160ms) var(--ease-out, ease);
  }
  body.is-editing .memorial-page .hero-split .memorial-avatar[data-inline-edit],
  body.is-editing .memorial-page .hero-split .memorial-avatar-add[data-inline-edit] {
    border-radius: 50%;
  }
  body.is-editing .memorial-page [data-inline-edit]:hover {
    outline-color: color-mix(in srgb, var(--mem-accent, #8a6b1e) 60%, transparent);
  }
  body.is-editing .memorial-page [data-inline-edit]:focus-visible {
    outline: 2px solid var(--mem-accent, #8a6b1e);
    box-shadow: none;
  }
  body.is-editing .memorial-page [data-inline-edit].is-composing-target {
    outline: 2px solid var(--mem-accent, #8a6b1e);
    background-color: color-mix(in srgb, var(--mem-accent, #8a6b1e) 12%, transparent);
  }
  body.is-editing .memorial-page [data-empty] { display: block; }
  body.is-editing .memorial-page [data-empty]::before {
    content: attr(data-placeholder);
    font-style: italic;
    color: inherit;
    opacity: 0.9;
  }
  body.is-editing [data-story-hint] { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Runde 20 — Design-Tokens + editorialer Gedenkseiten-Look
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 2.75rem; --sp-8: 3.5rem; --sp-9: 4.5rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 18px; --r-pill: 999px; --r-phone: 44px;
  --ease-out: cubic-bezier(.16, .84, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 160ms; --dur-base: 320ms; --dur-reveal: 900ms; --dur-hero: 1200ms;
  --stagger: 90ms;
  --vignette: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgb(0 0 0 / .45) 100%);
  --shadow-soft: 0 12px 32px -18px rgb(0 0 0 / .35);
}

/* Reveal: nur mit html.js-reveal unsichtbar, sonst alles da */
html.js-reveal [data-reveal]:not(.is-visible),
html.js-reveal [data-reveal-hero]:not(.is-visible) {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
html.js-reveal [data-reveal].is-visible,
html.js-reveal [data-reveal-hero].is-visible {
  opacity: 1;
  transform: none;
}
html.js-reveal .memorial-hero-media[data-reveal-hero-media] {
  opacity: 0;
  transition: opacity var(--dur-hero) var(--ease-out);
}
html.js-reveal .memorial-hero-media[data-reveal-hero-media].is-visible { opacity: 1; }
body.is-editing [data-reveal],
body.is-editing [data-reveal-hero],
body.is-editing .memorial-hero-media,
body.is-editing .memorial-hero-media[data-reveal-hero-media] {
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
}
body.is-editing .memorial-hero-media {
  /* translateZ beibehalten (siehe Hero-Media), nicht auf none zurücksetzen */
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal [data-reveal],
  html.js-reveal [data-reveal-hero],
  html.js-reveal .memorial-hero-media[data-reveal-hero-media] {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 150ms linear !important;
    transition-delay: 0s !important;
  }
}

/* Typografie Gedenkseite */
.memorial-page .memorial-name-hero {
  font-family: var(--mem-serif, var(--serif));
  font-size: clamp(2.1rem, 8.5vw, 3.1rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-top: 0;
  position: relative;
  display: inline-block;
}
/* Negativer Abstand nur ohne Porträt (Name ins Titelbild ziehen) */
.memorial-hero.no-portrait .memorial-name-hero {
  margin-top: clamp(-4.5rem, -12vw, -2.5rem);
}
@media (min-width: 768px) {
  .memorial-page .memorial-name-hero { font-size: 3.6rem; }
}
.memorial-page .memorial-name-hero::after {
  content: '';
  display: block;
  width: min(4.5rem, 40%);
  height: 2px;
  margin: 0.55rem auto 0;
  background: var(--mem-accent);
  opacity: 0.7;
  border-radius: 1px;
}
.memorial-page .memorial-dates-hero,
.memorial-page .memorial-location-hero {
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--mem-soft);
  font-variant-numeric: lining-nums tabular-nums;
}
.memorial-page .memorial-kicker-hero,
.memorial-page .mem-quote {
  font-family: var(--mem-serif, var(--serif));
  font-style: italic;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  line-height: 1.4;
  text-wrap: balance;
  max-width: 22ch;
  margin-inline: auto;
  text-align: center;
  color: var(--mem-ink);
}
.memorial-page .mem-section-title {
  font-family: var(--mem-serif, var(--serif));
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  letter-spacing: 0;
  margin: 0 0 1.25rem;
}
.memorial-page .mem-section-title::after { display: none; content: none; }
.memorial-page .mem-label,
.memorial-page .guestbook-book-mark,
.memorial-page .guestbook-feed-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mem-muted);
}
.memorial-page .memorial-story {
  font-family: var(--mem-serif, var(--serif));
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 62ch;
  margin-inline: auto;
  hyphens: auto;
  text-wrap: pretty;
}

/* Panel-Schalter: solid = Karte; outline = offen; glass = Milchglas.
   Innenabstand bleibt bei allen drei gleich — Text springt nicht. */
.panels-outline .memorial-section.panel {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: var(--mem-pad);
}
.panels-outline .memorial-section.panel:nth-of-type(even) {
  background: color-mix(in oklab, var(--mem-panel) 55%, var(--mem-bg));
  border-radius: var(--mem-radius);
}

/* Ornament-Trenner */
.mem-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.35rem 0 1.35rem;
  color: color-mix(in oklab, var(--mem-accent) 70%, var(--mem-bg));
}
.mem-ornament-line {
  width: clamp(2rem, 14vw, 4rem);
  height: 1px;
  background: var(--mem-rule);
  border: 0;
}
.mem-ornament svg { width: 14px; height: 14px; flex: none; }
.guestbook-entries .guestbook-entry + .guestbook-entry {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px dotted var(--mem-rule);
  position: relative;
}
.guestbook-entries .guestbook-entry + .guestbook-entry::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px; height: 8px;
  margin-left: -4px;
  background: color-mix(in oklab, var(--mem-accent) 70%, var(--mem-bg));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.guestbook-book-wreath {
  display: block;
  width: 28px; height: 28px;
  margin: 0 auto 0.75rem;
  color: var(--mem-accent);
}

/* Button Pill */
.memorial-page .btn-gold {
  border-radius: var(--r-pill, 999px);
  min-height: 52px;
  padding: 0 2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mem-accent-ink, #fffef9);
  background: var(--mem-accent);
  border-color: var(--mem-accent);
  box-shadow: 0 8px 24px -12px color-mix(in oklab, var(--mem-accent) 60%, transparent);
  max-width: 22rem;
  touch-action: manipulation;
}
.memorial-page .memorial-gb-jump .btn-ghost-sm,
.memorial-page .btn-gold.btn-w,
.memorial-page .btn-mem-cta {
  width: 100%;
  max-width: 22rem;
  margin-inline: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.memorial-page .btn-feather { flex: none; }
/* Gästebuch-Knopf: heller Ring und dunkler Saum, Farbe bleibt der Akzent.
   Auf dunklen Fotos hebt der helle Ring ab, auf hellen der dunkle Saum. */
.memorial-page .memorial-gb-jump .btn-mem-cta {
  border-color: rgba(255, 254, 249, 0.92);
  box-shadow:
    0 0 0 1.5px rgba(255, 254, 249, 0.92),
    0 0 0 3.5px rgba(18, 14, 10, 0.42),
    0 10px 26px -8px rgba(8, 6, 4, 0.55);
}
@media (hover: hover) {
  .memorial-page .btn-gold:hover {
    background: color-mix(in oklab, var(--mem-accent) 88%, var(--mem-ink));
    border-color: transparent;
    transition: background var(--dur-base) var(--ease-out);
  }
}
.memorial-page .btn-gold:active { transform: scale(0.985); transition: transform 120ms var(--ease-out); }
.memorial-page a:focus-visible,
.memorial-page button:focus-visible,
.memorial-page .input:focus-visible {
  outline: 2px solid var(--mem-accent);
  outline-offset: 3px;
}
.memorial-page .guestbook-form .input,
.memorial-page .guestbook-form .textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--mem-rule);
  border-radius: 0;
  min-height: 44px;
  font-size: 16px;
}
.memorial-page .guestbook-form .input:focus,
.memorial-page .guestbook-form .textarea:focus {
  border-bottom-width: 2px;
  border-bottom-color: var(--mem-accent);
  outline: none;
}

/* Galerie */
.mem-carousel-viewport {
  border-radius: var(--mem-radius, 10px);
  background: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mem-ink) 8%, transparent);
}
.mem-carousel-slide .mem-carousel-photo,
.mem-carousel-slide img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--mem-radius, 10px);
}
.mem-gallery-item {
  border: 0;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mem-ink) 8%, transparent);
}

/* Hero ohne Foto */
.memorial-hero-media:not([style*="background-image"]) {
  background: linear-gradient(
    165deg,
    color-mix(in oklab, var(--mem-accent) 10%, var(--mem-bg)),
    var(--mem-bg)
  );
}
.memorial-hero-media:not([style*="background-image"])::before {
  content: '';
  position: absolute;
  inset: 30% 0 auto;
  margin: auto;
  width: 48px; height: 48px;
  opacity: 0.4;
  background: color-mix(in oklab, var(--mem-accent) 70%, var(--mem-bg));
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
/* Porträt immer Kreis (auch bei Ecken „Rund“ / im Editor) */
.memorial-hero .memorial-avatar,
.memorial-hero .memorial-avatar-add {
  display: block;
  width: clamp(112px, 34vw, 148px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50% !important;
  object-fit: cover;
  object-position: 50% 30%;
  margin: 0 auto 1.25rem;
  border: 1px solid var(--mem-rule);
  box-shadow: none;
  position: relative;
  z-index: 2;
}
.hero-split .memorial-avatar,
.hero-split .memorial-avatar-add {
  aspect-ratio: 1;
  width: clamp(112px, 34vw, 148px);
  max-width: 148px;
  height: auto;
  border-radius: 50% !important;
  object-fit: cover;
  margin-inline: 0;
}
.memorial-avatar-add {
  background: transparent;
  color: var(--mem-muted);
  border-style: dashed;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hero-portrait .memorial-hero-media,
.hero-cover .memorial-hero-media {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover;
  background-position: 50% 22%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
  /* Eigenes Layer: neues background-image sonst oft erst nach Tippen/Zoom sichtbar (WebKit). */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.hero-portrait .memorial-hero-body,
.hero-cover .memorial-hero-body,
.hero-minimal .memorial-hero-body {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: clamp(2rem, 6vw, 3rem);
}
.hero-split .memorial-hero-body {
  padding-top: clamp(2rem, 6vw, 3rem);
  text-align: left;
}
.hero-split .memorial-kicker-hero,
.hero-split .mem-quote,
.hero-split .memorial-gb-jump { text-align: left; margin-inline: 0; }
.memorial-hero-body::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: none;
}
.memorial-hero.hero-has-media .memorial-hero-body::before {
  background: radial-gradient(
    ellipse at 50% 55%,
    color-mix(in oklab, var(--mem-hero-scrim, #0c0a08) 42%, transparent) 0,
    transparent 70%
  );
}
.memorial-hero.hero-ink-page .memorial-hero-body::before {
  background: radial-gradient(
    ellipse at 50% 55%,
    color-mix(in oklab, var(--mem-bg) 28%, transparent) 0,
    transparent 70%
  );
}
.memorial-hero-body > * { position: relative; z-index: 1; }
.memorial-hero-media[style*="background-image"]::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
  /* Abdunkeln: dunkler Schleier, kein helles Seitenfarben-Auswaschen */
  background: color-mix(in oklab, #0c0a08 var(--mem-hero-dim, 0%), transparent);
  pointer-events: none;
}
/* Einheitliche Hero-Textfarbe bei Bild */
.memorial-hero.hero-has-media {
  --mem-hero-ink: var(--mem-ink);
}
.memorial-hero.hero-ink-light {
  --mem-hero-ink: #fffef9;
  --mem-hero-scrim: #0c0a08;
}
.memorial-hero.hero-has-media .memorial-name-hero,
.memorial-hero.hero-has-media .memorial-dates-hero,
.memorial-hero.hero-has-media .memorial-location-hero,
.memorial-hero.hero-has-media .memorial-kicker-hero,
.memorial-hero.hero-has-media .mem-quote {
  color: var(--mem-hero-ink);
  text-shadow: 0 1px 2px color-mix(in oklab, var(--mem-hero-scrim, #000) 35%, transparent);
}
.memorial-hero.hero-has-media .memorial-dates-hero,
.memorial-hero.hero-has-media .memorial-location-hero { font-weight: 600; }

/* Panel-eigene Textfarbe (Tief + Papier: helles Panel, dunkle Schrift) */
.memorial-page {
  --mem-panel-ink: var(--mem-ink);
}

/* Stil-Panel: alles untereinander, kein Segment-Untermenü */
.style-seg { display: none !important; }
@media (max-width: 767px) {
  /* iOS-ähnlich: kompakte Gruppen, Labels als Section-Header, soft Scroll */
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] {
    gap: 2px;
    padding: 8px 10px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .ribbon-group-label {
    display: block;
    margin: 0.55rem 0 0.12rem;
    padding: 0 2px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(236, 232, 223, 0.52);
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] [data-style-pane]:first-child .ribbon-group-label:first-child {
    margin-top: 0;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .style-row,
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .opt-row {
    min-height: 40px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .ribbon-check {
    min-height: 40px;
    margin: 0.15rem 0 0.25rem;
    color: #f3efe6;
    font-size: 0.84rem;
    align-items: center;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .ribbon-chip,
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .font-chip {
    min-height: 36px;
    height: 36px;
  }
  body.is-editing .mem-sheet .ribbon-panel[data-ribbon-panel="design"] .style-dot {
    width: 36px;
    height: 36px;
  }
}

/* Bilder-Tab: kompakte Zeilen */
.photo-tile-row {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photo-tile-row::-webkit-scrollbar { display: none; }
.photo-tile--row {
  flex: 0 0 min(78%, 17rem);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
  max-height: 64px;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3efe6;
}
.photo-tile--row .photo-tile-title { color: #f3efe6; }
.mem-sheet .photo-tile--row .photo-icon-btn { color: #f3efe6; }
.photo-tile--row .photo-tile-thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--ed-ink, #333) 10%, transparent) center/cover no-repeat;
  flex: none;
}
.photo-tile--row .photo-tile-thumb.is-round { border-radius: 50%; }
.photo-tile-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-tile--row .photo-tile-acts {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  margin: 0;
}
.photo-icon-btn {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  flex: 0 0 44px;
}
.photo-icon-btn svg { width: 20px; height: 20px; }
.photo-icon-btn.is-danger { color: #b42318; }
.photo-tile-title-short { display: none; }
.photo-tile-title-long { display: inline; }
.photo-adjust {
  display: grid;
  gap: 0;
  min-width: 0;
}
.photo-adjust-btn {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: rgba(243, 239, 230, 0.78);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-adjust-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms var(--ease-out, ease);
  opacity: 0.7;
}
.photo-adjust.is-open .photo-adjust-chevron {
  transform: rotate(225deg);
}
.photo-hero-opts {
  display: grid;
  gap: 0.35rem;
  padding: 0.35rem 0.1rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.25rem;
}
.photo-count-meta {
  font-weight: 400;
  font-size: 0.78em;
  opacity: 0.75;
  margin-left: 0.35rem;
}
.photo-tile.is-target {
  outline: 2px solid var(--ed-accent, var(--mem-accent));
  outline-offset: 2px;
}
@media (min-width: 768px) {
  .photo-tile-row {
    flex-direction: column;
    overflow: visible;
  }
  .photo-tile--row {
    flex: none;
    width: 100%;
    max-height: none;
    min-height: 56px;
  }
  .photo-tile--row .photo-tile-acts { flex-wrap: wrap; }
}
.ribbon-check {
  display: flex; align-items: flex-start; gap: 0.45rem;
  font-size: 0.78rem; margin: 0.35rem 0;
  color: var(--ed-ink, var(--text-muted, #5a5048));
}

/* Content-visibility unter dem ersten Viewport (nicht im Editor).
   Das Gästebuch bleibt draußen: es ist das Ziel von „Ins Gästebuch schreiben“.
   Mit content-visibility:auto lässt iOS Safari den Abschnitt nach dem Sprung leer. */
body:not(.is-editing) .memorial-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 480px;
}


/* Datum TT.MM.JJJJ */
.date-field { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem; align-items: center; position: relative; }
.date-field-native {
  position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px;
}
.date-field-cal {
  width: 44px; height: 44px; border: 1px solid var(--rule, #e4ddd4); border-radius: 10px;
  background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer;
  filter: none !important;
}
.home-price {
  padding: var(--sp-8, 3.5rem) 0;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, #f5ece1 0%, transparent 70%),
    linear-gradient(180deg, #f8f1e7 0%, #f5ece1 100%);
}
.home-price-inner {
  max-width: 22.5rem;
  margin-inline: auto;
  padding: 1.75rem 1.5rem 1.6rem;
  border: 1px solid color-mix(in oklab, var(--ink, #33200f) 10%, transparent);
  border-radius: var(--r-lg, 18px);
  background: color-mix(in oklab, #fff 78%, #f5ece1);
  box-shadow: 0 10px 28px rgba(45, 30, 15, 0.06);
}
.home-price h2 {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute, #75614f);
  margin: 0 0 0.85rem;
}
.home-price-amount {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.home-price-num {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink, #33200f);
}
.home-price-per {
  font-size: 1.05rem;
  color: var(--ink, #33200f);
}
.home-price-main {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0.45rem 0 0.85rem;
  color: var(--ink, #33200f);
}
.home-price-extra {
  margin: 0 0 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in oklab, var(--ink, #33200f) 12%, transparent);
  font-size: 0.95rem;
  color: var(--ink, #33200f);
}
.home-price-cta { margin-top: 0.15rem; }

.sw-update-hint {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #1a1a1c;
  color: #f3efe6;
  font: inherit;
  font-size: 0.85rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.home-contact a[href^="mailto:"] {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

/* deploy probe 2026-11-19T20:34Z */

.order-status.is-test {
  color: #6a4b16;
  border-color: #c9b896;
  background: #f6f0e4;
}
.mail-log-filter { max-width: none; flex-wrap: wrap; }
.mail-log-meta { display: grid; gap: .35rem; margin: 0 0 1rem; }
.mail-log-meta div { display: grid; grid-template-columns: 8rem 1fr; gap: .5rem; }
.mail-log-meta dt { color: var(--text-muted, #6b6458); }
.mail-log-meta dd { margin: 0; }
.mail-log-frame {
  width: 100%;
  height: 520px;
  border: 1px solid var(--rule, #e3ded2);
  border-radius: 8px;
  background: #fff;
}
.mail-log-text {
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0 0 1rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   GrabBuch Digital — Marke (Logo, Kopfzeile, Buttons)
   Wortmarke in Serif, darunter der Buchbogen; ruhiges Papier statt Glas-Verläufe.
   ════════════════════════════════════════════════════════════════════════════ */
.site-header {
  background: rgba(247, 240, 230, 0.86);
  border-bottom: 1px solid var(--rule);
  box-shadow: none;
}
.site-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}
.site-logo .logo-text { order: 1; line-height: 1.05; }
.site-logo .logo-mark {
  order: 2;
  width: 2.1em; height: auto;
  align-self: center;
  color: var(--ink);
}
@media (max-width: 640px) {
  .site-logo { flex: 0 1 auto; gap: 0.12rem; }
  .site-logo .logo-mark { width: 1.9em; height: auto; }
}
.btn-gold, .btn.btn-gold { border-radius: 999px; }
.kicker { color: var(--ivy); }
::selection { background: var(--ivy); color: #fdf9f4; }
