/* Party-Jukebox – Basis-Styles (Design nach SPEC 16, mobile first).
   Farben und Schrift stehen in theme.css; hier nur Maße und Formen. */

:root {
    --radius: 16px;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(60rem 36rem at 50% -12%, rgba(22, 37, 63, 0.95), transparent 62%),
        var(--bg);
}

.page {
    flex: 1;
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    padding: 2.5rem 1rem 1.5rem;
}

.hero {
    margin-bottom: 2rem;
    text-align: center;
}

.eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 8vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere; /* lange deutsche Wörter dürfen umbrechen */
    hyphens: auto;
}

.lead {
    margin: 0;
    font-size: 1.1rem;
    color: var(--muted);
}

.card {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input {
    width: 100%;
    min-height: 3.5rem;
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 1.25rem; /* mind. 16 px, damit iOS nicht zoomt */
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--line-strong);
    border-radius: 12px;
}

/* Eingabefelder der Gäste und die Code-Eingabe: Pille wie die Schaltflächen */
.guest .input,
.input-code {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
    border-radius: 999px;
}

.input-code {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 700;
}

.input::placeholder {
    color: var(--muted);
    letter-spacing: 0.05em;
    font-weight: 400;
}

.input[aria-invalid="true"] {
    border-color: var(--danger);
}

.btn {
    display: block;
    width: 100%;
    min-height: 3.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    color: var(--cta-ink);
    background: var(--cta);
    border: 2px solid var(--cta);
    border-radius: 999px;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.98);
}

.btn-inline {
    display: inline-block;
    width: auto;
    margin-top: 1.5rem;
}

/* Ein <button> zentriert seinen Inhalt von selbst, ein Link nicht: Dort sonst Text oben statt in der Mitte.
   Nur für Links, damit Schaltflächen mit Text und Symbol (★) unverändert umbrechen. */
a.btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

a.btn-inline {
    display: inline-flex;
}

:focus-visible {
    outline: 3px solid var(--cta);
    outline-offset: 3px;
}

.form-error {
    margin: 0.75rem 0 0;
    color: var(--danger);
    font-weight: 600;
}

.hint {
    margin: 1rem 0 0;
    font-size: 0.9rem;
    text-align: center;
    color: var(--muted);
}

.foot {
    padding: 1rem;
    font-size: 0.8rem;
    text-align: center;
    color: var(--muted);
}

/* --- Formulare und Hinweise --- */

.label-spaced {
    margin-top: 1.25rem;
}

