/* ==========================================================================
   ZOXZ Design-System
   Markenfarbe #C721B9, Logo-Schrift Baloo Bhaijaan 2 ExtraBold.
   Helle Oberflaeche, ruhiges Raster, grosse Tippflaechen.
   Mobile First, WCAG 2.2 AA als Ziel (Spec 49, 66).
   ========================================================================== */

/* --------------------------------------------------------------- Schriften

   Die Logo-Schrift liegt auf dem eigenen Server, nicht bei Google. Das
   Einbinden ueber fonts.googleapis.com uebertraegt die IP-Adresse jedes
   Besuchers in die USA – deutsche Gerichte werten das als Verstoss gegen
   die DSGVO (LG Muenchen I, 3 O 17493/20).

   Fehlen die Dateien unter /assets/fonts/, greift lautlos der Fallback aus
   --font-brand. Das Logo sieht dann etwas anders aus, die Seite bleibt aber
   vollstaendig benutzbar. Wie die Dateien dorthin kommen, steht in der
   README unter „Schriftart lokal einbinden“.
   ------------------------------------------------------------------------ */

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    font-style: normal;
    font-weight: 700;
    font-display: swap;   /* Text ist sofort lesbar, die Schrift tauscht nach */
    src: url('/assets/fonts/baloo-bhaijaan-2-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/baloo-bhaijaan-2-800.woff2') format('woff2');
}

:root {
    /* Marke */
    --brand: #C721B9;
    --brand-dark: #A2168F;
    --brand-darker: #7E116F;
    --brand-light: #F3CDEF;
    --brand-tint: #FCF2FB;

    /* Text */
    --ink: #1B1A1D;
    --ink-soft: #4E4B54;
    --ink-muted: #6E6A76;

    /* Flaechen: hell, ruhig, klar getrennt */
    --surface: #FFFFFF;
    --surface-alt: #F4F4F6;
    --surface-sunken: #EAEAEE;
    --border: #E3E3E8;
    --border-strong: #C6C5CE;

    /* Signalfarben */
    --success: #16704A;
    --success-bg: #E7F5EE;
    --warning: #855400;
    --warning-bg: #FFF3DC;
    --danger: #B02419;
    --danger-bg: #FDEBE9;
    --info: #17497F;
    --info-bg: #E9F1FB;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(27, 26, 29, .07);
    --shadow: 0 2px 10px rgba(27, 26, 29, .09);
    --shadow-lg: 0 10px 30px rgba(27, 26, 29, .14);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 36px;
    --space-7: 56px;

    --font-brand: 'Baloo Bhaijaan 2', 'Trebuchet MS', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --header-height: 62px;
    --bottom-nav-height: 60px;
    --container: 1280px;

    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface-alt);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 var(--space-3); font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.4rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--space-3); }

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

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

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

/* Icons erben Groesse und Farbe vom Text */
.icon { display: inline-block; vertical-align: -.15em; flex-shrink: 0; }

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

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--brand); color: #fff; padding: var(--space-3) var(--space-4);
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ Layout */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}
@media (min-width: 720px) { .container { padding-inline: var(--space-5); } }

.page { padding-block: var(--space-5) var(--space-7); min-height: 60vh; }

.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }

