/**
 * Schwarzeschafe31 — Haupt-Stylesheet
 * Ausgelagert aus templates/layout.php (v26.21)
 */

/* ═══════ CSS TOKENS ═══════ */
:root {
    --body-bg: #0e1422;
    --card-bg: #152040;
    --card-bg-alt: #1a2850;
    --border: #263468;
    --border-light: #304278;
    --text: #b8c4d8;
    --text-muted: #6878a0;
    --text-heading: #e0e6f2;
    --cyan: #e87a1e;
    --cyan-dim: #c46518;
    --cyan-glow: rgba(232, 122, 30, 0.15);
    --gold: #d4a82a;
    --gold-dim: #b08a1e;
    --red: #c83858;
    --green: #2ecc71;
    /* v27.7 (To-do 3.7): bisher benutzt, aber nie festgelegt */
    --warning: #e8781e;
    --orange: #e87a1e;
    --yellow: #e0b830;
    --bg-lighter: #1a2850;
    --link: #e89850;
    --blue-accent: #2a3a80;
    --font-display: 'Rajdhani', 'Segoe UI', sans-serif;
    --font-body: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 2px 16px rgba(0,0,0,0.35);
    --sidebar-width: 175px;
    --sidebar-right-width: 245px;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --body-bg: #eef0f5;
        --card-bg: #ffffff;
        --card-bg-alt: #f2f4f8;
        --border: #c8d0e0;
        --border-light: #dce2ee;
        --text: #2a3248;
        --text-muted: #5a6888;
        --text-heading: #141c30;
        --cyan: #c46518;
        --cyan-dim: #a85512;
        --cyan-glow: rgba(196, 101, 24, 0.10);
        --gold: #b08a1e;
        --gold-dim: #8a6c14;
        --red: #a82e48;
        --green: #27ae60;
        /* v27.7 (To-do 3.7) */
        --warning: #b8600f;
        --orange: #c46518;
        --yellow: #9a7a12;
        --bg-lighter: #f2f4f8;
        --link: #b85a14;
        --blue-accent: #3a4a90;
        --shadow: 0 2px 12px rgba(0,0,0,0.08);
    }
}
:root[data-theme="light"] {
    --body-bg: #eef0f5;
    --card-bg: #ffffff;
    --card-bg-alt: #f2f4f8;
    --border: #c8d0e0;
    --border-light: #dce2ee;
    --text: #2a3248;
    --text-muted: #5a6888;
    --text-heading: #141c30;
    --cyan: #c46518;
    --cyan-dim: #a85512;
    --cyan-glow: rgba(196, 101, 24, 0.10);
    --gold: #b08a1e;
    --gold-dim: #8a6c14;
    --red: #a82e48;
    --green: #27ae60;
    /* v27.7 (To-do 3.7) */
    --warning: #b8600f;
    --orange: #c46518;
    --yellow: #9a7a12;
    --bg-lighter: #f2f4f8;
    --link: #b85a14;
    --blue-accent: #3a4a90;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] {
    --body-bg: #0e1422;
    --card-bg: #152040;
    --card-bg-alt: #1a2850;
    --border: #263468;
    --border-light: #304278;
    --text: #b8c4d8;
    --text-muted: #6878a0;
    --text-heading: #e0e6f2;
    --cyan: #e87a1e;
    --cyan-dim: #c46518;
    --cyan-glow: rgba(232, 122, 30, 0.15);
    --gold: #d4a82a;
    --gold-dim: #b08a1e;
    --red: #c83858;
    --green: #2ecc71;
    /* v27.7 (To-do 3.7): bisher benutzt, aber nie festgelegt */
    --warning: #e8781e;
    --orange: #e87a1e;
    --yellow: #e0b830;
    --bg-lighter: #1a2850;
    --link: #e89850;
    --blue-accent: #2a3a80;
    --shadow: 0 2px 16px rgba(0,0,0,0.35);
}

