/* Schrift "Permanent Marker" von Font Diner, Apache License 2.0 -
   Lizenztext: assets/fonts/permanent-marker-LICENSE.txt */
@font-face {
    font-family: 'Permanent Marker';
    src: url('/assets/fonts/permanent-marker.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --accent: #e6007e;   /* Pink-Akzent der Marke */
    --ink: #1a1a1a;
    --marker: 'Permanent Marker', "Comic Sans MS", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: #e6e6e6;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Kopfbalken: schwarz, Titel + Tagline zentriert. */
.site-header {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 1.35rem 1rem 1.15rem;
}

.site-brand {
    display: inline-block;
    color: #fff;
    line-height: 1.1;
}

.site-brand:hover {
    text-decoration: none;
}

.site-title {
    display: block;
    font-weight: 800;
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
}

.site-tagline {
    display: block;
    margin-top: 0.3rem;
    font-size: clamp(0.8rem, 1.8vw, 1.05rem);
    font-weight: 400;
    color: #e8e8e8;
}

/* Navigationsleiste: dunkelgrau, Burger links, Kategorien mittig, Suche rechts. */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #2b2b2b;
    padding: 0.55rem 1.25rem;
    border-bottom: 3px solid var(--accent);
}

.nav-menu,
.nav-dropdown {
    position: relative;
}

.nav-menu > summary,
.nav-search {
    display: flex;
    align-items: center;
    color: #fff;
    cursor: pointer;
    list-style: none;
}

.nav-menu > summary::-webkit-details-marker {
    display: none;
}

.nav-menu > summary .nav-burger,
.nav-menu > summary .nav-burger::before,
.nav-menu > summary .nav-burger::after {
    display: block;
    width: 22px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.nav-menu > summary .nav-burger {
    position: relative;
}

.nav-menu > summary .nav-burger::before,
.nav-menu > summary .nav-burger::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-menu > summary .nav-burger::before { top: -7px; }
.nav-menu > summary .nav-burger::after  { top: 7px; }

.nav-menu[open] > summary,
.nav-search:hover {
    color: var(--accent);
}

.nav-search svg { width: 22px; height: 22px; display: block; }

/* Kategorien mittig mit pinker Unterstreichung. */
.nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid var(--accent);
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown > summary::after {
    content: " \25BE";
    font-size: 0.7em;
}

.nav-dropdown[open] > summary,
.nav-dropdown > summary:hover {
    color: var(--accent);
}

/* Ausklapp-Panels (Burger-Menue + Kategorien) - heller Kasten unter der Leiste. */
.nav-menu-list,
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 0.35rem 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: 3px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.nav-menu-list { left: 0; }

.nav-dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
}

.nav-menu-list a,
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.45rem 1.1rem;
    color: var(--ink);
    font-size: 0.92rem;
    white-space: nowrap;
}

.nav-menu-list a:hover,
.nav-dropdown-menu a:hover {
    background: #f4f4f4;
    color: var(--accent);
    text-decoration: none;
}

/* Fusszeile hell auf hellem Grund. */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ccc;
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #555;
}

.site-footer nav a {
    margin-left: 1rem;
}

.site-footer nav a:first-child {
    margin-left: 0;
}

.site-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
}

.tiles {
    display: grid;
    /* Groessere Kacheln auf dem Desktop: minmax-Untergrenze bestimmt, wie viele
       Spalten passen. 260px ergibt bei 1240px Container ~4 Spalten (statt ~6 bei
       180px) - die Bilder werden also deutlich groesser, ohne dass die Reihe
       auf schmaleren Fenstern zu leer wird (dort greifen entsprechend 3/2). */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem 1.25rem;
}

/* Auf dem Handy zwei feste Spalten (wie in der Vorlage). */
@media (max-width: 560px) {
    .tiles {
        grid-template-columns: 1fr 1fr;
        gap: 1rem 0.8rem;
    }
}

/* Kacheln im Polaroid-Look: weisser Rahmen, Foto oben, Titel darunter,
   Schlagschatten. Beim Hover leicht angehoben. */