.hint-left {
    margin: 0.4rem 0 0;
    text-align: left;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

code {
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.alert-ok {
    border-color: var(--ok);
}

.alert-error {
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    border-color: var(--line-strong);
}

.btn-secondary {
    color: var(--text);
    background: transparent;
    border: 2px solid var(--line-strong);
}

.btn-small {
    width: auto;
    min-height: 2.75rem;
    margin-top: 0;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    line-height: 1.25;
}

/* --- Listen --- */

.list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
}

.list-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.badge {
    flex: none;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cta-ink);
    background: var(--cta);
    border-radius: 999px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Auf der Party-Seite: Abstand zwischen den Links und den Aktionen */
.link-box + .actions {
    margin-top: 1.5rem;
}

.actions + .hint {
    margin-top: 1.25rem;
}

.actions .btn {
    margin-top: 0;
}

/* --- Admin --- */

.page-wide {
    max-width: 46rem;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.topbar h1 {
    margin: 0;
    font-size: 1.8rem;
}

.topbar .eyebrow {
    margin-bottom: 0.15rem;
}

.stack {
    margin-bottom: 1rem;
}

.stack h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.qr {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.qr canvas {
    width: 15rem;
    height: 15rem;
    background: #fff;
    border-radius: 8px;
    image-rendering: pixelated;
}

.secret {
    margin: 0.25rem 0 0;
    padding: 0.6rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-align: center;
    word-break: break-all;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.codes li {
    padding: 0.6rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
}

/* --- Navigation, Formulare, Partys --- */

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.nav-link {
    padding: 0.4rem 0.7rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.nav-link:hover,
.nav-active {
    color: var(--text);
}

.nav-active {
    background: var(--surface);
    box-shadow: inset 0 -2px 0 var(--muted);
}

.nav-logout {
    margin-left: auto;
}

.link-strong {
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}

.badge-active {
    background: var(--ok);
}

.badge-prepared {
    background: var(--muted);
}

.badge-ended {
    color: var(--text);
    background: var(--line);
}

.fieldset {
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.fieldset legend {
    padding: 0 0.5rem 0 0;
    font-weight: 700;
    color: var(--muted);
}

.field {
    margin-top: 1rem;
}

select.input {
    appearance: auto;
}

.details {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.details summary {
    font-weight: 700;
    cursor: pointer;
}

.link-box {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.9rem;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.link-row code {
    overflow-wrap: anywhere;
}

.code-big {
    font-size: 2rem;
    letter-spacing: 0.25em;
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger-solid {
    color: #fff;
    background: #c0392b;
    border-color: #c0392b;
}

/* --- Druckansicht des QR-Codes --- */

.poster {
    padding: 2rem 1rem;
    text-align: center;
    color: #000;
    background: #fff;
    border-radius: var(--radius);
}

.poster-eyebrow {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.poster-title {
    margin: 0.25rem 0 1rem;
    font-size: clamp(2rem, 8vw, 3.2rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.poster-qr canvas {
    width: min(100%, 24rem);
    height: auto;
    image-rendering: pixelated;
}

.poster-step {
    margin: 1rem 0 0.25rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.poster-or,
.poster-code {
    margin: 0.25rem 0;
    font-size: 1.1rem;
}

.poster-code strong {
    letter-spacing: 0.2em;
}

@media print {
    body {
        background: #fff;
    }

    .no-print,
    .foot {
        display: none !important;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .poster {
        padding: 1cm 0;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn:active {
        transform: none;
    }
}

/* --- Gäste-Seite (M4) --- */

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.guest {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guest .alert,
.guest .hint {
    margin: 0;
}

/* Die Hauptansicht (Jetzt läuft, Info-Zeilen, Suche, Liste) bekommt gleichmäßige Abstände */
.guest [data-view="main"] {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.g-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.g-head-text {
    min-width: 0;
}

.g-head .eyebrow {
    margin-bottom: 0.25rem;
}

.g-head h1 {
    margin: 0;
    font-size: clamp(1.5rem, 6vw, 2rem);
}

/* Kopfzeile der Party-Seite: Gastname links, Wortmarke mittig, Menü rechts, darunter die doppelte Haarlinie in Rosé
   (SPEC 16.4). Der Party-Name steht kursiv darunter. */
.g-bar-head {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.g-bar-head::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    border-top: 1px solid var(--rose);
    border-bottom: 1px solid var(--rose);
    opacity: 0.75;
}

.g-brand {
    margin: 0;
    padding-left: 0.5em;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--rose);
}

.g-who {
    min-width: 0;
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--muted);
}

.g-burger {
    display: grid;
    justify-self: end;
    place-content: center;
    gap: 4px;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    cursor: pointer;
}

.g-burger i {
    display: block;
    width: 1rem;
    height: 2px;
    background: var(--icon);
}

.g-party {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

.g-menu .btn {
    margin-top: 0.75rem;
}

/* Info-Zeilen ohne Karte, wie auf dem Entwurf (Noch 2 Wünsche frei, Bonus) */
.g-status {
    padding: 0;
    background: transparent;
    border: 0;
}

.g-status-line {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.g-section h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

.g-section > .btn {
    margin-top: 0.75rem;
}

.g-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.g-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
}

.g-item-mine {
    box-shadow: inset 3px 0 0 var(--line-strong);
    padding-left: 0.6rem;
}

/* „Kommt gleich“: der Eintrag mit Rosé-Markierung (SPEC 16.2) */
.g-item-running {
    box-shadow: inset 3px 0 0 var(--rose);
    padding-left: 0.6rem;
}

/* Position der Wünsche, klein auf der Ecke des Covers */
.g-pos {
    position: absolute;
    top: 0.55rem;
    left: -0.15rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 1.3rem;
    height: 1.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
}

.g-item-mine .g-pos,
.g-item-running .g-pos {
    left: 0.45rem;
}

.g-item-dim .g-cover,
.g-item-dim .g-info {
    opacity: 0.5;
}

.g-cover {
    flex: none;
    width: 3rem;
    height: 3rem;
    border-radius: 4px;    /* Spotify-Vorgabe: Cover unbeschnitten, 4 px Rundung auf dem Handy (SPEC 16.8) */
    background: var(--line);
    box-shadow: 0 0 0 1px var(--line-strong);
    object-fit: contain;
}

/* Verlinktes Cover: der Link ist nur die Hülle um das Bild. */
.g-cover-link {
    display: block;
    flex: none;
    line-height: 0;
}

/* Songtitel als Link zu Spotify: sieht aus wie der Titel, unterstreicht bei Hover und Fokus. */
.g-song-link {
    color: inherit;
    text-decoration: none;
}

.g-song-link:hover,
.g-song-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Kopfzeile eines Abschnitts mit Spotify-Logo rechts; das Logo ist 84 px breit (Minimum 70 px). */
.g-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.75rem;
}

.g-section .g-head h2 {
    margin: 0;
}

.g-head .spotify-mark,
.g-spotify-row .spotify-mark {
    width: 5.25rem;
}

/* „Jetzt läuft“: Link zu Spotify links, Logo allein rechts (nicht im Satz). */
.g-spotify-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
}

.g-spotify-open {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.g-cover-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.g-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.g-song {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.g-sub,
.g-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.g-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    max-width: 11rem;
}

.g-vote {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    font: inherit;
    font-size: 1.05rem;
    color: var(--icon);
    background: transparent;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    cursor: pointer;
}

.g-vote:disabled {
    opacity: 0.35;
    cursor: default;
}

.g-vote-on {
    color: var(--cta-ink);
    background: var(--cta);
    border-color: var(--cta);
}

.g-score {
    min-width: 2rem;
    font-weight: 800;
    text-align: center;
}

.g-withdraw {
    flex-basis: 100%;
    margin-top: 0.25rem;
}

.g-wish {
    max-width: 11rem;
    line-height: 1.2;
}

.g-note {
    font-size: 0.85rem;
    text-align: right;
    color: var(--muted);
}

/* --- "Jetzt läuft" und Skip-Abstimmung (M5) --- */

.g-now {
    padding: 0.25rem 0 0;
    background: transparent;
    border: 0;
}

.g-now-main {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

/* Das große Cover bleibt unbeschnitten (4 px Rundung), die Rosé-Haarlinie liegt außen herum (SPEC 16.4, 16.8). */
.g-cover-big {
    width: 6rem;
    height: 6rem;
    margin: 0.4rem 0 0.4rem 0.4rem;
    border-radius: 4px;
    outline: 1.5px solid var(--rose);
    outline-offset: 0.3rem;
    box-shadow: none;
}

.g-now-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
}

.g-now-title {
    font-size: 1.6rem;
    line-height: 1.1;
}

.g-now .fl {
    margin-top: 0.9rem;
}

.g-skip {
    width: 100%;
    margin-top: 0.5rem;
}

.g-skip-on {
    border-color: var(--cta);
    color: var(--cta);
}

.g-explain {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.g-explain summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

.g-explain p {
    margin: 0.5rem 0 0;
}

/* --- Live-Steuerung und Sperrlisten (M7) --- */

.textarea {
    min-height: 9rem;
    font-size: 1rem;
    line-height: 1.4;
    resize: vertical;
}

.live-hint {
    margin: 0;
    font-size: 0.9rem;
}

.live-list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.live-row {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}

.live-row:first-child {
    border-top: 0;
}

.live-row-running {
    box-shadow: inset 3px 0 0 var(--muted);
    padding-left: 0.7rem;
}

.live-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
}

.live-main {
    display: flex;
    flex: 1 1 14rem;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.live-title {
    line-height: 1.3;
}

.live-pos {
    color: var(--muted);
}

.live-sub {
    font-size: 0.9rem;
}

.live-calc {
    margin-top: 0.2rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.live-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.live-actions .btn,
.live-block .btn,
.live-inline .btn {
    margin-top: 0;
}

.live-inline {
    display: inline-block;
    margin: 0;
}

.live-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.6rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.live-scope {
    width: auto;
    min-height: 2.75rem;
    font-size: 1rem;
}

.live-now {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.live-cover {
    flex: none;
    width: 4rem;
    height: 4rem;
    border-radius: 4px;
    object-fit: contain;
    background: var(--line);
}

.live-bar {
    flex: none;
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.live-bar-fill {
    width: 0;
    height: 100%;
    background: var(--muted);
}

.live-time {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* „Jetzt läuft“: alle Teile (Titel, Fortschritt, Knöpfe, Hinweise) mit gleichmäßigem Abstand untereinander */
.live-control {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.live-control > h2,
.live-control > .actions,
.live-control > .alert {
    margin: 0;
}

.live-control > .live-time {
    margin-top: -0.35rem;
}

/* Kopfzeile der Live-Seite: Knopf und Link mit Abstand zur Karte darunter */
.live-tools {
    margin: 0 0 0.5rem;
}

.live-tools + .print-status {
    margin-bottom: 1rem;
}

.live-badge {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* --- Bonus-Codes (M8) --- */

.g-choice {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 11rem;
}

.g-choice .g-wish {
    max-width: none;
}

.g-redeem {
    margin-top: 1.25rem;
}

.g-redeem .input {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Bonus-Stern in Rosé (SPEC 16.2) und die Bonus-Wahl mit Rosé-Rand */
.star {
    color: var(--rose);
}

.btn-bonus {
    border-color: var(--rose);
}

/* Bonus-Codes im Admin und als A4-Bogen (M8) */

.bonus-code {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.08em;
}

.bpage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 70mm;
    width: 100%;
    max-width: 194mm;
    margin: 1rem auto;
    color: var(--ink);
    background: #fff;
    border: 1px dashed #888;
}

/* Ein Feld des Bogens (SPEC 16.6): Wortmarke, Party-Name kursiv, Serifen-Titel, QR-Code, Code, eigener Text.
   Doppelter Rosé-Rahmen aus Linien (ohne Hintergrundfarben, damit es auch ohne „Hintergrundgrafiken“ druckt). */
.bcell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5.5mm 5mm 5mm;
    text-align: center;
    border: 1px dashed #888;
    overflow: hidden;
}

.bcell::before,
.bcell::after {
    content: "";
    position: absolute;
    border: 0.2mm solid var(--rose);
    pointer-events: none;
}

.bcell::before {
    inset: 2.2mm;
}

.bcell::after {
    inset: 3.2mm;
}

.bcell p {
    margin: 0;
}

.bcell-brand {
    padding-left: 0.45em;
    font-size: 2.5mm;
    font-weight: 600;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: var(--rose-dark);
}

.bcell-party {
    max-width: 100%;
    margin-top: 0.6mm !important;
    font-family: var(--font-display);
    font-size: 3.6mm;
    font-style: italic;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bcell-wishes {
    margin-top: 1.4mm !important;
    font-family: var(--font-display);
    font-size: 5.6mm;
    font-weight: 700;
    line-height: 1.1;
}

.bcell .star {
    color: var(--rose-dark);
}

.bcell-qr {
    width: 29mm;
    height: 29mm;
    margin: 1.8mm 0;
}

.bcell-code {
    font-size: 4mm;
    font-weight: 500;
    letter-spacing: 0.14em;
}

.bcell-text {
    margin-top: 0.8mm !important;
    font-family: var(--font-display);
    font-size: 3.2mm;
    font-style: italic;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

@media print {
    @page {
        size: A4;
        margin: 8mm;
    }

    .bpage {
        max-width: none;
        width: 194mm;
        margin: 0;
        border: 0;
        page-break-after: always;
        break-after: page;
    }

    .bpage:last-of-type {
        page-break-after: auto;
        break-after: auto;
    }
}

/* Drucken im Admin (M9) */

.token-box {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--line);
    border-radius: 0.5rem;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    word-break: break-all;
    user-select: all;
}

.field-help {
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.print-status {
    margin: 0;
}

/* Statistik im Admin (M10) */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.stat-grid > div {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

.stat-grid dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.stat-grid dd {
    margin: 0.15rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-list {
    margin: 0;
    padding-left: 1.5rem;
}

.stat-list li {
    padding: 0.35rem 0;
}

.stat-list li > span:first-child {
    overflow-wrap: anywhere;
}

.stat-n {
    margin-left: 0.5rem;
    color: var(--muted);
    white-space: nowrap;
}

.stat-bars {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stat-bars li {
    display: grid;
    grid-template-columns: 6.5rem 1fr 2.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
}

.stat-bars meter {
    width: 100%;
    height: 0.9rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

/* --- Admin: Sicherheit (M13) --- */

/* Die Absätze, die Liste und das Formular in den Karten bekommen etwas Luft. */
.security > * + * {
    margin-top: 0.85rem;
}

.security form > * + * {
    margin-top: 0.75rem;
}

.security h3 {
    margin: 0;
    font-size: 1.05rem;
}