/* ═══════ ACCORDION SYSTEM ═══════ */
.accordion-section { margin-bottom: 2px; }
.accordion-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--card-bg-alt);
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; user-select: none;
    transition: background 0.15s, border-color 0.15s;
    font-family: var(--font-display); font-weight: 600;
    font-size: 14px; color: var(--text-heading);
}
.accordion-header:hover { background: rgba(232,122,30,0.06); border-color: var(--border-light); }
.accordion-header.is-open { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
.accordion-chevron {
    margin-left: auto; font-size: 12px; color: var(--text-muted);
    transition: transform 0.25s;
}
.accordion-header.is-open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
    display: none; border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--card-bg); padding: 12px 14px;
}
.accordion-header.is-open + .accordion-body { display: block; }
.accordion-controls {
    display: flex; gap: 8px; margin-bottom: 10px; align-items: center;
}
.accordion-controls .acc-btn {
    padding: 4px 10px; font-size: 12px; font-family: var(--font-display);
    font-weight: 600; border: 1px solid var(--border); border-radius: 3px;
    background: var(--card-bg-alt); color: var(--text-muted);
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.accordion-controls .acc-btn:hover { background: var(--cyan-glow); color: var(--cyan); border-color: var(--cyan-dim); }

/* ═══════ RESET & BASE ═══════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: var(--body-bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--cyan); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ═══════ HEADER ═══════ */
.site-header {
    background: var(--card-bg);
    border-top: 3px solid var(--cyan);
    padding: 0;
}

/* -- Obere Zeile: Logo zentriert, User-Controls rechts -- */
.header-top {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px 14px;
    position: relative;
}
.site-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-heading);
}
.logo-icon {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    object-fit: contain;
}
.logo-text {
    text-align: center;
}
.logo-text h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.1;
    color: var(--text-heading);
}
.logo-text small {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}
.header-user {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    font-size: 13px;
    white-space: nowrap;
}
.header-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}
.header-user .username-link {
    color: var(--text-heading);
    font-weight: 600;
}
.session-timer-display {
    font-size: 11px;
    color: #e87a1e;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-basis: 100%;
    justify-content: flex-end;
    margin-top: 2px;
}
.session-timer-display.timer-warning {
    color: var(--red);
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.header-icon-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
}
.header-icon-link:hover {
    color: var(--cyan);
    background: var(--cyan-glow);
}
.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--crimson, #c83858);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    text-align: center;
    pointer-events: none;
}

/* -- Untere Zeile: Nav-Leiste mit Menü + Suche -- */
.header-nav-bar {
    background: var(--blue-accent);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 2px solid var(--blue-accent);
}
.header-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 4px;
}
/* ═══════ NAVIGATION ═══════ */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}
.main-nav a {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    padding: 10px 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.main-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.main-nav a.active {
    color: var(--cyan);
    background: rgba(0,212,221,0.1);
    box-shadow: inset 0 -2px 0 var(--cyan);
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    padding: 7px 16px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-cyan {
    background: var(--cyan);
    color: #0a0f1a;
}
.btn-cyan:hover { background: var(--cyan-dim); color: #0a0f1a; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-gold {
    background: var(--gold);
    color: #1a1400;
}
.btn-gold:hover { background: var(--gold-dim); color: #1a1400; }
.btn-red {
    background: var(--red);
    color: #fff;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ═══════ 3-COLUMN LAYOUT ═══════ */
.site-body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-right-width);
    gap: 20px;
    min-height: calc(100vh - 180px);
}

.sidebar-left,
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-content {
    min-width: 0;
}

/* ═══════ CARDS / BOXES ═══════ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
/* TinyMCE-Dialoge (Link/Bild) immer im Vordergrund */
.tox-tinymce-aux {
    z-index: 100000 !important;
}
.card-header {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cyan);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--blue-accent);
    background: var(--card-bg-alt);
}
.card-body {
    padding: 14px 16px;
}

/* ═══════ SIDEBAR WIDGETS ═══════ */
.widget-list {
    list-style: none;
}
.widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--text); }
.widget-list a:hover { color: var(--cyan); }

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}
.stat-row .stat-label { color: var(--text-muted); }
.stat-row .stat-value { color: var(--text-heading); font-weight: 600; }

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 6px;
}
.online-user {
    font-size: 12px;
    padding: 3px 0;
}
.online-user a { color: var(--text); }
.online-user a:hover { color: var(--cyan); }