/* Schmale Spalte links, Inhalt rechts */
.layout-sidebar { display: grid; gap: var(--space-5); }
.layout-sidebar > * { min-width: 0; }
@media (min-width: 960px) {
    .layout-sidebar { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
}

/* Inhalt links, schmale Spalte rechts */
.layout-aside { display: grid; gap: var(--space-5); }
.layout-aside > * { min-width: 0; }
@media (min-width: 960px) {
    .layout-aside { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

/* Abschnitte mit klarer Ueberschrift und Luft dazwischen */
.section { margin-bottom: var(--space-6); }
.section-head {
    display: flex; flex-wrap: wrap; gap: var(--space-2);
    align-items: baseline; justify-content: space-between;
    margin-bottom: var(--space-4);
}
.section-head h2 { margin: 0; }

/* ------------------------------------------------------------------ Header */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-bar {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--header-height);
}

.logo {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: .01em;
    color: var(--brand);
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
}
.logo:hover { text-decoration: none; color: var(--brand-dark); }
@media (min-width: 720px) { .logo { font-size: 1.8rem; } }

/* „Beta“ neben dem Logo: hochgestellt, klein, in der Markenfarbe.
   Kein Umbruch und kein Platzverbrauch – es haengt am Schriftzug. */
.logo-tag {
    display: inline-block;
    margin-left: 5px;
    vertical-align: super;
    font-family: var(--font-body);
    font-size: .5em;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand);
    background: var(--brand-tint);
    border: 1px solid var(--brand-light);
    border-radius: var(--radius-pill);
    padding: 1px 7px;
    line-height: 1.5;
}
.admin-header .logo-tag { color: #fff; background: rgba(255, 255, 255, .16); border-color: transparent; }

/* Kompakte Suche im Kopf – nur auf Unterseiten, ab Tablet */
.header-search { flex: 1 1 auto; min-width: 0; display: none; }
@media (min-width: 900px) { .header-search { display: block; } }

.header-actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
@media (min-width: 720px) { .header-actions { gap: var(--space-2); } }

/* Auf dem Handy uebernimmt die untere Leiste Suche, Nachrichten und
   „Anzeige erstellen“. Der Kopf zeigt dort nur Glocke und Konto, sonst
   quetschen sich sechs Elemente in 390 px. */
@media (max-width: 899px) { .header-actions .hide-mobile { display: none; } }
@media (max-width: 559px) { .header-actions .hide-xs { display: none; } }

.icon-button {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}
.icon-button:hover { background: var(--surface-alt); color: var(--brand-dark); text-decoration: none; }
.icon-button[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }

/* Zaehlerpunkt an Nachrichten und Glocke */
.badge-dot {
    position: absolute; top: 5px; right: 5px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--brand); color: #fff;
    font-size: .65rem; font-weight: 700; line-height: 17px; text-align: center;
    border: 2px solid var(--surface);
    box-sizing: content-box;
}

/* Nutzermenü */
.user-menu { position: relative; }
.user-menu__panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
    min-width: 232px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
}
.user-menu__panel[hidden] { display: none; }
.user-menu__head {
    padding: var(--space-2) var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-2);
}
.user-menu__panel a, .user-menu__panel button {
    display: flex; align-items: center; gap: var(--space-3);
    width: 100%; padding: 10px var(--space-3);
    border: 0; background: none; font: inherit; text-align: left;
    color: var(--ink-soft); text-decoration: none; border-radius: var(--radius-sm);
    cursor: pointer;
}
.user-menu__panel a:hover, .user-menu__panel button:hover {
    background: var(--surface-alt); color: var(--brand-dark); text-decoration: none;
}

/* -------------------------------------------------------------- Bottom-Nav */

.bottom-nav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 8px rgba(27, 26, 29, .06);
}
.bottom-nav a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: var(--space-2) 2px;
    font-size: .68rem; line-height: 1.2; color: var(--ink-muted); text-decoration: none;
    min-height: var(--bottom-nav-height);
    text-align: center;
}
.bottom-nav a:hover { text-decoration: none; color: var(--brand-dark); }
.bottom-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.bottom-nav .nav-create { color: var(--brand); font-weight: 600; }
.bottom-nav .badge-dot { top: 4px; right: calc(50% - 22px); border-color: var(--surface); }
@media (min-width: 900px) { .bottom-nav { display: none; } }
@media (max-width: 899px) { body { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); } }

/* ------------------------------------------------------------------ Button */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit; font-weight: 600; line-height: 1.2;
    cursor: pointer; text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--ink-muted); }

.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--brand-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8C1C13; color: #fff; }

.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- Karte */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}
.card-flush { padding: 0; overflow: hidden; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}
@media (min-width: 720px) { .panel { padding: var(--space-5); } }

/* ---------------------------------------------------------- Anzeigen-Karten */

