:root {
    --pulse-bg: #0d0d10;
    --pulse-sidebar: #000000;
    --pulse-surface: #1a1a1e;
    --pulse-surface-hover: #232328;
    --pulse-text: #e8e8ea;
    --pulse-muted: #8b8b92;
    --pulse-accent: #00c2a8;
    --pulse-accent-hover: #12e0c4;
    --pulse-border: #2a2a30;
    --pulse-online: #35d158;
}

/* Dark-Mode-Nutzerschalter: Pulse ist von Haus aus dunkel, dies ist die
   umgekehrte (helle) Variante fuer Nutzer, die "Farben umkehren" aktiviert
   haben. Der Marken-Akzentton (Türkis) bleibt bewusst erhalten (etwas
   abgedunkelt fuer ausreichend Kontrast auf hellem Grund), nur Hintergrund/
   Fläche/Text/Rahmen werden invertiert. */
[data-theme="light"] {
    --pulse-bg: #f4f5f6;
    --pulse-sidebar: #ffffff;
    --pulse-surface: #ffffff;
    --pulse-surface-hover: #eef1f2;
    --pulse-text: #16181a;
    --pulse-muted: #5c6066;
    --pulse-accent: #00998a;
    --pulse-accent-hover: #007b6f;
    --pulse-border: #dfe2e4;
    --pulse-online: #1fa34a;
}

* { box-sizing: border-box; }

body.pulse {
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--pulse-bg);
    color: var(--pulse-text);
    line-height: 1.5;
}

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

/* ---- Sidebar ---- */
.pulse-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--pulse-sidebar);
    border-right: 1px solid var(--pulse-border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.pulse-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--pulse-text) !important;
    border-bottom: 1px solid var(--pulse-border);
    margin-bottom: 12px;
}
.pulse-logo-mark { color: var(--pulse-accent); font-size: 1.3rem; }

.pulse-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.pulse-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--pulse-muted) !important;
    font-size: 0.95rem;
    font-weight: 600;
}
.pulse-nav a:hover { background: var(--pulse-surface-hover); color: var(--pulse-text) !important; }
.pulse-icon { font-size: 1.1rem; width: 1.3rem; text-align: center; }

.pulse-sidebar-bottom { border-top: 1px solid var(--pulse-border); padding-top: 12px; margin-top: 12px; }
.pulse-account {
    display: flex; align-items: center; gap: 12px; padding: 10px 20px;
    color: var(--pulse-text) !important; font-weight: 600; font-size: 0.95rem;
}
.pulse-logout {
    margin: 6px 20px 0; background: none; border: 1px solid var(--pulse-border);
    color: var(--pulse-muted); padding: 6px 10px; border-radius: 6px; cursor: pointer; font: inherit;
}
.pulse-logout:hover { border-color: var(--pulse-accent); color: var(--pulse-accent); }

/* ---- Main area ---- */
.pulse-main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; position: relative; }

.pulse-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px; border-bottom: 1px solid var(--pulse-border);
    background: var(--pulse-bg); position: sticky; top: 0; z-index: 5;
    flex-shrink: 0;
}
.pulse-topbar-title { font-weight: 700; font-size: 1.1rem; }
.pulse-topbar-icons { display: flex; gap: 18px; font-size: 1.2rem; }
.pulse-topbar-icons a { color: var(--pulse-muted) !important; position: relative; display: inline-flex; }
.pulse-topbar-icons a:hover { color: var(--pulse-accent) !important; }
/* Badge liegt teilweise ueber dem Icon statt im Textfluss daneben (sonst
   bricht die Leiste mobil um und wird hoeher). */
.pulse-topbar-icons .gh-notif-badge {
    position: absolute; top: -6px; right: -8px; margin-left: 0;
}

.pulse-content { padding: 24px 28px 60px; max-width: 1200px; }

.pulse-footer {
    text-align: center; padding: 18px; color: var(--pulse-muted);
    font-size: 0.82rem; border-top: 1px solid var(--pulse-border);
}

/* ---- Typo / Elemente ---- */
h1, h2, h3 { color: var(--pulse-text); }
h1 { font-size: 1.5rem; }

table { border-collapse: collapse; width: 100%; background: var(--pulse-surface); border-radius: 6px; overflow: hidden; }
th, td { padding: 10px 12px; border: 1px solid var(--pulse-border); text-align: left; }
thead th { background: rgba(255,255,255,0.04); font-weight: 700; }
tbody tr:hover { background: rgba(255,255,255,0.04); }
th { background: #000; color: var(--pulse-muted); font-size: 0.85rem; text-transform: uppercase; }

input, select, textarea, button {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--pulse-border);
    border-radius: 6px;
    background: var(--pulse-surface);
    color: var(--pulse-text);
}

button {
    cursor: pointer;
    background: var(--pulse-accent);
    color: #06231f;
    font-weight: 700;
    border-color: var(--pulse-accent);
}
button:hover { background: var(--pulse-accent-hover); }

/* ---- Karten-Raster fuer Suchergebnisse (siehe search/index.php: ul.profile-grid) ---- */
ul.profile-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

ul.profile-grid li.profile-grid-item {
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
ul.profile-grid li.profile-grid-item:hover {
    border-color: var(--pulse-accent);
    transform: translateY(-2px);
}

ul.profile-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

ul.profile-grid .profile-grid-body {
    padding: 8px 10px 10px;
}

ul.profile-grid .profile-grid-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--pulse-text);
    display: block;
}

ul.profile-grid .profile-grid-meta {
    font-size: 0.78rem;
    color: var(--pulse-muted);
}