/* ═══════ BREADCRUMB ═══════ */
.breadcrumb {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb .sep { color: var(--border-light); margin: 0 2px; }
.breadcrumb span:last-child { color: var(--text-heading); font-weight: 600; }

/* Zurück-Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: all 0.15s;
    cursor: pointer;
    background: none;
    border: 1px solid var(--border);
}
.btn-back:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-glow); }

/* ═══════ FORUM CATEGORY LIST ═══════ */
.category-row {
    display: grid;
    grid-template-columns: 40px 1fr 80px 80px 180px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.category-row:last-child { border-bottom: none; }
.category-row:hover { background: var(--card-bg-alt); }
.cat-icon { font-size: 22px; text-align: center; }
.cat-info h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}
.cat-info h3 a { color: var(--text-heading); }
.cat-info h3 a:hover { color: var(--cyan); }
.cat-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cat-stat {
    text-align: center;
    font-size: 13px;
}
.cat-stat .num { display: block; font-weight: 700; color: var(--text-heading); font-size: 16px; }
.cat-stat .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cat-latest {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
}
.cat-latest a { color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-latest a:hover { color: var(--cyan); }
.cat-latest .time { font-size: 11px; }

/* ═══════ THREAD LIST ═══════ */
.thread-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 160px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--card-bg-alt); }
.thread-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
}
.thread-title a { color: var(--text-heading); }
.thread-title a:hover { color: var(--cyan); }
.thread-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.thread-stat { text-align: center; font-size: 13px; color: var(--text-muted); }
.thread-latest { font-size: 12px; color: var(--text-muted); }
.thread-latest a { color: var(--text); }
.thread-latest a:hover { color: var(--cyan); }

.badge-pinned {
    display: inline-block;
    background: var(--gold);
    color: #1a1400;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 6px;
    vertical-align: middle;
}
.badge-locked {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ═══════ POST VIEW ═══════ */
.post {
    display: grid;
    grid-template-columns: 160px 1fr;
    border-bottom: 1px solid var(--border);
}
.post:last-child { border-bottom: none; }
.post-author {
    background: var(--card-bg-alt);
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.post-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-light);
    margin-bottom: 8px;
}
.post-username {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}
.post-username a { color: var(--text-heading); }
.post-username a:hover { color: var(--cyan); }
.post-rank { font-size: 11px; margin-bottom: 6px; }
.post-info { font-size: 11px; color: var(--text-muted); line-height: 1.8; }
.post-body {
    padding: 16px 20px;
}
.post-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.post-content {
    line-height: 1.7;
    word-wrap: break-word;
}
.post-content .bb-quote {
    background: var(--card-bg-alt);
    border-left: 3px solid var(--red);
    padding: 10px 14px;
    margin: 10px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content .bb-quote cite {
    font-size: 12px;
    color: var(--red);
    display: block;
    margin-bottom: 6px;
    font-style: normal;
    font-weight: 600;
}
.post-content .bb-code {
    background: #0d1117;
    color: #c9d1d9;
    padding: 12px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    margin: 10px 0;
}
.post-content .bb-img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 8px 0;
}
.post-signature {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}
.post-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

/* ═══════ FORMS ═══════ */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan-glow);
}
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}
select.form-control {
    cursor: pointer;
}

/* ═══════ EDITOR TOOLBAR ═══════ */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--card-bg-alt);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.editor-toolbar button:hover {
    background: var(--cyan-glow);
    border-color: var(--cyan);
    color: var(--cyan);
}
.editor-textarea {
    border-radius: 0 0 var(--radius) var(--radius) !important;
}

/* ═══════ RANK BADGES ═══════ */
.rank-badge { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.rank-faint { color: var(--text-muted) !important; }
.rank-muted { color: var(--text) !important; }
.rank-cyan, .rank-orange { color: var(--cyan) !important; }
.rank-gold { color: var(--gold) !important; }

/* ═══════ PAGINATION ═══════ */
.pagination {
    display: flex;
    gap: 4px;
    margin: 20px 0;
    justify-content: center;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.page-link:hover { border-color: var(--cyan); color: var(--cyan); }
.page-link.active { background: var(--cyan); color: #0a0f1a; border-color: var(--cyan); }
.page-dots { color: var(--text-muted); padding: 0 4px; line-height: 34px; }

/* ═══════ FLASH MESSAGES ═══════ */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
    overflow: hidden;
}
.flash.flash-out {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0 16px;
}
.flash-success { background: rgba(46, 204, 113, 0.15); color: var(--green); border: 1px solid rgba(46, 204, 113, 0.3); }
.flash-error { background: rgba(224, 64, 64, 0.15); color: var(--red); border: 1px solid rgba(224, 64, 64, 0.3); }
.flash-info { background: var(--cyan-glow); color: var(--cyan); border: 1px solid rgba(0, 212, 221, 0.3); }
.flash-warning { background: rgba(232, 120, 30, 0.15); color: var(--warning); border: 1px solid rgba(232, 120, 30, 0.35); } /* v27.7 (To-do 3.7) */

/* ═══════ MEMBER LIST ═══════ */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
}
.member-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
    cursor: pointer;
}
.member-card:hover { border-color: var(--cyan); }
.member-card .member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.member-card .member-info { min-width: 0; flex: 1; }
.member-card .member-info .name { font-weight: 600; font-size: 14px; }
.member-card .member-info .name a { color: var(--text-heading); }
.member-card .member-info .name a:hover { color: var(--cyan); }
/* Stretched Link: ganze Karte klickbar */
.member-card .member-info .name a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
.member-card .member-info .meta {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}
.member-card .member-info .meta .rank-badge,
.member-card .member-info .meta .clan-rank-badge {
    white-space: nowrap;
}