.listing-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) { .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } }
@media (min-width: 1200px) { .listing-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.listing-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.listing-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

/* Hochformat 5:7 (Spec 49.1) */
.listing-card__media {
    position: relative;
    aspect-ratio: 5 / 7;
    background: var(--surface-sunken);
    overflow: hidden;
}
.listing-card__media img { width: 100%; height: 100%; object-fit: cover; }

.listing-card__body { padding: var(--space-3); display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* Titel bleiben schwarz – eine Kachel voller farbiger Zeilen wird unruhig.
   Der Hinweis „hier kann man klicken“ kommt aus der Kachel selbst. */
.listing-card a { color: inherit; }
.listing-card a:hover { text-decoration: none; }
.listing-card:hover .listing-card__title { color: var(--brand-dark); }
.listing-card__title {
    font-size: .95rem; font-weight: 600; color: var(--ink); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin: 0;
}
.listing-card__price { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.listing-card__meta { font-size: .78rem; color: var(--ink-muted); margin-top: auto; padding-top: 4px; }
.listing-card__link::after { content: ''; position: absolute; inset: 0; }

/* ------------------------------------------------------- Altersfreigabe */

/* Das Bild bleibt dasselbe, nur die Darstellung ist unscharf. Zusätzlich
   verkleinert, damit auch am Rand nichts Scharfes stehen bleibt. */
.listing-card.is-restricted .listing-card__media img {
    filter: blur(18px) saturate(.7);
    transform: scale(1.15);
}
.listing-card.is-restricted .listing-card__media {
    background: var(--surface-sunken);
}

.age-badge {
    position: absolute; inset: 0; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-brand);
    font-size: 1.6rem; font-weight: 800; letter-spacing: .02em;
    color: #fff;
    background: rgba(27, 26, 29, .42);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
    pointer-events: none;
}
@media (min-width: 960px) { .age-badge { font-size: 1.9rem; } }

/* Großes Siegel auf der Sperrseite */
.age-seal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 92px; height: 92px; margin: 0 auto var(--space-4);
    border: 4px solid var(--danger);
    border-radius: var(--radius-pill);
    font-family: var(--font-brand);
    font-size: 2rem; font-weight: 800;
    color: var(--danger);
}

.favorite-button {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-pill);
    border: none; cursor: pointer;
    background: rgba(255, 255, 255, .94);
    color: var(--ink-soft);
    box-shadow: var(--shadow-sm);
}
.favorite-button[aria-pressed="true"] { color: var(--brand); }
.favorite-button:hover { background: #fff; color: var(--brand); }

/* -------------------------------------------------------------------- Badge */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .74rem; font-weight: 600;
    background: var(--surface-sunken); color: var(--ink-soft);
    white-space: nowrap;
}
.badge-brand { background: var(--brand-tint); color: var(--brand-darker); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

.status-overlay {
    position: absolute; inset-inline: 0; bottom: 0;
    padding: 6px var(--space-3);
    background: rgba(27, 26, 29, .8); color: #fff;
    font-size: .78rem; font-weight: 600; text-align: center;
}

/* ------------------------------------------------------------------ Formular */

.field { margin-bottom: var(--space-4); }
.field > label, .field-label {
    display: block; margin-bottom: 6px;
    font-size: .88rem; font-weight: 600; color: var(--ink-soft);
}
.field-hint { font-size: .8rem; color: var(--ink-muted); margin-top: 5px; }
.field-error { font-size: .82rem; color: var(--danger); margin-top: 5px; font-weight: 600; }

.input, .select, .textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--ink-muted); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand); outline: 2px solid var(--brand-light); outline-offset: 0;
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 140px; resize: vertical; }

/* Eigener Pfeil, damit Auswahlfelder ueberall gleich aussehen */
.select {
    appearance: none; -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234E4B54'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
}

.checkbox, .radio { display: flex; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-3); }
.checkbox input, .radio input { margin-top: 2px; width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.checkbox label, .radio label { font-size: .95rem; }

.field-row { display: grid; gap: var(--space-3); }
@media (min-width: 640px) { .field-row-2 { grid-template-columns: 1fr 1fr; } .field-row-3 { grid-template-columns: repeat(3, 1fr); } }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); margin: 0 0 var(--space-5); }
legend { font-weight: 700; padding-inline: var(--space-2); }

/* --------------------------------------------------------------- Startseite */

.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-block: var(--space-5) var(--space-6);
}
.hero h1 {
    font-family: var(--font-brand); font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    margin-bottom: var(--space-2);
}
.hero p { color: var(--ink-soft); max-width: 56ch; margin-bottom: var(--space-5); }

/* Suchleiste: auf dem Handy gestapelt, ab Tablet eine Zeile mit Trennlinien */
.search-bar {
    display: grid; gap: var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    box-shadow: var(--shadow-sm);
}
.search-bar__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search-bar__field > label {
    font-size: .78rem; font-weight: 600; color: var(--ink-muted);
    text-transform: uppercase; letter-spacing: .03em;
}
.search-bar .input, .search-bar .select { border-color: var(--border); }
.search-bar__submit { align-self: end; }
.search-bar__submit .btn { width: 100%; }