/* ---- Profil-Hero: grosses Bild links, Angaben rechts untereinander ---- */
.profile-hero {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}
.profile-hero-image { flex: 0 0 340px; display: flex; flex-direction: column; background: var(--pulse-surface); }
.profile-hero-image img { width: 100%; height: 340px; object-fit: cover; display: block; }
.profile-hero-username {
    display: block; padding: 10px 4px 0; color: var(--pulse-text); font-weight: 700; font-size: 1.15rem;
}
.profile-hero-info { flex: 1; padding: 20px 24px; min-width: 0; }
.profile-hero-info h2 { margin-top: 0; font-size: 1rem; color: var(--pulse-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Tab-Umschaltung ohne JavaScript ---- */
.profile-tab-radio { display: none; }
.profile-panel { display: none; }
#tab-info:checked ~ #panel-info,
#tab-comments:checked ~ #panel-comments,
#tab-stories:checked ~ #panel-stories,
#tab-react:checked ~ #panel-react,
#tab-poke:checked ~ #panel-poke,
#tab-friendlists:checked ~ #panel-friendlists,
#tab-report:checked ~ #panel-report,
#tab-reactions:checked ~ #panel-reactions,
#tab-manage:checked ~ #panel-manage {
    display: block;
}

.profile-action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.profile-action-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; border-radius: 20px; border: 1px solid var(--pulse-border);
    background: var(--pulse-surface); color: var(--pulse-text) !important;
    font-size: 0.88rem; cursor: pointer; text-decoration: none !important; user-select: none;
}
.profile-action-btn:hover { border-color: var(--pulse-accent); }
.profile-action-count { color: var(--pulse-muted); font-size: 0.8rem; }

/* ---- Alben-Vorschau innerhalb des Info-Panels ---- */
.profile-albums-inline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.profile-album-thumb {
    display: block; width: 96px; text-decoration: none !important; color: var(--pulse-text) !important;
    font-size: 0.72rem; text-align: center;
}
.profile-album-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 4px; }
.profile-album-locked { width: 96px; font-size: 0.72rem; text-align: center; color: var(--pulse-muted); }
.profile-album-locked form { margin-top: 4px; }
.profile-album-locked button { font-size: 0.7rem; padding: 3px 6px; }

/* ---- Reaktions-Picker (Buttons statt JS-Klicks) ---- */
.reaction-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.reaction-pick-btn {
    background: var(--pulse-surface); border: 2px solid transparent; border-radius: 8px;
    padding: 3px; cursor: pointer; line-height: 0;
}
.reaction-pick-btn img { display: block; width: 28px; height: 28px; }
.reaction-pick-btn.is-active { border-color: var(--pulse-accent); }
.reaction-count-item {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--pulse-surface); border-radius: 20px; padding: 4px 10px; font-size: 0.85rem;
}
.reaction-count-item img { width: 20px; height: 20px; }

.profile-comment-list, .profile-story-list { list-style: none; margin: 0 0 14px; padding: 0; }
.profile-comment-list li, .profile-story-list li {
    padding: 8px 0; border-bottom: 1px solid var(--pulse-border); font-size: 0.9rem;
}
.profile-manage-list { list-style: none; margin: 0; padding: 0; }
.profile-manage-list li { padding: 4px 0; }
.profile-manage-list a { display: block; padding: 8px 10px; border-radius: 8px; }
.profile-manage-list a:hover { background: var(--pulse-surface-hover); }
dl.profile-attributes { margin: 0; }
dl.profile-attributes > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--pulse-border);
    font-size: 0.92rem;
}
dl.profile-attributes dt { color: var(--pulse-muted); }
dl.profile-attributes dd { margin: 0; font-weight: 600; text-align: right; }

@media (max-width: 640px) {
    .profile-hero { flex-direction: column; }
    .profile-hero-image { flex-basis: auto; }
}

/* ---- Modal-Overlay (Profil schwebend ueber der Seite) ---- */
.gh-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
    padding: 30px 20px; overflow-y: auto;
}
.gh-modal-panel {
    background: var(--pulse-bg); border: 1px solid var(--pulse-border); border-radius: 14px;
    max-width: 960px; width: 100%; position: relative; padding: 20px;
}
.gh-modal-close {
    position: absolute; top: 14px; right: 18px; font-size: 1.6rem; color: var(--pulse-muted);
    cursor: pointer; background: none; border: none; line-height: 1;
}
.gh-modal-close:hover { color: var(--pulse-text); }

/* ---- Chat-Overlay: schmales Panel rechts, verschwommener Hintergrund ----
   position:fixed (nicht absolute), sonst scrollt das Overlay mit dem
   eigenstaendig scrollenden .pulse-main-wrap mit. "left: 220px" statt
   "inset: 0", damit die Sidebar (Breite 220px) links sichtbar bleibt und
   nicht vom Overlay verdeckt wird. */
.gh-chat-overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 220px; z-index: 50;
    display: flex; justify-content: flex-start;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.gh-chat-panels {
    display: flex; height: 100%; max-width: 720px;
    background: var(--pulse-bg); border-right: 1px solid var(--pulse-border);
    box-shadow: 12px 0 30px rgba(0,0,0,0.5);
    position: relative;
}
/* Panel-Breite haengt davon ab, ob eine Unterhaltung geoeffnet ist: nur die Liste
   (300px, passend zu .gh-chat-list-panel) oder Liste + Thread (volle Breite bis 720px). */
.gh-chat-panels:not(:has(.gh-chat-thread-panel:not([hidden]))) { width: 300px; }
.gh-chat-panels:has(.gh-chat-thread-panel:not([hidden])) { width: 100%; }
.gh-chat-list-panel { width: 300px; flex-shrink: 0; border-right: 1px solid var(--pulse-border); overflow-y: auto; padding: 16px; }
.gh-chat-thread-panel { flex: 1; overflow-y: auto; padding: 16px; min-width: 0; }
.gh-chat-close {
    position: absolute; top: 12px; right: 16px; font-size: 1.4rem; color: var(--pulse-muted);
    cursor: pointer; background: none; border: none; z-index: 51;
}