/* ═══════ PROFILE ═══════ */
/* ═══════ PROFILE HEADER (WoltLab-Stil) ═══════ */
.profile-banner {
    position: relative;
    background: linear-gradient(135deg, #0c1220 0%, #152040 40%, #1a2850 70%, #263468 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 3px solid var(--cyan);
    padding: 32px 28px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    overflow: hidden;
}
.profile-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 200"><polygon points="0,200 200,50 400,150 600,0 600,200" fill="rgba(42,58,128,0.15)"/><polygon points="0,200 150,100 350,180 500,60 600,200" fill="rgba(232,122,30,0.05)"/></svg>') center/cover no-repeat;
    opacity: 0.6;
    pointer-events: none;
}
.profile-banner > * { position: relative; z-index: 1; }
.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--blue-accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}
.profile-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.profile-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.profile-stat {
    text-align: center;
}
.profile-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    font-family: var(--font-display);
    line-height: 1.2;
}
.profile-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 2px solid var(--blue-accent);
    overflow-x: auto;
}
.profile-tabs a {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.profile-tabs a:hover {
    color: var(--text-heading);
}
.profile-tabs a.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

/* Profile Content */
.profile-content {
    background: var(--card-bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 24px;
}
.profile-section {
    margin-bottom: 24px;
}
.profile-section:last-child { margin-bottom: 0; }
.profile-section-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.profile-field {
    display: flex;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(38,52,104,0.3);
}
.profile-field:last-child { border-bottom: none; }
.profile-field-label {
    width: 140px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 600;
}
.profile-field-value {
    color: var(--text);
    word-break: break-word;
}

/* Responsive Profile */
@media (max-width: 600px) {
    .profile-banner { flex-direction: column; text-align: center; padding: 24px 16px; }
    .profile-stats { justify-content: center; }
    .profile-field { flex-direction: column; gap: 2px; }
    .profile-field-label { width: auto; }
    .profile-tabs a { padding: 10px 14px; font-size: 12px; }
}

/* Backward compat alias */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
}
.profile-stat strong { color: var(--text-heading); }

/* ═══════ SEARCH ═══════ */
.search-box {
    display: flex;
    gap: 8px;
}
.search-box .form-control { flex: 1; }

/* Header-Suche (in Nav-Leiste rechts) */
.header-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    padding: 6px 0;
}
.header-search form {
    display: flex;
    align-items: center;
    gap: 0;
}
.header-search input[type="text"] {
    width: 160px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius) 0 0 var(--radius);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12px;
    transition: border-color 0.2s, width 0.3s;
}
.header-search input[type="text"]:focus {
    outline: none;
    border-color: var(--cyan);
    width: 220px;
    background: rgba(255,255,255,0.12);
}
.header-search input[type="text"]::placeholder { color: rgba(255,255,255,0.4); }
.header-search button {
    padding: 6px 10px;
    background: var(--cyan);
    border: 1px solid var(--cyan);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: #0a0f1a;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-display);
    transition: background 0.2s;
    white-space: nowrap;
}
.header-search button:hover { background: var(--cyan-dim); }