@media (min-width: 900px) {
    .search-bar {
        grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .9fr) auto;
        align-items: end;
        gap: 0;
        padding: var(--space-2);
    }
    .search-bar__field { padding-inline: var(--space-3); border-left: 1px solid var(--border); }
    .search-bar__field:first-child { border-left: 0; }
    .search-bar .input, .search-bar .select {
        border: 0; padding-inline: 0; min-height: 38px; background: transparent;
    }
    .search-bar .select { padding-right: 26px; background-position: right 2px center; }
    .search-bar .input:focus, .search-bar .select:focus { outline-offset: 3px; }
    .search-bar__submit { padding-left: var(--space-3); }
    .search-bar__submit .btn { width: auto; }
}

/* Kompakte Variante im Seitenkopf */
.header-search .search-bar {
    padding: 0; border: 0; box-shadow: none; background: transparent;
    grid-template-columns: minmax(0, 1fr) 120px auto; gap: var(--space-2);
    align-items: center;
}
.header-search .search-bar__field { padding: 0; border: 0; }
.header-search .search-bar .input {
    border: 1px solid var(--border-strong); background: var(--surface);
    padding-inline: 13px; min-height: 44px;
}

/* Kachelnavigation statt Blasen */
.tile-nav {
    display: grid; gap: var(--space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 560px) { .tile-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tile-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); } }
.tile {
    display: flex; align-items: center; gap: var(--space-2);
    min-height: 56px;
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--ink); text-decoration: none;
    font-weight: 600; font-size: .9rem; line-height: 1.25;
    transition: border-color .12s ease, box-shadow .12s ease;
}
@media (min-width: 560px) { .tile { gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: .95rem; } }
.tile:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow-sm); color: var(--brand-dark); }
.tile__count { font-size: .8rem; font-weight: 600; color: var(--ink-muted); flex-shrink: 0; }
.tile .icon { color: var(--brand); }

/* ------------------------------------------------------------------- Alerts */

.alert {
    display: flex; gap: var(--space-3); align-items: flex-start;
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
    font-size: .93rem;
}
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #B9E0CC; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #F3C4BF; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #EDD5A4; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #C2D8F0; }

/* --------------------------------------------------------------- Empty/Load */