/* ---- Chat-Sprechblasen ---- */
.chat-message-list { max-height: 55vh; overflow-y: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-message { display: flex; flex-direction: column; max-width: 78%; }
.chat-message--mine { align-self: flex-end; align-items: flex-end; }
.chat-message--theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
    padding: 9px 13px; border-radius: 16px; font-size: 0.92rem; line-height: 1.4;
    word-break: break-word;
}
.chat-message--mine .chat-bubble { background: var(--pulse-accent); color: #06231f; border-bottom-right-radius: 4px; }
.chat-message--theirs .chat-bubble { background: var(--pulse-surface); color: var(--pulse-text); border-bottom-left-radius: 4px; }
.chat-message-time { color: var(--pulse-muted); font-size: 0.7rem; margin-top: 3px; padding: 0 4px; }

/* Das "cols"-Attribut im HTML erzwingt sonst eine feste Zeichenbreite,
   die breiter als das Chat-Panel sein kann und horizontales Scrollen ausloest. */
#message-body { width: 100%; max-width: 100%; box-sizing: border-box; }

/* ---- Konversationsliste ---- */
.chat-conv-list { list-style: none; margin: 0; padding: 0; max-height: 65vh; overflow-y: auto; overflow-x: hidden; }
.chat-conv-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--pulse-border); }
.chat-conv-avatar { flex-shrink: 0; display: block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--pulse-surface); }
.chat-conv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-conv-avatar-group { display: flex; align-items: center; justify-content: center; }
.chat-conv-avatar-group-icon { font-size: 20px; line-height: 1; }
.chat-conv-avatar-group-count-1 img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.chat-conv-avatar-group-count-2 {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 1px;
}
.chat-conv-avatar-group-count-3, .chat-conv-avatar-group-count-4 {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px;
}
.chat-conv-avatar-group-count-3 img:first-child { grid-column: 1 / 3; }
.chat-conv-avatar-group-count-2 img, .chat-conv-avatar-group-count-3 img, .chat-conv-avatar-group-count-4 img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.chat-conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--pulse-text) !important; text-decoration: none !important; }
.chat-conv-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-unread { color: var(--pulse-accent); font-weight: 700; font-size: 0.78rem; margin-left: 4px; }
.chat-conv-preview { font-size: 0.82rem; color: var(--pulse-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* WICHTIG: [hidden] muss gegen die display:flex-Regeln oben gewinnen, sonst bleiben
   die Overlays permanent sichtbar (Spezifitaet von [hidden] und .klasse ist gleich,
   Autor-Regel gewinnt sonst gegen die Browser-Standardregel) */
.gh-modal-overlay[hidden],
.gh-chat-overlay[hidden],
.gh-notif-panel[hidden] {
    display: none !important;
}

.gh-image-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gh-image-overlay img { max-width: 92vw; max-height: 92vh; }
.gh-image-overlay .gh-modal-close { position: fixed; top: 20px; right: 26px; }

/* ---- Benachrichtigungs-Feed: schmale Seitenleiste rechts ---- */
.gh-notif-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 90vw;
    background: var(--pulse-bg); border-left: 1px solid var(--pulse-border);
    box-shadow: -12px 0 30px rgba(0,0,0,0.5); z-index: 900; overflow-y: auto; padding: 20px;
}
.gh-notif-panel-close {
    position: absolute; top: 14px; right: 16px; font-size: 1.5rem; color: var(--pulse-muted);
    background: none; border: none; cursor: pointer;
}
.gh-notif-badge {
    display: inline-block; min-width: 16px; padding: 1px 5px; margin-left: 3px;
    background: var(--pulse-accent); color: #06231f; border-radius: 10px;
    font-size: 0.68rem; font-weight: 700; text-align: center; vertical-align: super;
}
/* [hidden]-Gotcha: die eigene display:inline-block-Regel oben hat dieselbe
   Spezifitaet wie das UA-Default fuer [hidden] und kommt spaeter im Stylesheet -
   ohne diese Regel bleibt ein Badge mit count=0 trotz hidden-Attribut sichtbar. */
.gh-notif-badge[hidden] { display: none !important; }

.notif-list { list-style: none; margin: 0; padding: 0; max-height: 65vh; overflow-y: auto; overflow-x: hidden; }
.notif-item { padding: 10px 4px; border-bottom: 1px solid var(--pulse-border); font-size: 0.9rem; }
.notif-item--unread { background: var(--pulse-surface); border-radius: 8px; }
.notif-item a { color: var(--pulse-text) !important; }
.notif-item small { display: block; color: var(--pulse-muted); margin-top: 3px; font-size: 0.75rem; }

.dash-announcements { margin-bottom: 20px; }
.dash-announcement { background: var(--pulse-surface); border-left: 3px solid var(--pulse-accent); padding: 10px 14px; margin-bottom: 8px; border-radius: 6px; }
.dash-feed { list-style: none; margin: 0; padding: 0; }
.dash-feed li { padding: 8px 0; border-bottom: 1px solid var(--pulse-border); font-size: 0.9rem; }
.landing-stats { display: flex; gap: 24px; margin: 20px 0; flex-wrap: wrap; }
.landing-stats div { background: var(--pulse-surface); border-radius: 10px; padding: 14px 20px; text-align: center; min-width: 100px; }
.landing-stats strong { display: block; font-size: 1.6rem; color: var(--pulse-accent); }
.landing-stats span { font-size: 0.8rem; color: var(--pulse-muted); }
.landing-block { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; background: var(--pulse-surface); border-radius: 10px; padding: 14px; }
.landing-block img { width: 140px; border-radius: 8px; flex-shrink: 0; }

.gh-map-own-marker span {
    display: block; width: 16px; height: 16px; border-radius: 50%;
    background: var(--pulse-accent); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(0,194,168,0.35);
}

/* ---- Events ---- */
.event-cover-image { width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; margin-bottom: 16px; }
.event-meta-line { color: var(--pulse-muted); margin: 4px 0 16px; }
.event-info-box { margin-bottom: 20px; }
.event-description { margin: 16px 0; line-height: 1.6; }
.event-status-note { color: var(--pulse-accent); font-weight: 600; }
.event-map { height: 300px; border-radius: 12px; margin: 12px 0 20px; }
.event-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 16px 0 20px; }
.event-gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; }
.event-actions { margin: 20px 0; }
.event-rsvp-form button, .event-invite-form button { margin-right: 8px; }
.event-form-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.event-form-field { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.event-form-field label { white-space: nowrap; }
.event-quill-editor { height: 320px; background: #fff; color: #111; border-radius: 8px; }

/* ---- Polls / Umfragen ---- */
.poll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; margin: 1.5rem 0 2rem; }
.poll-tile {
    display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
    text-decoration: none; color: inherit; border: 1px solid var(--pulse-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.poll-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.poll-tile-image { height: 120px; background-size: cover; background-position: center; background-color: rgba(128,128,128,0.15); }
.poll-tile-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.poll-tile-body { padding: 0.75rem 1rem; }
.poll-tile-body h3 { margin: 0 0 0.35rem 0; font-size: 1rem; }
.poll-tile-body p { margin: 0; font-size: 0.85rem; color: var(--pulse-muted); }
.poll-cover-image { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.poll-meta-line { color: var(--pulse-muted); margin: 4px 0 16px; }
.poll-results { margin: 12px 0 20px; }
.poll-result-row { margin-bottom: 12px; }
.poll-result-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.92rem; }
.poll-result-bar-bg { background: rgba(128,128,128,0.25); border-radius: 6px; height: 10px; overflow: hidden; }
.poll-result-bar { background: var(--pulse-accent); height: 100%; }
.poll-actions { margin: 16px 0; }
.poll-comment { border-top: 1px solid var(--pulse-border); padding: 10px 0; }
.poll-comment small { color: var(--pulse-muted); margin-left: 8px; }
.poll-quill-editor { height: 180px; background: #fff; color: #111; border-radius: 8px; }
.poll-description { margin: 12px 0 20px; line-height: 1.6; }

/* ============================================================
   Mobilansicht
   ============================================================ */
.pulse-nav-toggle-input { display: none; }
.pulse-nav-toggle-btn { display: none; }
.pulse-nav-backdrop { display: none; }
.pulse-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Sprachauswahl im Burger-Menu: nur in der Mobilansicht sichtbar, siehe @media unten.
   Auf dem Desktop bleibt die Sprachauswahl im Topbar (.pulse-topbar-icons). */
.pulse-sidebar-lang-switch { display: none; padding: 0 20px 16px; }
.pulse-sidebar-lang-switch select {
    width: 100%; font: inherit; background: var(--pulse-surface); color: inherit;
    border: 1px solid var(--pulse-border); border-radius: 6px; padding: 8px 10px;
}

@media (max-width: 900px) {
    input, select, textarea, button { font-size: 16px; }

    .pulse-sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; width: 260px; max-width: 80vw;
        transform: translateX(-100%); transition: transform 0.25s ease; z-index: 1600;
        box-shadow: 12px 0 30px rgba(0,0,0,0.5);
    }
    .pulse-nav-toggle-input:checked ~ .pulse-sidebar { transform: translateX(0); }

    .pulse-nav-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
        z-index: 1590; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
    }
    .pulse-nav-toggle-input:checked ~ .pulse-nav-backdrop { opacity: 1; pointer-events: auto; }

    .pulse-nav-toggle-btn {
        display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
        width: 38px; height: 38px; font-size: 1.3rem; line-height: 1; cursor: pointer;
        background: none; border: 1px solid var(--pulse-border); border-radius: 6px;
        color: var(--pulse-text);
    }

    .pulse-topbar { padding: 12px 16px; }
    /* Sprachauswahl aus dem Topbar raus (lag dort ueber dem Burger-Button) und
       stattdessen im Burger-Menu selbst anzeigen. */
    /* !important noetig: das Formular hat ein inline style="display:inline-flex",
       das ohne !important jede externe Stylesheet-Regel gleicher/hoeherer
       Spezifitaet aussticht. */
    .pulse-topbar-icons form[action="/lang/switch"] { display: none !important; }
    .pulse-sidebar-lang-switch { display: block; }
    .pulse-topbar-title { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pulse-content { padding: 16px 14px 40px; }

    table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

    dl.profile-attributes > div { flex-direction: column; gap: 2px; }
    dl.profile-attributes dd { text-align: left; }

    /* Chat-Overlay: volle Breite statt Desktop-Offset neben der (jetzt ausgeblendeten) Sidebar */
    .gh-chat-overlay { left: 0; z-index: 350; }
    .gh-chat-panels { width: 100% !important; max-width: 100%; }
    .gh-chat-list-panel { width: 100%; border-right: none; }
    .gh-chat-thread-panel { width: 100%; }
    /* Nur eine Spalte gleichzeitig: Liste ausblenden, sobald der Thread sichtbar ist */
    .gh-chat-panels:has(.gh-chat-thread-panel:not([hidden])) .gh-chat-list-panel { display: none; }

    .gh-notif-panel { width: 100%; max-width: 100%; z-index: 950; }
    .gh-modal-panel { padding: 14px; }

    .event-form-row { gap: 10px; }
}

/* ============================================================
   Generisches Kachel-Design (wiederverwendbar: Gruppen, Forum,
   Geschichten, Buecher, Freundeslisten, ...)
   ============================================================ */
.gh-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; margin: 1.5rem 0 2rem; }
.gh-tile {
    display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
    text-decoration: none; color: inherit; border: 1px solid var(--pulse-border);
    background: var(--pulse-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gh-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.gh-tile-image { height: 130px; background-size: cover; background-position: center; background-color: rgba(128,128,128,0.15); }
.gh-tile-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gh-tile-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; opacity: 0.6; }
.gh-tile-body { padding: 0.75rem 1rem; }
.gh-tile-body h3 { margin: 0 0 0.35rem 0; font-size: 1rem; color: var(--pulse-text); }
.gh-tile-body p { margin: 0; font-size: 0.85rem; color: var(--pulse-muted); }
.gh-tile-meta { font-size: 0.78rem; color: var(--pulse-muted); margin-top: 4px; }

.gh-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.gh-avatar-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gh-avatar-chip img, .gh-avatar-chip .gh-avatar-placeholder {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
    background: rgba(128,128,128,0.15);
}
.gh-avatar-placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: bold; opacity: 0.6; color: var(--pulse-text); }
.gh-avatar-chip span { font-size: 0.85rem; color: var(--pulse-text); }

/* Mitgliederliste (Gruppen, Freundeslisten): Avatar + Name + Aktionen in einer Zeile */
.gh-member-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.gh-member-row {
    display: flex; align-items: center; gap: 12px; padding: 8px 4px;
    border-bottom: 1px solid var(--pulse-border); flex-wrap: wrap;
}
.gh-member-avatar, .gh-member-avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    background: rgba(128,128,128,0.15);
}
.gh-member-avatar-placeholder { display: flex; align-items: center; justify-content: center; font-weight: bold; opacity: 0.6; color: var(--pulse-text); }
.gh-member-name { flex: 1; min-width: 120px; font-weight: 600; color: var(--pulse-text); }
.gh-member-role { font-size: 0.8rem; color: var(--pulse-muted); font-weight: normal; }
.gh-member-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Buecher-Leseansicht: eigener dunkler Hintergrund nur fuer den Leser, nicht die ganze Seite */
.gh-book-reader { background: #0a0a0a; color: #eee; border-radius: 12px; padding: 20px; border: 1px solid var(--pulse-border); }
.gh-book-page-area { text-align: center; min-height: 60vh; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.gh-book-page-area img, .gh-book-page-area video { max-width: 100%; max-height: 80vh; }
.gh-book-controls { text-align: center; margin-top: 12px; }
.gh-book-nav-btn { font-size: 1.5em; padding: 8px 18px; cursor: pointer; }

/* Einklappbare Bereiche (z.B. erweiterte Suchkriterien) */
.gh-collapsible {
    border: 1px solid var(--pulse-border); border-radius: 8px; padding: 10px 14px; margin: 14px 0;
    background: var(--pulse-surface);
}
.gh-collapsible summary {
    cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; color: var(--pulse-text);
}
.gh-collapsible summary::-webkit-details-marker { display: none; }
.gh-collapsible summary::before { content: "▸ "; }
.gh-collapsible[open] summary::before { content: "▾ "; }
.gh-collapsible[open] summary { margin-bottom: 8px; border-bottom: 1px solid var(--pulse-border); padding-bottom: 10px; }

/* Lightbox fuer Moderationswarteschlange */
.gh-lightbox-overlay[hidden] { display: none !important; }
.gh-lightbox-overlay {
    position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center; padding: 30px;
}
.gh-lightbox-overlay img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.gh-lightbox-close { position: absolute; top: 16px; right: 24px; font-size: 2rem; color: #fff; cursor: pointer; }

/* Kategorie-Überschriften über den gruppierten Profildaten */
.profile-attributes-category { margin: 18px 0 6px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pulse-muted); }
.profile-attributes-category:first-of-type { margin-top: 8px; }

/* "Persönlich bekannt"-Badge neben dem Profilnamen */
.gh-vouch-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; padding: 3px 8px; border-radius: 12px;
    background: var(--pulse-accent); color: #000; vertical-align: middle; margin-left: 6px;
}

/* Profil-Headline unter dem Namen */
.profile-hero-headline { display: block; margin-top: 2px; font-style: italic; color: var(--pulse-muted); font-size: 0.95rem; }

/* Headline auf der Speed-Dating-Karte */
.gh-sd-card-headline { font-style: italic; color: var(--pulse-muted); margin: 2px 0 8px; }

/* Icon-Kachel-Grid fuer Admin-/Moderations-Navigation (Symbol + Beschriftung) */
.gh-icon-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 1.5rem 0 2rem; }
.gh-icon-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 18px 8px; border-radius: 12px; border: 1px solid var(--pulse-border);
    text-decoration: none; color: inherit; text-align: center; background: var(--pulse-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gh-icon-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); border-color: var(--pulse-accent); }