/* ═══════ ONLINE STATUS BAR ═══════ */
.online-bar {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    font-size: 12px;
    color: var(--text-muted);
}
.online-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.online-bar-left {
    white-space: nowrap;
}
.online-bar-left strong {
    color: var(--text-heading);
}
.online-bar-users {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.online-bar-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--link);
    font-size: 12px;
}
.online-bar-user:hover { color: var(--cyan); }

/* ═══════ FOOTER ═══════ */
.site-footer {
    background: var(--card-bg);
    border-top: 2px solid var(--blue-accent);
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--cyan); }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1024px) {
    .site-body {
        grid-template-columns: 1fr var(--sidebar-right-width);
    }
    .sidebar-left { display: none; }
}
@media (max-width: 768px) {
    .site-body {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .sidebar-left,
    .sidebar-right { display: none; }
    .online-bar { display: none; }
    .header-top {
        flex-direction: column;
        padding: 14px 16px 10px;
    }
    .header-user {
        position: static;
        transform: none;
        margin-top: 10px;
        justify-content: center;
    }
    .header-nav-inner {
        flex-wrap: wrap;
        gap: 0;
        padding: 0 12px;
    }
    .main-nav {
        width: 100%;
        overflow-x: auto;
        justify-content: center;
    }
    .main-nav a { padding: 8px 10px; font-size: 12px; }
    .header-search {
        width: 100%;
        margin-left: 0;
        padding: 6px 0 8px;
        justify-content: center;
    }
    .header-search input[type="text"] { flex: 1; width: auto; }
    .header-search input[type="text"]:focus { width: auto; }
    .category-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .cat-stat, .cat-latest { display: none; }
    .thread-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .thread-stat, .thread-latest { display: none; }
    .post {
        grid-template-columns: 1fr;
    }
    .post-author {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 10px 14px;
    }
    .post-avatar { width: 40px; height: 40px; margin-bottom: 0; }
}

/* ═══════ UTILITY ═══════ */
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-sm { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }

/* ═══════ LEGAL TEXT ═══════ */
.legal-text { line-height: 1.8; font-size: 14px; }
.legal-text h3 { font-family: var(--font-display); font-size: 18px; color: var(--cyan); margin: 20px 0 8px 0; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text p { margin-bottom: 12px; }
/* v26.82: formatierte Rechtstexte / Regeln aus der Ablage (Ueberschriften, Listen, Fristen-Tabelle) */
.legal-text h2, .legal-text h4 { font-family: var(--font-display); color: var(--cyan); margin: 22px 0 8px 0; }
.legal-text h2 { font-size: 20px; } .legal-text h4 { font-size: 15px; }
.legal-text ul, .cms-page-content ul { margin: 0 0 12px 22px; }
.legal-text li, .cms-page-content li { margin-bottom: 4px; }
.legal-text table, .cms-page-content table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; font-size: 13px; display: block; overflow-x: auto; }
.legal-text th, .legal-text td, .cms-page-content th, .cms-page-content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.legal-text th, .cms-page-content th { background: rgba(255,255,255,0.04); }
/* v26.89 (T-54): Absaetze "Noch nicht aktiv." — Funktion beschrieben, aber noch nicht eingeschaltet; beim Scharfschalten entfernen */
.noch-nicht-aktiv { background: rgba(232,160,30,0.08); border-left: 3px solid #e8a01e; padding: 8px 12px; border-radius: 0 4px 4px 0; }

/* ═══════ COOKIE BANNER ═══════ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 3px solid var(--cyan);
    padding: 18px 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}
.cookie-banner p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    max-width: 700px;
    line-height: 1.5;
}
.cookie-banner p a {
    color: var(--cyan);
    text-decoration: underline;
}
.cookie-banner .cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookie-banner .btn-accept {
    background: var(--cyan);
    color: var(--body-bg);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    transition: background .2s;
}
.cookie-banner .btn-accept:hover { background: var(--cyan-hover); }
.cookie-banner .btn-decline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    transition: border-color .2s, color .2s;
}
.cookie-banner .btn-decline:hover { border-color: var(--text-muted); color: var(--text); }
@media (max-width: 600px) {
    .cookie-banner { flex-direction: column; text-align: center; padding: 16px; }
    .cookie-banner .cookie-buttons { width: 100%; justify-content: center; }
}

/* ─── Frontend-Edit-Links für Admins ─── */
.fe-edit-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 4px;
    background: rgba(232,122,30,0.15); color: var(--orange);
    font-size: 11px; text-decoration: none;
    opacity: 0.4; transition: opacity 0.2s, background 0.2s;
    vertical-align: middle; margin-left: 4px; flex-shrink: 0;
}
.fe-edit-link:hover { opacity: 1; background: rgba(232,122,30,0.3); }
.fe-edit-link i { font-size: 10px; }
.card-header .fe-edit-link { float: right; margin-top: 1px; }
.main-nav .fe-edit-link { margin-left: 6px; opacity: 0.3; }
.main-nav .fe-edit-link:hover { opacity: 1; }
.cms-page-edit { position: absolute; top: 8px; right: 12px; }

/* ─── Icon Picker (Frontend) ─── */
.icon-picker-wrap { position: relative; }
.icon-picker-trigger {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: var(--card-bg, #1a2035); border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; color: var(--text); font-size: 13px; width: 100%;
    transition: border-color .2s;
}
.icon-picker-trigger:hover { border-color: var(--cyan, #00d4dd); }
.icon-picker-preview {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 16px;
}
.icon-picker-preview i { font-size: 16px; color: var(--cyan, #00d4dd); }
.icon-picker-preview img { width: 18px; height: 18px; object-fit: contain; }
.icon-picker-label { color: var(--text-muted); font-size: 13px; }
.icon-picker-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100001;
    background: var(--card-bg, #1a2035); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); max-height: 320px; overflow-y: auto;
    min-width: 280px;
}
.icon-picker-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-bg, #1a2035); z-index: 1; }
.icon-picker-search {
    width: 100%; padding: 6px 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text); font-size: 13px; outline: none;
}
.icon-picker-search:focus { border-color: var(--cyan, #00d4dd); }
.icon-picker-clear { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.icon-picker-clear-btn {
    width: 100%; padding: 4px; background: none; border: 1px dashed var(--border); border-radius: 4px;
    color: var(--text-muted); cursor: pointer; font-size: 12px; transition: border-color .2s, color .2s;
}
.icon-picker-clear-btn:hover { border-color: var(--orange, #e87a1e); color: var(--orange, #e87a1e); }
.icon-picker-section-label {
    padding: 6px 10px 2px; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted); user-select: none;
}
.icon-picker-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px; padding: 6px 8px;
}
.icon-picker-item {
    display: flex; align-items: center; justify-content: center; height: 36px;
    border: 1px solid transparent; border-radius: 4px; cursor: pointer;
    color: var(--text); transition: background .15s, border-color .15s;
}
.icon-picker-item:hover { background: rgba(0,212,221,0.1); border-color: var(--cyan, #00d4dd); color: var(--cyan, #00d4dd); }
.icon-picker-item i { font-size: 16px; pointer-events: none; }
.icon-picker-item img { width: 20px; height: 20px; object-fit: contain; pointer-events: none; }
.icon-picker-empty {
    padding: 16px; text-align: center; color: var(--text-muted); font-size: 12px;
}
/* Gruppen-Zugriff-Panel */
.group-access-panel { position: relative; }
.gap-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text); font-size: 13px; cursor: pointer;
    transition: border-color 0.2s;
}
.gap-toggle:hover { border-color: var(--cyan); }
.gap-toggle .gap-arrow { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
.group-access-panel.is-open .gap-arrow { transform: rotate(180deg); }
.gap-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 4px; max-height: 300px; overflow-y: auto;
}
.gap-controls {
    display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.gap-ctrl-btn {
    padding: 3px 8px; font-size: 11px; background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-muted); cursor: pointer;
}
.gap-ctrl-btn:hover { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.gap-group-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px;
}
.gap-group-row:last-child { border-bottom: none; }
.gap-group-row:hover { background: rgba(255,255,255,0.03); }
.gap-admin-locked { opacity: 0.6; }
.gap-lock-hint { font-size: 10px; color: var(--text-muted); margin-left: auto; }

/* ═══════ CONFIRM-MODAL ═══════ */
.cm-overlay{display:none;position:fixed;inset:0;z-index:100001;background:rgba(0,0,0,0.7);justify-content:center;align-items:center}
.cm-box{background:var(--card-bg,#152040);border:1px solid var(--border,#263468);border-radius:12px;width:90%;max-width:420px;box-shadow:0 8px 32px rgba(0,0,0,0.5);animation:cmIn .15s ease;overflow:hidden}
@keyframes cmIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
.cm-header{padding:20px 24px 0;font-size:17px;font-weight:600;color:var(--text-heading,#e0e6f2);font-family:var(--font-display,'Rajdhani',sans-serif)}
.cm-body{padding:12px 24px 20px;font-size:14px;color:var(--text,#b8c4d8);line-height:1.6;white-space:pre-line}
.cm-footer{display:flex;justify-content:flex-end;gap:10px;padding:0 24px 20px}
.cm-btn{padding:8px 20px;border:none;border-radius:6px;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s}
.cm-btn:hover{opacity:.85}
.cm-btn-ghost{background:transparent;border:1px solid var(--border,#263468);color:var(--text,#b8c4d8)}
.cm-btn-ghost:hover{background:rgba(255,255,255,.05)}
.cm-btn-red{background:var(--red,#c83858);color:#fff}
.cm-btn-cyan{background:var(--cyan,#e87a1e);color:#fff}

/* ═══ Zwei-Faktor Backup-Codes: Drucktitel + Druckansicht (v26.39) ═══ */
.backup-codes-druck-titel,
.backup-codes-druck-hinweis { display: none; }

@media print {
    /* Seit v26.41: Regeln greifen NUR auf der Seite mit dem Backup-Code-Block (body:has(...)).
       v26.39 hatte "body * { visibility:hidden }" fuer ALLE Seiten gesetzt → andere Seiten druckten leer,
       und der ausgeblendete Rest belegte trotzdem Platz → 2 Seiten. Jetzt wird alles, was den Block
       nicht enthaelt, komplett entfernt (display:none) → eine Seite. */
    @page { margin: 15mm; }
    body:has(.backup-codes-druck) { background: #fff !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
    body:has(.backup-codes-druck) *:not(:has(.backup-codes-druck)):not(.backup-codes-druck):not(.backup-codes-druck *) {
        display: none !important;
    }
    body:has(.backup-codes-druck) *:has(.backup-codes-druck) {
        display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
        box-shadow: none !important; background: none !important; min-height: 0 !important; height: auto !important;
        width: auto !important; max-width: none !important; position: static !important;
    }
    .backup-codes-druck { width: 100%; padding: 0; background: #fff !important; }
    .backup-codes-druck div { background: #fff !important; color: #000 !important; border-color: #000 !important; }
    .backup-codes-druck-titel { display: block !important; font-size: 16px; font-weight: bold; margin-bottom: 16px; color: #000 !important; }
    .backup-codes-druck-hinweis { display: block !important; font-size: 12px; margin-top: 8px; color: #000 !important; }
}

/* v26.72: gesperrte Knoepfe sichtbar grau (vorher sahen sie aus wie aktive, z.B. 'Ich akzeptiere' bei der Registrierung) */
.btn:disabled, .btn[disabled] {
    background: #3a4458 !important;
    border-color: #3a4458 !important;
    color: #8a94a8 !important;
    cursor: not-allowed;
    opacity: .75;
    box-shadow: none !important;
}

/* ═══════ v27.27 (T-194): fremde Inhalte erst nach Klick ═══════ */
.fremd-inhalt { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%;
    padding: 10px 12px; margin: 4px 0; border: 1px dashed var(--border-light, #3a4a6b); border-radius: 6px;
    background: var(--card-bg-alt, rgba(255,255,255,.03)); vertical-align: middle; }
.fremd-inhalt .fremd-knopf { cursor: pointer; font: inherit; font-size: 13px; color: var(--text-heading, #fff);
    background: var(--card-bg, #1b2540); border: 1px solid var(--cyan, #e87a1e); border-radius: 4px; padding: 6px 10px; }
.fremd-inhalt .fremd-knopf:hover { background: var(--cyan, #e87a1e); color: #fff; }
.fremd-inhalt .fremd-hinweis { font-size: 11px; color: var(--text-muted, #8890a0); }

/* ═══════ v27.33 (2.23): Schalter „Rahmen“ gilt für jede Box-Art — ohne Rahmen steht die Box frei auf der Seite ═══════ */
.card.ohne-rahmen { background: transparent; border-color: transparent; border-radius: 0; overflow: visible; }
.card.ohne-rahmen > .card-header { border-bottom: none; padding-left: 2px; padding-right: 2px; background: none; }
.card.ohne-rahmen > .card-body { padding-left: 2px; padding-right: 2px; }