.empty-state {
    text-align: center;
    padding: var(--space-7) var(--space-4);
    color: var(--ink-muted);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-state h2 { color: var(--ink); }

.skeleton {
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--surface-alt) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

/* --------------------------------------------------------------- Pagination */

.pagination { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: var(--space-6); }
.pagination a, .pagination span {
    min-width: 44px; min-height: 44px; padding: 10px 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--ink-soft); text-decoration: none; background: var(--surface);
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination [aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* ------------------------------------------------------------------ Filters */

.filter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.filter-panel h2 { font-size: 1rem; }
.filter-group + .filter-group { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* Auf dem Handy als aufklappbarer Block, damit die Treffer oben stehen */
.filter-toggle { display: block; width: 100%; margin-bottom: var(--space-3); }
@media (min-width: 960px) {
    .filter-toggle { display: none; }
    .filter-panel[hidden] { display: block !important; }
}

.chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: .85rem; color: var(--ink-soft); text-decoration: none;
}
.chip:hover, .chip[aria-current="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); text-decoration: none; }

/* -------------------------------------------------------------- Detailseite */

/* Auf dem Handy: Bild, dann Preis und Kontakt, dann Beschreibung.
   Ab 960 px liegen Bild und Beschreibung links, die Angaben rechts. */
.listing-detail { display: grid; gap: var(--space-4); }
.listing-detail > * { min-width: 0; }
.listing-detail__media { order: 1; }
.listing-detail__info { order: 2; }
.listing-detail__description { order: 3; }

@media (min-width: 960px) {
    .listing-detail {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        grid-template-areas: "media info" "desc info";
        align-items: start;
        gap: var(--space-5);
    }
    .listing-detail__media { grid-area: media; }
    .listing-detail__info { grid-area: info; }
    .listing-detail__description { grid-area: desc; }
}

.gallery__main {
    aspect-ratio: 5 / 7; max-height: 620px;
    background: var(--surface-sunken);
    border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border);
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-sunken); }
.gallery__thumbs { display: flex; gap: var(--space-2); margin-top: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.gallery__thumbs button {
    flex: 0 0 64px; width: 64px; aspect-ratio: 5/7;
    border-radius: var(--radius-sm); overflow: hidden; padding: 0;
    border: 2px solid var(--border); background: none; cursor: pointer;
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--brand); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.price-tag { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.1; }

.spec-list { display: grid; gap: 0; margin: 0; }
.spec-list > div { display: grid; grid-template-columns: 40% 1fr; gap: var(--space-3); padding: 11px 0; border-bottom: 1px solid var(--border); }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { color: var(--ink-muted); font-size: .88rem; }
/* Lange E-Mail-Adressen und IDs duerfen umbrechen, sonst schieben sie die
   ganze Seite nach rechts. */
.spec-list dd { margin: 0; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
@media (max-width: 439px) {
    .spec-list > div { grid-template-columns: 1fr; gap: 2px; }
}
/* Verweise in der Angabenliste bleiben dunkel und werden erst beim
   Ueberfahren farbig – sonst leuchtet die halbe Tabelle magenta. */
.spec-list dd a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.spec-list dd a:hover { color: var(--brand-dark); text-decoration-color: currentColor; }

.seller-box { display: flex; gap: var(--space-3); align-items: center; }
.avatar {
    width: 48px; height: 48px; border-radius: var(--radius-pill);
    background: var(--brand-tint); color: var(--brand-darker);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.05rem; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; font-size: 1.6rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .78rem; }

/* Auf dem Handy bleibt die Kontaktleiste ueber der Bottom-Nav stehen */
.action-bar { display: grid; gap: var(--space-2); }
@media (max-width: 899px) {
    .action-bar {
        position: sticky; bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        z-index: 40;
        background: var(--surface);
        border-top: 1px solid var(--border);
        margin-inline: calc(var(--space-4) * -1);
        padding: var(--space-3) var(--space-4);
        grid-auto-flow: column; grid-auto-columns: 1fr;
    }
}

/* ----------------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 620px; }
table.data th, table.data td { padding: 12px var(--space-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: var(--surface-alt); font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data a:not(.btn) { color: var(--brand-dark); font-weight: 600; }

/* --------------------------------------------------------------- Nachrichten */

.messages-layout { display: grid; gap: var(--space-4); }
.messages-layout > * { min-width: 0; }
@media (min-width: 900px) { .messages-layout { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } }

.conversation-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.conversation-list a { display: flex; gap: var(--space-3); padding: var(--space-3); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.conversation-list a:last-child { border-bottom: 0; }
.conversation-list a:hover { background: var(--surface-alt); text-decoration: none; }
.conversation-list a.is-unread { background: var(--brand-tint); }

.message-thread { display: flex; flex-direction: column; gap: var(--space-3); max-height: 60vh; overflow-y: auto; padding: var(--space-2); }
.message {
    max-width: 82%; padding: 10px var(--space-3);
    border-radius: var(--radius); background: var(--surface-sunken);
    font-size: .95rem; word-break: break-word;
}
.message.is-own { margin-left: auto; background: var(--brand); color: #fff; }
.message.is-system { margin-inline: auto; background: transparent; border: 1px dashed var(--border-strong); color: var(--ink-muted); font-size: .82rem; }
.message time { display: block; font-size: .72rem; opacity: .8; margin-top: 4px; }

/* --------------------------------------------------------------- Kontobereich */

.account-layout { display: grid; gap: var(--space-5); }
.account-layout > * { min-width: 0; }
@media (min-width: 960px) { .account-layout { grid-template-columns: 250px minmax(0, 1fr); align-items: start; } }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 11px var(--space-3); border-radius: var(--radius-sm);
    color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.side-nav a:hover { background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-darker); font-weight: 700; }
.side-nav a[aria-current="page"] .icon { color: var(--brand); }
.side-nav .icon { color: var(--ink-muted); }

/* Zaehler in Navigationseintraegen (ungelesene Nachrichten, offene Meldungen) */
.nav-count {
    margin-left: auto; flex-shrink: 0;
    font-size: .75rem; font-weight: 700;
    color: #fff; background: var(--brand);
    border-radius: var(--radius-pill); padding: 1px 8px;
}
@media (max-width: 959px) {
    .side-nav {
        flex-direction: row; overflow-x: auto; gap: var(--space-1);
        padding-bottom: var(--space-2); scrollbar-width: thin;
    }
    .side-nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--border); }
}

.stat-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: var(--space-4);
}
.stat__value { font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1.15; }
.stat__label { font-size: .82rem; color: var(--ink-muted); }

/* -------------------------------------------------------------------- Footer */

.site-footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding-block: var(--space-6); margin-top: var(--space-7);
    font-size: .9rem; color: var(--ink-muted);
}
.footer-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.footer-grid h3 { font-size: .9rem; color: var(--ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-soft); }

