.deg-kondolenzbuch {
    --deg-paper: #f3f1eb;
    --deg-ink: #1b1c1f;
    --deg-muted: #5f5d58;
    color: var(--deg-ink);
    background: var(--deg-paper);
    padding: clamp(1rem, 4vw, 3rem);
    overflow-wrap: anywhere;
}
.deg-kondolenzbuch a { color: inherit; text-decoration: underline; }
.deg-kondolenzbuch :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* R3 (C2): programmatic focus after a mouse submission stays without ring (announced, not outlined). */
.deg-kondolenzbuch [data-deg-focus-quiet]:focus { outline: none; }
.deg-kondolenzbuch nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-block: 1rem;
}
.deg-kondolenzbuch nav a { display: inline-flex; align-items: center; min-height: 44px; }
.deg-kondolenzbuch__book { display: grid; gap: 1px; background: #77756f; }
.deg-kondolenzbuch__book--interactive { touch-action: pan-y pinch-zoom; }
.deg-kondolenzbuch__sheet { min-width: 0; padding: clamp(1rem, 3vw, 2.5rem); background: var(--deg-paper); }
.deg-kondolenzbuch__portrait { width: min(100%, 160px); height: auto; filter: grayscale(1); }
.deg-kondolenzbuch__message { white-space: pre-wrap; }
.deg-kondolenzbuch__byline { text-align: end; color: var(--deg-muted); }
.deg-kondolenzbuch__form input:not([type="checkbox"]), .deg-kondolenzbuch__form textarea {
    max-width: 100%;
    width: 100%;
    font-size: 1rem;
    border: 1px solid #77756f;
}
.deg-kondolenzbuch__form button { min-height: 48px; }
.deg-kondolenzbuch__error { border: 2px solid; padding: 1rem; }
.deg-kondolenzbuch__closed { max-width: 40rem; margin-inline: auto; padding: clamp(1rem, 4vw, 2.5rem); background: #fff; text-align: center; }
.deg-kondolenzbuch__eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--deg-muted); }
.deg-kondolenzbuch__note { color: var(--deg-muted); }
.deg-kondolenzbuch__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.deg-kondolenzbuch .deg-kondolenzbuch__button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.25rem;
    background: var(--deg-ink); color: #fff; text-decoration: none; border: 1px solid var(--deg-ink);
}
.deg-kondolenzbuch .deg-kondolenzbuch__button--line { background: transparent; color: var(--deg-ink); }
/* Book pages (R2 view 2, N2): running head, body, page number at the bottom. */
.deg-kondolenzbuch__sheet { display: flex; flex-direction: column; }
.deg-kondolenzbuch__page-head {
    display: flex; justify-content: space-between; gap: 1em; margin: 0 0 1em; padding-bottom: .6em;
    border-bottom: 1px solid rgba(0, 0, 0, .14); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--deg-muted);
}
.deg-kondolenzbuch__page-body { flex: 1 1 auto; min-height: 0; }
.deg-kondolenzbuch__folio { margin: .8em 0 0; text-align: center; font-style: italic; color: var(--deg-muted); }
.deg-kondolenzbuch__sheet--memorial .deg-kondolenzbuch__page-body { text-align: center; }
.deg-kondolenzbuch__label { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: var(--deg-muted); }
.deg-kondolenzbuch__more { text-align: end; font-size: .85rem; color: var(--deg-muted); }
.deg-kondolenzbuch__lines {
    height: 6.8em; margin: .6em 0 1.4em;
    background: repeating-linear-gradient(transparent 0 1.7em, rgba(0, 0, 0, .2) 1.7em calc(1.7em + 1px));
}
/* With JavaScript: fixed page size, measured by book.js; content never overflows a page. */
.deg-kondolenzbuch__book--paged { --deg-page-height: clamp(26rem, 70vh, 44rem); position: relative; }
/* T1-F15: every page of the JS book has the same fixed size (from the viewport, never from the content), so
   the book and its controls never move while turning. Content adapts to the page: entries continue on the
   next page; a page whose content cannot be split (extreme zoom) scrolls inside instead of growing. */