.tile {
    display: block;
    color: inherit;
    background: #fff;
    padding: 0.55rem 0.55rem 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tile:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.tile img,
.tile-noimage {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #ddd;
}

.tile-title {
    display: block;
    padding: 0.5rem 0.15rem 0.85rem;
    font-family: var(--marker);
    font-size: 1.02rem;
    line-height: 1.15;
    color: var(--ink);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2.5rem;
    font-size: 1.05rem;
}

.pagination-current {
    color: #444;
    font-weight: 600;
}

/* Schwebender "Bearbeiten"-Button, nur fuer eingeloggte Admins (oben links). */
.admin-edit-fab {
    position: fixed;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 100;
    padding: 0.45rem 0.95rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.admin-edit-fab:hover {
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
}

/* Umkreis-Pruefung (Dopplungs-Warnung) im Standort-Feld. */
.nearby-posts {
    margin: 0.6rem 0 0;
}

.nearby-empty {
    margin: 0.4rem 0;
    color: #2e7d32;
    font-size: 0.9rem;
}

.nearby-warn {
    margin: 0.4rem 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.nearby-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nearby-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem 0.25rem 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    color: var(--ink);
    font-size: 0.82rem;
}

.nearby-item:hover {
    text-decoration: none;
    border-color: var(--accent);
}

.nearby-item img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 3px;
}

.admin-upload-form {
    margin: 0.75rem 0;
}

.post-categories {
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

/* Kategorie-Farben: jede Kategorie eine eigene Akzentfarbe (--cat), genutzt
   fuer Tags (Post-Seite), Punkte (Menue) und Ueberschriften (Kategorieseite).
   Faellt fuer unbekannte Slugs auf das Markenrot zurueck. */
.cat-graffiti       { --cat: #2f6fed; }
.cat-sticker        { --cat: #e8730c; }
.cat-stencil        { --cat: #0f9d8f; }
.cat-fliesen        { --cat: #c98a00; }
.cat-figuren        { --cat: #c0398b; }
.cat-plakat-cut-out { --cat: #3a9647; }
.cat-other          { --cat: #6b7280; }
.cat-news           { --cat: #7c5cbf; }
.cat-streetart      { --cat: #b5322b; }

.cat-tag {
    display: inline-block;
    padding: 0.18rem 0.7rem;
    margin: 0 0.4rem 0.4rem 0;
    border-radius: 999px;
    background: var(--cat, #b5322b);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.cat-tag:hover {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
}

.cat-dot {
    flex: none;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--cat, #b5322b);
}

.cat-heading {
    display: inline-block;
    border-bottom: 4px solid var(--cat, #b5322b);
    padding-bottom: 0.15rem;
}

.post-photographer {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0 0;
}

/* Hinweis-Icon bei KI-unterstuetzter Beschreibung (posts.body_ai_generated).
   Erklaerung per nativem title-Attribut beim Hover, s. renderPostAiHint(). */
.post-ai-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0.5rem 0 0;
    cursor: help;
}
@media (prefers-color-scheme: dark) {
    .post-ai-hint { color: #aaa; }
}

.post-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0.15rem 0 0.6rem;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.post-image {
    margin: 0;
}

.post-image img {
    border-radius: 4px;
}

.post-body {
    margin: 1.5rem 0;
}

.post-body p {
    margin: 0 0 1rem;
}

.post-map {
    height: 300px;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.comments-archive-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.comments-archive,
.comment-archive-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-archive-replies {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

.comment-archive-item {
    margin: 1rem 0;
}

.comment-meta {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.static-page p {
    margin: 0 0 1rem;
}

.static-page h2,
.static-page h3,
.static-page h4 {
    margin-top: 2rem;
}

/* Kartenseite (P4.4): Karte soll die volle Breite nutzen statt der
   sonst ueblichen max-width des Content-Containers. */
.site-main:has(#map) {
    max-width: none;
    padding: 0;
}

/* "Der Halle-Stream" (backlog.md, Konzept A): gleicher Breakout-Trick wie
   bei der Karte - volle Breite statt Content-Container. */
.site-main:has(.stream-page) {
    max-width: none;
    padding: 0;
}

/* Bewusst immer dunkel, unabhaengig vom Farbschema des Systems - das ist
   hier ein bewusstes Gestaltungsmittel (Galerie-Installation), keine
   Frage von hell/dunkel. */
.stream-page {
    position: relative;
    min-height: calc(100vh - 4.5rem);
    background: #0b0b0d;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stream-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-loading {
    color: #999;
    font-size: 0.95rem;
}

.stream-center {
    position: relative;
    z-index: 2;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    width: min(56vmin, 480px);
    height: min(56vmin, 480px);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s ease;
}
.stream-center img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.stream-center.is-hub {
    width: min(34vmin, 280px);
    height: min(34vmin, 280px);
    transform: scale(1);
}

.stream-post-link {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: #ddd;
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.stream-post-link:hover {
    color: #fff;
    border-color: #fff;
}

.stream-ring {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.stream-neighbor {
    position: absolute;
    width: min(16vmin, 130px);
    height: min(16vmin, 130px);
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    border: 0;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
}
.stream-neighbor.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
.stream-neighbor:hover {
    transform: translate(-50%, -50%) scale(1.08);
}
.stream-neighbor img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stream-breadcrumb {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
}
.stream-crumb {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
.stream-crumb.is-current {
    opacity: 1;
    border-color: var(--accent);
}
.stream-crumb:hover {
    opacity: 0.85;
}
.stream-crumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stream-exit {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    z-index: 4;
    color: #ccc;
    font-size: 1.4rem;
    text-decoration: none;
    line-height: 1;
}
.stream-exit:hover {
    color: #fff;
}

.stream-alt-link {
    position: absolute;
    top: 1rem;
    right: 3.25rem;
    z-index: 4;
    color: #ccc;
    font-size: 0.85rem;
    text-decoration: none;
}
.stream-alt-link:hover {
    color: #fff;
}

/* Infinite Zoom Canvas (OpenSeadragon, collectionMode) - volle Flaeche,
   OSD zeichnet selbst auf ein Canvas/mehrere divs darin. */
.stream-zoom-osd {
    position: absolute;
    inset: 0;
}
.stream-zoom-page .stream-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Mosaik-Uebersicht: Startansicht, vermittelt die Bildmenge auf einen
   Blick statt mit einem einzelnen Bild zu beginnen. */
.stream-mosaic-wrap {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 3.5rem 1rem 1.5rem;
    box-sizing: border-box;
}

.stream-mosaic-intro {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.stream-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 3px;
    max-width: 1400px;
    margin: 0 auto;
}

.stream-tile {
    aspect-ratio: 1;
    border: 0;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.stream-tile:hover {
    opacity: 1;
    transform: scale(1.06);
    z-index: 1;
    position: relative;
}
.stream-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stream-back-to-mosaic {
    position: absolute;
    top: 1rem;
    left: 1.25rem;
    z-index: 4;
    background: none;
    border: 0;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0;
}
.stream-back-to-mosaic:hover {
    color: #fff;
}

.map-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.map-filter label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
}

.fullscreen-map {
    height: 80vh;
    min-height: 400px;
}

.map-popup {
    display: block;
    max-width: 200px;
    color: inherit;
}

.map-popup:hover {
    text-decoration: none;
}

.map-popup img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 0.35rem;
}

.map-popup span {
    display: block;
    font-size: 0.85rem;
}

.admin-login {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 320px;
    margin: 2rem auto;
}

.admin-forgot-link {
    max-width: 320px;
    margin: 0.5rem auto;
    text-align: center;
    font-size: 0.9rem;
}

.admin-login label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.admin-login input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.admin-login button,
.admin-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #b5322b;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.admin-error {
    color: #b5322b;
    font-size: 0.9rem;
}

.admin-success {
    color: #2e7d32;
    font-size: 0.9rem;
}

.admin-ai-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.75rem;
    border: 1px dashed #e6007e;
    border-radius: 6px;
    background: #fff5fa;
}

.admin-ai-status {
    font-size: 0.9rem;
    color: #555;
}

.admin-ai-status-error {
    color: #b5322b;
}

.admin-ai-hint {
    border-left: 3px solid #e6007e;
    padding-left: 0.6rem;
}

/* Filterleiste der Post-Liste (unverortet / ohne Bild) */
.admin-post-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    align-items: center;
    margin: 0.5rem 0 0.25rem;
    font-size: 0.92rem;
}

/* Hinweis nach Upload, wenn im Foto kein GPS steckte (Standort manuell setzen) */
.admin-geo-hint {
    margin: 0.5rem 0;
    padding: 0.5rem 0.7rem;
    background: #fff6e5;
    border-left: 3px solid #e0a100;
    border-radius: 4px;
    font-size: 0.92rem;
    color: #7a5b00;
}

/* WYSIWYG-Editor (Trumbowyg): weisse Schreibflaeche. Ohne das ist der
   contenteditable-Bereich transparent und die graue Seitenflaeche scheint
   durch (grau auf grau). Gilt fuer den visuellen Editor und die
   HTML-Quelltext-Ansicht gleichermassen. */
.trumbowyg-box,
.trumbowyg-editor,
.trumbowyg-editor-box,
.trumbowyg-box .trumbowyg-textarea {
    background: #fff;
    color: #222;
}

/* Feste, begrenzte Editorhoehe mit eigenem Scroll. Ohne das ist der
   contenteditable-Bereich so hoch wie sein Inhalt; beim Antippen scrollt der
   Browser dann dessen Anfang in den Sichtbereich - die Seite springt nach oben
   und der Cursor landet nicht dort, wo man getippt hat. Als beschraenkte,
   intern scrollbare Box passiert das nicht mehr. */
.trumbowyg-box .trumbowyg-editor,
.trumbowyg-box .trumbowyg-textarea {
    min-height: 280px;
    max-height: 65vh;
    overflow-y: auto;
}

/* Im Vollbildmodus die Hoehenbegrenzung aufheben - dort soll der Editor die
   ganze Flaeche nutzen. */
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-editor,
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-textarea {
    max-height: none;
}

/* Persistente Admin-Navigation (auf allen /admin/-Seiten, s. admin.php) */
.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    margin: -0.5rem 0 1.5rem;
    padding: 0.6rem 0.9rem;
    background: #2b2b2b;
    border-radius: 8px;
}

.admin-nav-brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.admin-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.4rem;
    flex: 1 1 auto;
}

.admin-nav-links a {
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

.admin-nav-links a:hover {
    background: #404040;
    color: #fff;
}

.admin-nav-links a.active {
    background: var(--accent);
    color: #fff;
}

.admin-nav-end {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.admin-nav-site {
    color: #ddd;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.admin-nav-site:hover {
    color: #fff;
    text-decoration: underline;
}

.admin-nav-logout {
    margin: 0;
}

.admin-nav-logout button {
    background: transparent;
    color: #ddd;
    border: 1px solid #555;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.admin-nav-logout button:hover {
    background: #404040;
    color: #fff;
}

.admin-post-list {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.admin-post-list th,
.admin-post-list td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-post-list img,
.admin-post-noimage {
    width: 60px;
    height: 45px;
    object-fit: cover;
    background: #ddd;
    border-radius: 2px;
}

.admin-status-ok {
    color: #2e7d32;
}

.admin-status-warn {
    color: #b5322b;
    font-weight: 600;
}

.admin-inline-form {
    display: inline;
}

.admin-button-danger {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    background: #fff;
    color: #b5322b;
    border: 1px solid #b5322b;
    cursor: pointer;
    font-size: 0.85rem;
}

.admin-button-secondary {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-post-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

.admin-post-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-post-form input[type="text"],
.admin-post-form textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.admin-checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem !important;
}

.admin-post-form fieldset {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1rem;
}

.admin-post-form fieldset label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    margin: 0 1rem 0.5rem 0;
}

.location-picker {
    height: 350px;
    margin-bottom: 0.5rem;
}

.admin-meta {
    color: #666;
    font-size: 0.9rem;
}

.admin-field-hint {
    display: block;
    color: #777;
    font-size: 0.82rem;
    font-weight: normal;
    margin-top: 0.2rem;
}

.admin-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.admin-image-tile {
    position: relative;
    margin: 0;
}

.admin-image-tile img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    background: #ddd;
}

.admin-image-tile form {
    margin-top: 0.35rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    max-width: 400px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.admin-image-badge {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    background: #b5322b;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

/* Fund-melden-Formular + Einreichungs-Moderation */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.submit-form .req {
    color: var(--accent);
}
.submission-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    margin: 0 0 1.5rem;
}
.submission-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}
.submission-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}
.submission-thumbs img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.submission-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.submission-actions form {
    margin: 0;
}
.submission-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.35rem;
}
@media (prefers-color-scheme: dark) {
    .submission-card { border-color: #444; }
    .submission-thumbs img { border-color: #555; }
}

/* Update-Seite: Button-Reihe */
.update-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}
.update-actions form {
    margin: 0;
}

/* Update-Ausgabe (fetch-Ergebnis inline) */
.update-output:empty {
    display: none;
}
.update-output {
    background: #1a1a1a;
    color: #eee;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
}

/* "In der Nähe": Status + Entfernungs-Label auf der Kachel */
.near-status {
    color: #444;
    font-size: 0.95rem;
    margin: 0.5rem 0 1rem;
}
.near-distance {
    display: block;
    padding: 0 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}
@media (prefers-color-scheme: dark) {
    .near-status { color: #bbb; }
}

/* Nachlass-Sichtung (/admin/nachlass/) */
.nachlass-hinweis {
    background: #eef2f6;
    border: 1px solid #cfd9e2;
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    margin: 0 0 1rem;
}
.nachlass-hinweis-warnung {
    background: #fbf1e2;
    border-color: #e6c98f;
}
.nachlass-hinweis-fehler {
    background: #fbeae6;
    border-color: #e8c4ba;
}

.nachlass-schritt {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem 1.1rem;
    margin: 0 0 0.8rem;
}
.nachlass-schritt-nummer {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: #eee;
    border: 1px solid #ccc;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
}
.nachlass-schritt.fertig .nachlass-schritt-nummer {
    background: #2e7d4f;
    border-color: #2e7d4f;
    color: #fff;
}
.nachlass-schritt-inhalt { flex: 1; }
.nachlass-schritt-inhalt h3 { margin: 0.1rem 0 0.3rem; font-size: 1.05rem; }
.nachlass-schritt-inhalt p { margin: 0 0 0.6rem; color: #555; }

.nachlass-schwelle-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin: 0 0 1rem;
}
.nachlass-schwelle-form input[type="text"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
}

.nachlass-gruppe {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 0 0 1rem;
    overflow: hidden;
}
.nachlass-gruppe-kopf {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.9rem;
    background: #f4f2ee;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}
.nachlass-bilder {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    overflow-x: auto;
}
.nachlass-bild { flex: 0 0 auto; width: 170px; }
.nachlass-bild img {
    width: 170px;
    height: 130px;
    object-fit: cover;
    background: #eee;
    border-radius: 4px;
    display: block;
}
.nachlass-bild a { display: block; }
.nachlass-bild a:hover img { opacity: 0.85; }

.nachlass-detail {
    display: grid;
    grid-template-columns: minmax(0, 380px) 1fr;
    gap: 1.5rem;
    align-items: start;
}
.nachlass-detail-bild img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: #f0eee9;
    display: block;
}
.nachlass-detail-info h2 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
.nachlass-detail-info h2:first-child { margin-top: 0; }
@media (max-width: 720px) {
    .nachlass-detail { grid-template-columns: 1fr; }
}
.nachlass-unterschrift {
    font-size: 0.72rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.35;
    word-break: break-all;
}
.nachlass-marke {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    background: #f4f2ee;
    border: 1px solid #ddd;
    margin-bottom: 0.15rem;
}
.nachlass-marke.lead {
    background: #2e7d4f;
    border-color: #2e7d4f;
    color: #fff;
}

.nachlass-paar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.9rem;
}
.nachlass-paar img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #f0eee9;
    border-radius: 4px;
    display: block;
}
.nachlass-titel { font-size: 0.82rem; color: #666; margin-bottom: 0.35rem; }

.nachlass-distanz { font-weight: 700; }
.nachlass-distanz.gut { color: #2e7d4f; }
.nachlass-distanz.mittel { color: #a8761c; }
.nachlass-distanz.schlecht { color: var(--accent); }

.nachlass-blaettern { display: flex; align-items: center; gap: 0.8rem; margin: 1.1rem 0; }

.nachlass-laeuft { color: #666; }

.nachlass-balken {
    height: 7px;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0 0.9rem;
}
.nachlass-balken div { height: 100%; background: #2e7d4f; }

@media (prefers-color-scheme: dark) {
    .nachlass-hinweis { background: #24303a; border-color: #33444f; color: #ddd; }
    .nachlass-hinweis-warnung { background: #3a3020; border-color: #6a5628; }
    .nachlass-hinweis-fehler { background: #3a2622; border-color: #6a3a30; }
    .nachlass-schritt,
    .nachlass-gruppe,
    .nachlass-schwelle-form { background: #1e1e1e; border-color: #3a3a3a; }
    .nachlass-gruppe-kopf { background: #262626; border-color: #3a3a3a; }
    .nachlass-schritt-nummer { background: #333; border-color: #444; color: #bbb; }
    .nachlass-paar img { background: #262626; }
    .nachlass-detail-bild img { background: #262626; }
    .nachlass-balken { background: #2a2a2a; border-color: #3a3a3a; }
}