/* --------------------------------------------------------------- Uploadfeld */

.upload-zone {
    border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-4); text-align: center; background: var(--surface);
    transition: border-color .12s ease, background-color .12s ease;
}
.upload-zone.is-dragover { border-color: var(--brand); background: var(--brand-tint); }
.upload-zone .icon { color: var(--ink-muted); }

/* Fortschritt je Datei */
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.upload-row {
    display: grid; align-items: center; gap: var(--space-3);
    grid-template-columns: minmax(0, 1fr) 90px;
    padding: var(--space-2) var(--space-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .85rem;
}
@media (min-width: 560px) { .upload-row { grid-template-columns: minmax(0, 1fr) 140px 90px; } }
.upload-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row__bar { display: none; height: 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
@media (min-width: 560px) { .upload-row__bar { display: block; } }
.upload-row__fill { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s linear; }
.upload-row__state { text-align: right; }
.upload-row.is-done .upload-row__fill { background: var(--success); }
.upload-row.is-failed { border-color: var(--danger); background: var(--danger-bg); }
.upload-row.is-failed .upload-row__fill { background: var(--danger); }
.upload-row.is-failed .upload-row__state { color: var(--danger); text-align: left; grid-column: 1 / -1; }

/* Bildkacheln mit Sortiergriff */
.image-manager {
    display: grid; gap: var(--space-3);
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.image-manager figure {
    position: relative; margin: 0;
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: var(--surface-sunken);
}
.image-manager img { aspect-ratio: 5/7; object-fit: cover; width: 100%; }
.image-manager figcaption { position: absolute; top: 6px; left: 6px; }

.image-tile { cursor: grab; transition: box-shadow .12s ease, opacity .12s ease; }
.image-tile:hover { box-shadow: var(--shadow); }
.image-tile.is-dragging { opacity: .45; cursor: grabbing; }
.image-tile__badge { position: absolute; top: 6px; left: 6px; }

/* Aktionsleiste am unteren Rand der Kachel */
.image-tile__actions {
    position: absolute; inset-inline: 0; bottom: 0;
    display: flex; justify-content: center; gap: 2px;
    padding: 4px;
    background: linear-gradient(transparent, rgba(27, 26, 29, .72));
}
.image-tile__actions .icon-button {
    width: 34px; height: 34px;
    color: #fff; border-radius: var(--radius-sm);
}
.image-tile__actions .icon-button:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.image-tile__actions .icon-button:disabled { opacity: .4; cursor: not-allowed; }

/* ==========================================================================
   Adminbereich
   Eigene Farben statt der Textvariablen, damit Schrift und Hintergrund
   nie zusammenfallen koennen.
   ========================================================================== */

.admin-body {
    background: var(--surface-alt);
    --admin-bar: #241F2A;
    --admin-bar-ink: #F5F2F7;
    --admin-bar-muted: #B7AEC0;
}

.admin-header {
    background: var(--admin-bar);
    color: var(--admin-bar-ink);
    border-bottom: 3px solid var(--brand);
    position: sticky; top: 0; z-index: 50;
}
.admin-header a { color: var(--admin-bar-ink); }
.admin-header .logo { color: #fff; font-size: 1.35rem; }
.admin-header .logo:hover { color: #fff; }
.admin-header .header-bar { min-height: 56px; }
.admin-user { display: flex; align-items: center; gap: var(--space-2); font-size: .88rem; color: var(--admin-bar-muted); min-width: 0; }
.admin-user strong { color: var(--admin-bar-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
/* Auf dem Handy nur Name und ein Symbol – Rolle und Beschriftung sprengen
   sonst die Kopfzeile. */
@media (max-width: 599px) {
    .admin-user .nowrap { display: none; }
    .admin-header .btn-ghost span:not(.icon) { display: none; }
    .admin-header .btn-ghost { padding-inline: 10px; }
}
.admin-header .btn-ghost { color: var(--admin-bar-ink); }
.admin-header .btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.admin-header .icon-button { color: var(--admin-bar-ink); }
.admin-header .icon-button:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* Zweispaltiges Grundgeruest: Navigation links, Inhalt rechts */
.admin-shell { display: block; }
.admin-shell > * { min-width: 0; }
@media (min-width: 1000px) {
    .admin-shell {
        display: grid; grid-template-columns: 244px minmax(0, 1fr);
        gap: var(--space-5); align-items: start;
    }
}

.admin-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
}
@media (min-width: 1000px) { .admin-sidebar { position: sticky; top: calc(56px + var(--space-5)); } }
@media (max-width: 999px) { .admin-sidebar { margin-bottom: var(--space-4); } }

.admin-sidebar__group + .admin-sidebar__group { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.admin-sidebar__title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-muted); padding: 0 var(--space-3) var(--space-2);
    margin: 0;
}
.admin-sidebar a {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 10px var(--space-3); border-radius: var(--radius-sm);
    color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500;
}
.admin-sidebar a:hover { background: var(--surface-alt); color: var(--brand-dark); text-decoration: none; }
.admin-sidebar a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-darker); font-weight: 700; }
.admin-sidebar a[aria-current="page"] .icon { color: var(--brand); }
.admin-sidebar .icon { color: var(--ink-muted); }


/* Unter 1000 px wird die Navigation zu einer scrollbaren Leiste */
@media (max-width: 999px) {
    .admin-sidebar { padding: var(--space-2); }
    .admin-sidebar__nav { display: flex; gap: var(--space-1); overflow-x: auto; padding-bottom: 2px; }
    .admin-sidebar__group + .admin-sidebar__group { margin: 0; padding: 0; border: 0; }
    .admin-sidebar__group { display: contents; }
    .admin-sidebar__title { display: none; }
    .admin-sidebar a { white-space: nowrap; border: 1px solid var(--border); }
}

/* Alte Klasse bleibt nutzbar, falls noch irgendwo referenziert */
.admin-nav { display: flex; gap: var(--space-1); overflow-x: auto; padding-block: var(--space-2); }
.admin-nav a { padding: 8px var(--space-3); border-radius: var(--radius-sm); font-size: .88rem; white-space: nowrap; text-decoration: none; color: var(--admin-bar-ink); }
.admin-nav a:hover { background: rgba(255, 255, 255, .14); }
.admin-nav a[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 600; }

/* Kennzahlen im Adminbereich */
.metric-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius); padding: var(--space-3) var(--space-4);
}
.metric__value { font-size: 1.7rem; font-weight: 800; line-height: 1.15; color: var(--ink); }
.metric__label { font-size: .82rem; color: var(--ink-muted); }
.metric--brand { border-left-color: var(--brand); }
.metric--success { border-left-color: var(--success); }
.metric--warning { border-left-color: var(--warning); }
.metric--danger { border-left-color: var(--danger); }
.metric--danger .metric__value { color: var(--danger); }

/* ------------------------------------------------------------------ Utility */

.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--space-6); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }

.muted { color: var(--ink-muted); }
.small { font-size: .85rem; }
.strong { font-weight: 700; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-word { word-break: break-word; }
.break-all { word-break: break-all; }
.min-w-0 { min-width: 0; }
.no-wrap-flex { flex-wrap: nowrap; }
.align-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.w-auto { width: auto; }

/* Abstaende: dieselbe Skala wie --space-*, damit alles im Raster bleibt.
   Diese Klassen ersetzen Inline-Styles, die von der Content-Security-Policy
   blockiert wuerden (Spec 43). */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.mx-auto { margin-inline: auto; }

/* Schriftgroessen */
.fs-sm { font-size: .93rem; }
.fs-md { font-size: 1rem; }
.fs-lg { font-size: 1.05rem; }
.fs-xl { font-size: 1.1rem; }
.fs-2xl { font-size: 1.25rem; }
.fs-3xl { font-size: 1.4rem; }

/* Lesbare Spaltenbreiten fuer schmale Formularseiten */
.mw-xs { max-width: 340px; }
.mw-sm { max-width: 420px; }
.mw-md { max-width: 480px; }
.mw-lg { max-width: 560px; }
.mw-xl { max-width: 640px; }
.mw-cell { max-width: 280px; }

/* Kleines Vorschaubild in Listen und Verlaeufen */
.thumb { border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }

/* Feste Spaltenbreiten in Filterleisten */
.w-110 { width: 110px; }
.w-150 { width: 150px; }
.mw-180 { min-width: 180px; }
.p-1 { padding: var(--space-1); }
.mt-tight { margin-top: -8px; }
.list-indent { padding-left: 20px; }
.muted-strong { opacity: .85; }
.text-on-dark { color: #fff; }
.logo-suffix { font-size: .7em; opacity: .75; font-weight: 700; }

/* Antwort im Meldungsverlauf einruecken */
.reply-indent {
    margin-left: var(--space-5);
    padding-left: var(--space-4);
    border-left: 2px solid var(--border);
}
@media (max-width: 599px) { .reply-indent { margin-left: var(--space-3); padding-left: var(--space-3); } }

/* Textfeld für HTML-Quelltext: feste Schrittweite, mehr Zeilen sichtbar */
.code-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85rem;
    line-height: 1.55;
    min-height: 420px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Vorformatierte Fehlerausgabe */
.code-block {
    text-align: left; overflow: auto;
    background: var(--surface-sunken); padding: var(--space-3);
    border-radius: var(--radius-sm); font-size: .8rem;
}

/* -------------------------------------------------- Benachrichtigungszeile */

.notification-row {
    display: flex; gap: var(--space-3); align-items: flex-start; width: 100%;
    padding: var(--space-3); text-align: left; cursor: pointer;
    background: var(--surface); border: none; border-bottom: 1px solid var(--border);
    font: inherit; color: inherit;
}
.notification-row:hover { background: var(--surface-alt); }
.notification-row.is-unread { background: var(--brand-tint); }
.notification-row__text { flex: 1; min-width: 0; display: block; }
.notification-row__text .small { display: block; }

/* ------------------------------------------------------- Cookie-Hinweis

   Ein <dialog>, das der Browser selbst in die oberste Ebene hebt. Deshalb
   braucht es hier keinen z-index-Wettlauf mit Kopfzeile und Fussleiste.
   Auf dem Handy dieselbe Karte, nur breiter – nicht als Leiste unten, wo
   sie mit der Navigationsleiste um denselben Platz streiten wuerde. */

.cookie-modal {
    /* <dialog> bringt eigene Vorgaben mit: alles zuruecksetzen */
    padding: 0;
    border: 0;
    background: transparent;
    max-width: min(440px, calc(100vw - 2 * var(--space-4)));
    width: 100%;
    color: inherit;
    overflow: visible;
}
.cookie-modal::backdrop {
    background: rgba(27, 26, 29, .55);
    backdrop-filter: blur(2px);
}

.cookie-modal__card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
    text-align: center;
}
@media (max-width: 480px) {
    .cookie-modal__card { padding: var(--space-4); }
}

.cookie-modal__icon {
    display: inline-grid; place-items: center;
    width: 52px; height: 52px;
    margin-bottom: var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--brand-tint);
    color: var(--brand);
}