.gh-icon-tile-icon { font-size: 2rem; line-height: 1; }
.gh-icon-tile-label { font-size: 0.8rem; font-weight: 600; line-height: 1.3; color: var(--pulse-text); }

/* Dokument-Kacheln (Datei-Freigabe): Icon, Name, Endung + Groesse */
.gh-doc-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 1rem 0 1.5rem; }
.gh-doc-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 16px 8px; border-radius: 12px; border: 1px solid var(--pulse-border);
    text-decoration: none; color: inherit; text-align: center; background: var(--pulse-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gh-doc-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); border-color: var(--pulse-accent); }
.gh-doc-tile-icon { font-size: 2rem; line-height: 1; }
.gh-doc-tile-name { font-size: 0.82rem; font-weight: 600; word-break: break-word; color: var(--pulse-text); }
.gh-doc-tile-meta { font-size: 0.72rem; color: var(--pulse-muted); }

/* Mehrzeilige Zusatzfelder (Textarea): Label + Text jeweils volle Breite statt
   nebeneinander gequetscht (siehe dl.profile-attributes weiter oben). */
dl.profile-attributes > div.profile-attribute-full { display: block; }
dl.profile-attributes > div.profile-attribute-full dt { margin-bottom: 4px; }
dl.profile-attributes > div.profile-attribute-full dd { font-weight: 400; white-space: pre-line; text-align: left; }
.gh-scroll-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* [hidden] muss gegen display:flex oben gewinnen, sonst bleibt der Button
   permanent sichtbar (gleiche Falle wie bei .gh-modal-overlay/.gh-chat-overlay). */