.deg-kondolenzbuch__book--paged .deg-kondolenzbuch__sheet { min-height: var(--deg-page-height); height: var(--deg-page-height); }
.deg-kondolenzbuch__book--paged .deg-kondolenzbuch__page-body { min-height: 0; overflow: hidden; }
.deg-kondolenzbuch__book--paged .deg-kondolenzbuch__sheet--overfull .deg-kondolenzbuch__page-body { overflow-y: auto; }
/* The portrait shrinks on low pages (measured by book.js, aspect ratio kept) so the memorial page never grows. */
.deg-kondolenzbuch__book--portrait-fit .deg-kondolenzbuch__sheet--memorial .deg-kondolenzbuch__portrait { width: auto; max-height: var(--deg-portrait-max); }
/* Navigation (N3): round 48 px arrows around the page status, one line at 375 px. */
.deg-kondolenzbuch .deg-kondolenzbuch__navigation {
    /* P1 (C2b): fixed grid – arrows keep their place whatever the status says (it may wrap). */
    display: grid; grid-template-columns: 48px minmax(0, 15rem) 48px; justify-content: center; align-items: center; gap: .75rem;
}
.deg-kondolenzbuch .deg-kondolenzbuch__turn {
    display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; min-height: 48px; padding: 0;
    border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.deg-kondolenzbuch__turn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.deg-kondolenzbuch .deg-kondolenzbuch__turn--off, .deg-kondolenzbuch .deg-kondolenzbuch__turn:disabled { opacity: .35; cursor: default; }
.deg-kondolenzbuch__status { min-width: 0; text-align: center; white-space: normal; }
@media (max-width: 719px) {
    .deg-kondolenzbuch .deg-kondolenzbuch__navigation { grid-template-columns: 48px minmax(0, 11rem) 48px; }
}
.deg-kondolenzbuch__hint { margin: .5rem 0 0; text-align: center; font-size: .9rem; }
.deg-kondolenzbuch__hint a { display: inline-block; padding: .75rem 0; }
.deg-kondolenzbuch__hint-touch { display: none; }
@media (hover: none) {
    .deg-kondolenzbuch__hint-touch { display: inline; }
    .deg-kondolenzbuch__hint-pointer { display: none; }
}
.deg-kondolenzbuch__fab { display: none; }
@media (min-width: 720px) {
    .deg-kondolenzbuch__book { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
    /* Floating "Eintragen" while the book is open for entries (N3). */
    .deg-kondolenzbuch .deg-kondolenzbuch__fab {
        display: flex; width: max-content; margin: 1rem auto 0; align-items: center; gap: .5rem;
        min-height: 48px; padding: 0 1.1rem; border-radius: 999px; background: #fff; color: var(--deg-ink);
        text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
        transition: none; /* a theme's a{transition:all} would keep visibility visible while hiding */
    }
    /* With JavaScript it floats; book.js moves it up over the book surface, or hides
       it, while it would cover anything operable (R2 C2, B-Q2c-1). */
    .deg-kondolenzbuch--fab-float .deg-kondolenzbuch__fab {
        position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom) + var(--deg-fab-lift, 0px)); z-index: 20; margin: 0;
    }
    .deg-kondolenzbuch--fab-float .deg-kondolenzbuch__fab--hidden { visibility: hidden; }
    .deg-kondolenzbuch__fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
    .deg-kondolenzbuch--fab-float:has(.deg-kondolenzbuch__fab) { padding-bottom: 5.5rem; }
}
/* Form (R2 view 3, N5): memorial and note left from 720 px, "Ihr Eintrag" right. */
.deg-kondolenzbuch__form-aside { display: none; text-align: center; }
.deg-kondolenzbuch__portrait-mini { width: 38%; max-width: 140px; height: auto; filter: grayscale(1); }
.deg-kondolenzbuch__row { display: grid; gap: 0 1rem; }
.deg-kondolenzbuch__form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
@media (min-width: 720px) {
    .deg-kondolenzbuch__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
    .deg-kondolenzbuch__form-aside { display: flex; flex-direction: column; justify-content: center; align-items: center; }
    .deg-kondolenzbuch__form-sub { display: none; }
    .deg-kondolenzbuch__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* T1-F15 (R2 Blattmechanik): blank page = paper; the turning leaf lies over the spread (desktop: right
   half, mobile: whole page) and rotates about the gutter. Without motion (reduced-motion, no JS) no 3D. */
.deg-kondolenzbuch__sheet--blank { pointer-events: none; }
.deg-kondolenzbuch__book--paged { perspective: 2600px; }
.deg-kondolenzbuch__leaf {
    position: absolute; top: 0; left: 50%; width: 50%; height: 100%; z-index: 3;
    transform-origin: left center; transform-style: preserve-3d; transform: rotateY(0deg); pointer-events: none;
}
.deg-kondolenzbuch__leaf--turned { transform: rotateY(-180deg); }
.deg-kondolenzbuch__leaf--moving { transition: transform 900ms cubic-bezier(.4, .1, .2, 1); }
.deg-kondolenzbuch__leaf-face { position: absolute; inset: 0; display: grid; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.deg-kondolenzbuch__leaf-face--back { transform: rotateY(180deg); }
.deg-kondolenzbuch__leaf-face > .deg-kondolenzbuch__sheet { height: 100%; min-height: 0; }
.deg-kondolenzbuch__leaf-spacer { display: none; }
/* Moving shade, only during the turn (R2 .is-moving). */
.deg-kondolenzbuch__leaf--moving .deg-kondolenzbuch__leaf-face::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 60%);
    animation: deg-leaf-shade 900ms cubic-bezier(.4, .1, .2, 1);
}
@keyframes deg-leaf-shade { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@media (max-width: 719px) {
    .deg-kondolenzbuch__leaf { left: 0; width: 100%; }
    .deg-kondolenzbuch__leaf--turned.deg-kondolenzbuch__leaf--moving { visibility: hidden; transition: transform 900ms cubic-bezier(.4, .1, .2, 1), visibility 0s linear 900ms; }
}
@media (min-width: 720px) and (prefers-reduced-motion: no-preference) {
    /* R2 .book: slight tilt of the open book (desktop only). */
    .deg-kondolenzbuch__book--paged { transform: perspective(2600px) rotateX(7deg); }
}
@media (prefers-reduced-motion: reduce) {
    .deg-kondolenzbuch__leaf--moving { transition: none; }
}
/* T1-F18 (R2 .book__hit): page-edge click zones, cursor only in a free direction (set by book.js). */
.deg-kondolenzbuch__book--paged[data-deg-edge="next"] { cursor: e-resize; }
.deg-kondolenzbuch__book--paged[data-deg-edge="prev"] { cursor: w-resize; }
/* T1-F19 (R2 view "Danke", .entry--pending, .stamp): confirmation with the sender's entry and button pair. */
.deg-kondolenzbuch__received { max-width: 40rem; margin-inline: auto; padding: clamp(1.3rem, 5vw, 3rem); background: var(--deg-paper); color: var(--deg-ink); }
.deg-kondolenzbuch__received h2 { margin: .2em 0 .6em; }
.deg-kondolenzbuch__received .deg-kondolenzbuch__actions { margin: 1.6em 0 0; }
.deg-kondolenzbuch__received .deg-kondolenzbuch__button {
    width: 100%; padding: .7rem 1.6rem; border-radius: 2px; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase;
    font-weight: 500; text-align: center; text-decoration: none;
}
.deg-kondolenzbuch .deg-kondolenzbuch__received .deg-kondolenzbuch__button { text-decoration: none; }
.deg-kondolenzbuch__received .deg-kondolenzbuch__button:hover { background: #000; }
.deg-kondolenzbuch .deg-kondolenzbuch__received .deg-kondolenzbuch__button--line { background: #fff; color: var(--deg-ink); border-color: #8d8b85; }
.deg-kondolenzbuch .deg-kondolenzbuch__received .deg-kondolenzbuch__button--line:hover { border-color: var(--deg-ink); }
@media (min-width: 720px) {
    /* Side by side and centred (R2 .form-foot--center); long labels wrap inside the button, not the pair. */
    .deg-kondolenzbuch__received { max-width: 46rem; }
    .deg-kondolenzbuch__received .deg-kondolenzbuch__actions { flex-wrap: nowrap; }
    .deg-kondolenzbuch__received .deg-kondolenzbuch__button { width: auto; flex: 0 1 auto; }
}
/* The box is plugin state: specificity (0,4,0) above a theme's generic entry rule (e.g. 0,3,1). */
.deg-kondolenzbuch .deg-kondolenzbuch__entry.deg-kondolenzbuch__entry--pending.deg-kondolenzbuch__entry--pending {
    position: relative; margin: 1.4em 0 .6em; padding: 2.8em 1.2em 1em; overflow: hidden;
    background: rgba(255, 255, 255, .6); border: 1px solid rgba(0, 0, 0, .14);
}
.deg-kondolenzbuch .deg-kondolenzbuch__entry--pending.deg-kondolenzbuch__entry--pending.deg-kondolenzbuch__entry--continued { padding-top: 1em; }
.deg-kondolenzbuch__stamp {
    position: absolute; right: .8em; top: .7em; transform: rotate(-6deg); padding: .3em .7em; border: 2px solid; border-radius: 3px;
    font: 700 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--deg-muted);
}
.deg-kondolenzbuch__preview-note, .deg-kondolenzbuch__preview-invalid { margin: 0 0 1rem; padding: .55rem 1rem; text-align: center; border: 1px solid; }
/* Approved own entry: brief highlight without layout change, fades out once (book.js keeps it once). */
.deg-kondolenzbuch__entry--mark {
    background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 .5em rgba(255, 255, 255, .6);
    animation: deg-entry-mark 2s ease-out both;
}
@keyframes deg-entry-mark { 0%, 25% { background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 .5em rgba(255, 255, 255, .6); }
    100% { background: transparent; box-shadow: 0 0 0 .5em transparent; } }
@media (prefers-reduced-motion: reduce) {
    .deg-kondolenzbuch__entry--mark { animation: none; }
}
/* T1-F21: the preview button stays hidden until book.js has a valid preview answer (also against theme display rules). */
.deg-kondolenzbuch [data-deg-preview-link][hidden] { display: none !important; }
.deg-kondolenzbuch__preview-nojs { margin: 0 0 .6em; }