.cookie-modal__title {
    margin: 0 0 var(--space-2);
    font-family: var(--font-brand);
    font-size: 1.25rem;
    line-height: 1.2;
}

/* Linksbündig: eine fünfzeilige zentrierte Textwand liest sich schlecht,
   weil jede Zeile woanders anfängt. Symbol und Überschrift bleiben mittig. */
.cookie-modal__text {
    margin: 0 0 var(--space-4);
    font-size: .92rem;
    line-height: 1.55;
    color: var(--ink-soft);
    text-align: left;
    text-wrap: pretty;
}
.cookie-modal__text strong { color: var(--ink); }

.cookie-modal__actions {
    display: grid;
    gap: var(--space-2);
}

/* Auftritt: kurz und leise. Wer Bewegung abbestellt hat, bekommt keine. */
.cookie-modal[open] { animation: cookie-modal-in .22s ease-out; }
.cookie-modal[open]::backdrop { animation: cookie-backdrop-in .22s ease-out; }

@keyframes cookie-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes cookie-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .cookie-modal[open], .cookie-modal[open]::backdrop { animation: none; }
}

/* ------------------------------------------------------------------ Drucken */

@media print {
    .site-header, .bottom-nav, .site-footer, .admin-header, .admin-sidebar, .action-bar { display: none !important; }
    body { background: #fff; padding-bottom: 0; }
}