.gh-scroll-top[hidden] { display: none !important; }
.gh-upload-progress {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 280px;
    background: var(--pulse-surface);
    border: 1px solid var(--pulse-border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    z-index: 60;
    font-size: 0.9rem;
}
.gh-upload-progress-label { margin-bottom: 8px; color: var(--pulse-text); display: flex; justify-content: space-between; gap: 8px; }
.gh-upload-progress-bar-track { height: 8px; border-radius: 4px; background: var(--pulse-border); overflow: hidden; }
.gh-upload-progress-bar-fill { height: 100%; background: var(--pulse-accent); width: 0%; transition: width 0.15s ease; }

/* ---- Floatchat: schwebendes Chat-Widget (reine Oberflaechen-Erweiterung,
   nutzt die bestehende Chat-Funktion im Hintergrund) ---- */
.gh-floatchat-bubble {
    position: fixed; right: 20px; bottom: 84px;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer; z-index: 72; border: none;
    background: var(--pulse-accent); color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.gh-floatchat-bubble:hover { background: var(--pulse-accent-hover); }
.gh-floatchat-bubble[hidden] { display: none !important; }
.gh-floatchat-bubble-badge {
    position: absolute; top: -4px; right: -4px;
    background: #e0424a; color: #fff; border-radius: 999px;
    font-size: 11px; line-height: 1; padding: 3px 6px; font-weight: bold;
}
.gh-floatchat-bubble-badge[hidden] { display: none !important; }

.gh-floatchat-panel {
    position: fixed; right: 20px; bottom: 148px;
    width: 340px; max-height: 480px; overflow-y: auto;
    background: var(--pulse-surface); border: 1px solid var(--pulse-border);
    border-radius: 12px; z-index: 71; padding: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
.gh-floatchat-panel[hidden] { display: none !important; }

#gh-floatchat-windows-container { position: fixed; inset: 0; pointer-events: none; z-index: 68; }
.gh-floatchat-window { pointer-events: auto; }

.gh-floatchat-window {
    position: fixed; bottom: 0; width: 300px; height: 420px;
    display: flex; flex-direction: column;
    background: var(--pulse-surface); border: 1px solid var(--pulse-border);
    border-radius: 10px 10px 0 0; overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.gh-floatchat-window.minimized { height: auto; }
.gh-floatchat-window.minimized .gh-floatchat-window-body { display: none; }
.gh-floatchat-window-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; cursor: pointer; flex: 0 0 auto;
    background: var(--pulse-accent); color: #fff;
}
.gh-floatchat-window-title { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-floatchat-window-actions button {
    background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 4px 6px; color: #fff;
}
.gh-floatchat-window-body { flex: 1 1 auto; overflow-y: auto; padding: 8px; font-size: 0.85rem; color: var(--pulse-text); }
.gh-floatchat-window-body #message-list { max-height: 260px; overflow-y: auto; }
.gh-floatchat-loading { padding: 20px; text-align: center; opacity: 0.7; }

/* Mobil (Hochformat): vertikal gestapelt statt horizontal nebeneinander.
   WICHTIG: "column" (nicht "column-reverse") - in Kombination mit
   justify-content:flex-end wuerde "column-reverse" die Bedeutung von "Ende"
   umkehren und die Fenster an den OBEREN statt unteren Bildschirmrand
   druecken (genau der gemeldete Bug). */
body.gh-floatchat-mobile #gh-floatchat-windows-container {
    display: flex; flex-direction: column; justify-content: flex-end;
}
body.gh-floatchat-mobile .gh-floatchat-window {
    position: static; width: 100%; height: 50vh; max-height: 50vh;
    border-radius: 0; right: auto !important;
}
body.gh-floatchat-mobile .gh-floatchat-window.minimized { height: auto; max-height: none; }
body.gh-floatchat-mobile .gh-floatchat-bubble,
body.gh-floatchat-mobile .gh-floatchat-panel { right: 12px; }

/* ---- Push-Benachrichtigungen: Opt-in-Banner ---- */
.gh-push-banner {
    position: fixed; left: 20px; bottom: 20px; z-index: 70;
    display: flex; align-items: center; gap: 10px;
    background: var(--pulse-surface); border: 1px solid var(--pulse-border);
    border-radius: 10px; padding: 10px 12px; max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4); color: var(--pulse-text); font-size: 0.9rem;
}
.gh-push-banner-enable {
    background: var(--pulse-accent); color: #fff; border: none; border-radius: 6px;
    padding: 6px 10px; cursor: pointer; font-size: 0.85rem; flex: 0 0 auto;
}
.gh-push-banner-enable:hover { background: var(--pulse-accent-hover); }
.gh-push-banner-dismiss {
    background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1;
    color: var(--pulse-text); opacity: 0.7; flex: 0 0 auto; padding: 0 4px;
}
.pulse-logo-image { max-height: 32px; vertical-align: middle; }

/* ---- Floatchat: Composer-Layout (fixe Eingabezeile, scrollbarer Verlauf,
   "+"-Menu statt direkt sichtbarer Foto-/Sprachnachricht-/Smiley-Optionen) ---- */
.gh-floatchat-window-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}
/* Die "Schliessen"-Zeile und Ueberschrift aus dem Chat-Fragment sind hier
   redundant - die schwebende Fensterleiste hat bereits Titel + Schliessen-Button. */
.gh-floatchat-window-body h1 { display: none; }
.gh-floatchat-window-body .gh-close-link { display: none; }
.gh-floatchat-window-body #message-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px;
    margin: 0;
}
.gh-floatchat-window-body #chat-send-form {
    flex: 0 0 auto;
    padding: 6px 8px;
    border-top: 1px solid var(--pulse-border);
}
.gh-floatchat-window-body #chat-send-form > p { margin: 0; }
.gh-floatchat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.gh-floatchat-input-row textarea {
    flex: 1 1 auto;
    resize: none;
    min-height: 36px;
    max-height: 100px;
}
.gh-floatchat-plus-btn {
    width: 32px; height: 32px; border-radius: 50%; font-size: 20px;
    padding: 0; line-height: 1; flex: 0 0 auto;
}
.gh-floatchat-extras {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--pulse-border);
    max-height: 220px;
    overflow-y: auto;
}
.gh-floatchat-extras[hidden] { display: none !important; }

/* ---- Moderations-Zähler (Nav-Badge + Warteschlangen-Übersicht) ---- */
.gh-mod-count, .gh-mod-count-total {
    display: inline-block; background: var(--pulse-accent); color: #fff;
    border-radius: 999px; font-size: 0.75rem; font-weight: bold;
    padding: 1px 7px; margin-left: 4px; line-height: 1.4;
}

/* ---- Cloud-Modul ---- */
.gh-cloud-quota-card { margin: 12px 0; padding: 10px; border-radius: 8px; background: rgba(128,128,128,0.08); }
.gh-cloud-quota-header { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.gh-cloud-quota-track { height: 8px; border-radius: 4px; background: rgba(128,128,128,0.25); overflow: hidden; }
.gh-cloud-quota-fill { height: 100%; background: currentColor; opacity: 0.6; }
.gh-cloud-folders-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.gh-cloud-folder-tab {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(128,128,128,0.3);
    text-decoration: none; font-size: 0.9rem;
}
.gh-cloud-folder-tab.active { font-weight: bold; border-width: 2px; }
.gh-cloud-new-folder-btn { cursor: pointer; background: none; }
.gh-cloud-folder-del { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 2px; }
.gh-cloud-bulk-bar { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px; border-radius: 8px; background: rgba(128,128,128,0.08); }
.gh-cloud-item { position: relative; }
.gh-cloud-item-select { position: absolute; top: 6px; left: 6px; z-index: 2; }

/* ---- Cloud: Video-Lightbox + Play-Badge ---- */
.gh-lightbox-overlay video { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.gh-cloud-item .gh-tile-image { position: relative; }
.gh-cloud-play-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

/* ---- Forum-Redesign: Textumbruch-Fix + klassisches phpBB/WoltLab-Layout ----
   Ursache des "kaputten" Layouts: lange, leerzeichenlose Zeichenketten
   (z.B. "FließtextFließtextFließtext...") wurden nicht umgebrochen und
   haben den gesamten Beitrags-Container gesprengt. overflow-wrap: anywhere
   erzwingt einen Umbruch auch mitten im Wort, wenn es nicht anders geht -
   normaler Text mit Leerzeichen bricht weiterhin ganz normal an Wortgrenzen um. */
.gh-forum-post-body,
.gh-forum-post-body * {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

/* ---- Klassische Forum-Optik (Kategorie -> Board -> Thema -> Beitrag) ---- */
.gh-forum-category { margin-bottom: 24px; }
.gh-forum-category-title {
    font-size: 1.2rem; font-weight: 700; padding: 10px 14px;
    background: var(--pulse-accent, var(--color-primary));
    color: #000; border-radius: 6px 6px 0 0; margin: 0;
}
.gh-forum-category-desc { font-size: 0.85rem; opacity: 0.75; margin: 4px 0 10px; }

.gh-forum-board-table, .gh-forum-topic-table {
    width: 100%; border-collapse: collapse; table-layout: fixed;
}
.gh-forum-board-table td, .gh-forum-topic-table td,
.gh-forum-board-table th, .gh-forum-topic-table th {
    border: 1px solid var(--pulse-border, var(--color-border));
    padding: 10px 12px; vertical-align: top; overflow-wrap: anywhere;
}
.gh-forum-board-table th, .gh-forum-topic-table th {
    background: rgba(128,128,128,0.08); text-align: left; font-size: 0.8rem; text-transform: uppercase;
}
.gh-forum-board-name { font-weight: 700; }
.gh-forum-board-desc { font-size: 0.85rem; opacity: 0.75; margin-top: 4px; }
.gh-forum-stat-col { width: 90px; text-align: center; white-space: nowrap; }
.gh-forum-lastpost-col { width: 220px; font-size: 0.85rem; }
.gh-forum-subboard-list { margin: 6px 0 0; padding-left: 18px; font-size: 0.85rem; }

.gh-forum-topic-title-pinned::before { content: "📌 "; }
.gh-forum-topic-title-locked::after { content: " 🔒"; opacity: 0.6; }

/* ---- Beitrags-Ansicht (einzelnes Thema) ---- */
.gh-forum-post {
    display: flex; gap: 16px; border: 1px solid var(--pulse-border, var(--color-border));
    border-radius: 8px; padding: 14px; margin-bottom: 14px; max-width: 100%;
}
.gh-forum-post-author {
    flex: 0 0 140px; font-size: 0.85rem; text-align: center;
    border-right: 1px solid var(--pulse-border, var(--color-border)); padding-right: 14px;
}
.gh-forum-post-author-avatar {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px;
    display: block; background: rgba(128,128,128,0.15);
}
.gh-forum-post-count { font-size: 0.75rem; opacity: 0.6; margin-top: 6px; }
.gh-forum-post-main { flex: 1; min-width: 0; }
.gh-forum-post-meta { font-size: 0.8rem; opacity: 0.7; margin-bottom: 8px; }
.gh-forum-post-body { line-height: 1.6; min-width: 0; }
.gh-forum-post-body p { margin: 0 0 0.8em; }
.gh-forum-post-toolbar {
    margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.gh-forum-post-toolbar-actions {
    display: flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 8px;
    border-left: 1px solid var(--pulse-border, var(--color-border));
}
/* Kleine Symbol-Buttons (Zitieren/Bearbeiten/Löschen): bewusst zurueckhaltend
   (nur Umriss, kein voller Knopf-Hintergrund wie bei "Antworten"/"Speichern"),
   damit sie sich klar von den primaeren Aktions-Buttons abheben UND das
   jeweilige Symbol immer gut lesbar bleibt (vorher: Papierkorb auf tuerkisem
   Grund kaum erkennbar). */
.gh-forum-icon-btn {
    width: 30px; height: 30px; padding: 0; border-radius: 6px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem;
    background: transparent !important; color: var(--pulse-text, var(--color-text)) !important;
    border: 1px solid var(--pulse-border, var(--color-border)) !important;
}
.gh-forum-icon-btn:hover { background: rgba(128,128,128,0.15) !important; }
.gh-forum-icon-btn.gh-forum-icon-btn-danger:hover {
    background: rgba(224,66,74,0.15) !important; border-color: #e0424a !important;
}

/* ---- Reaktionen (eigene Smiley-Grafiken, wie im Chat) ---- */
.gh-forum-reactions { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gh-forum-reaction-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
    border-radius: 999px; border: 1px solid var(--pulse-border, var(--color-border));
    background: rgba(128,128,128,0.08); font-size: 0.8rem; cursor: pointer;
}
.gh-forum-reaction-chip img { display: block; }
.gh-forum-reaction-chip.is-mine {
    border-color: var(--pulse-accent, var(--color-primary));
    background: rgba(0, 194, 168, 0.18);
    background: color-mix(in srgb, var(--pulse-accent, var(--color-primary)) 18%, transparent);
}
.gh-forum-reaction-add {
    width: 26px; height: 26px; border-radius: 50%; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.gh-forum-reaction-picker {
    position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 10;
    flex-wrap: wrap; gap: 6px; max-width: 260px; padding: 8px;
    background: var(--pulse-surface, var(--color-surface)); border: 1px solid var(--pulse-border, var(--color-border));
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
/* WICHTIG: display erst hier setzen (nicht in der Basis-Regel oben) und
   das [hidden]-Attribut explizit mit display:none erzwingen - sonst gewinnt
   die eigene Klassenregel (gleiche Spezifitaet, aber spaeter in der
   Kaskade) gegen das native [hidden] des Browsers, und das Panel bleibt
   IMMER sichtbar, egal ob das hidden-Attribut gesetzt ist oder nicht. */
.gh-forum-reaction-picker:not([hidden]) { display: flex; }
.gh-forum-reaction-picker[hidden] { display: none !important; }
.gh-forum-reaction-pick { cursor: pointer; border-radius: 4px; padding: 2px; }
.gh-forum-reaction-pick:hover { background: rgba(128,128,128,0.15); }

/* Von Quill selbst erzeugte Zitate (eigener Werkzeugleisten-Knopf "blockquote"
   UND das "Zitieren"-Feature) landen als echtes <blockquote><cite>...</cite></blockquote> -
   vorher hartcodiert nur fuers helle Theme im <style>-Block direkt in topic.php,
   jetzt themefest ueber die CSS-Variablen der jeweiligen Vorlage. */
.gh-forum-post-body blockquote {
    border-left: 3px solid var(--pulse-accent, var(--color-primary));
    background: rgba(128,128,128,0.08);
    padding: 8px 12px; margin: 8px 0; border-radius: 0 6px 6px 0;
    overflow-wrap: anywhere;
}
.gh-forum-post-body blockquote cite {
    display: block; font-style: normal; font-weight: bold;
    font-size: 0.8rem; opacity: 0.7; margin-bottom: 4px;
}

@media (max-width: 700px) {
    .gh-forum-post { flex-direction: column; }
    .gh-forum-post-author {
        flex: none; display: flex; align-items: center; gap: 10px; text-align: left;
        border-right: none; border-bottom: 1px solid var(--pulse-border, var(--color-border));
        padding-right: 0; padding-bottom: 10px; margin-bottom: 10px;
    }
    .gh-forum-post-author-avatar { width: 40px; height: 40px; margin: 0; }
    .gh-forum-lastpost-col { display: none; }
}

/* ---- Chat-Nachrichten-Reaktionen (gleiches Muster wie Forum-Reaktionen) ---- */
.gh-chat-reactions { position: relative; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.gh-chat-reaction-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
    border-radius: 999px; border: 1px solid var(--pulse-border, var(--color-border));
    background: rgba(128,128,128,0.08); font-size: 0.75rem; cursor: pointer;
}
.gh-chat-reaction-chip img { display: block; }
.gh-chat-reaction-chip.is-mine {
    border-color: var(--pulse-accent, var(--color-primary));
    background: rgba(0, 194, 168, 0.18);
    background: color-mix(in srgb, var(--pulse-accent, var(--color-primary)) 18%, transparent);
}
.gh-chat-reaction-add {
    width: 22px; height: 22px; border-radius: 50%; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem;
}
.gh-chat-reaction-picker {
    position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 10;
    flex-wrap: wrap; gap: 5px; max-width: 220px; padding: 6px;
    background: var(--pulse-surface, var(--color-surface)); border: 1px solid var(--pulse-border, var(--color-border));
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.gh-chat-reaction-picker:not([hidden]) { display: flex; }
.gh-chat-reaction-picker[hidden] { display: none !important; }
.gh-chat-reaction-pick { cursor: pointer; border-radius: 4px; padding: 2px; }
.gh-chat-reaction-pick:hover { background: rgba(128,128,128,0.15); }

/* ---- Smiley in Beitrag/Antwort einfügen (Forum) ---- */
.gh-forum-smiley-insert-btn {
    font-size: 0.85rem; padding: 5px 10px; border-radius: 6px;
    border: 1px solid var(--pulse-border, var(--color-border)); background: transparent;
    color: var(--pulse-text, var(--color-text)); cursor: pointer;
}
.gh-forum-smiley-insert-btn:hover { background: rgba(128,128,128,0.15); }
.gh-forum-smiley-insert-picker {
    position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 10;
    flex-wrap: wrap; gap: 6px; max-width: 280px; padding: 8px;
    background: var(--pulse-surface, var(--color-surface)); border: 1px solid var(--pulse-border, var(--color-border));
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.gh-forum-smiley-insert-picker:not([hidden]) { display: flex; }
.gh-forum-smiley-insert-picker[hidden] { display: none !important; }
.gh-forum-smiley-insert-pick { cursor: pointer; border-radius: 4px; padding: 2px; }
.gh-forum-smiley-insert-pick:hover { background: rgba(128,128,128,0.15); }

/* Leaflet-Karten duerfen nie ueber Chat-Overlay/Floatchat liegen: ohne eigenen
   Stacking-Context "lecken" Leaflets interne Panes (z-index bis 700) in den
   globalen Kontext und liegen damit ueber allen fixed-position UI-Elementen. */
.leaflet-container { isolation: isolate; z-index: 0; }

/* Online-Status-Punkt neben "Mein Profil" */
.pulse-account-row { display: flex; align-items: center; padding-right: 14px; }
.pulse-account-row .pulse-account { flex: 1; min-width: 0; }

/* Mobil: Seitenleiste folgt der sichtbaren Hoehe (dynamische Browserleiste), damit
   "Mein Profil" und "Abmelden" nicht abgeschnitten werden; die Navigation scrollt. */
@media (max-width: 900px) {
    .pulse-sidebar {
        height: auto; bottom: 0;
        height: 100dvh; max-height: 100dvh;
    }
    .pulse-nav { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .pulse-sidebar-bottom {
        flex-shrink: 0; margin-top: 0;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .pulse-logout { margin-bottom: 4px; }
}
