===============================Campus-Corner-DHSH – Premium Light===============================*/
/* ---------- Design Tokens ---------- */
html, body {
    width: 100%;
    overflow-x: hidden;
}
:root {
    --bg: #f3f4f6;
    --bg-soft: #e5e7eb;
    --card: #ffffff;
    --line: #e2e4ea;
    --text: #0f172a;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #e0edff;
    --danger: #e53935;
    --danger-dark: #c62828;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 999px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, .06);
    --shadow-strong: 0 22px 60px rgba(15, 23, 42, .10);
    --topbar-h: 64px;
    --sticky-gap: 12px;
    /* Initialen für Topbar-Avatar – werden von JS gesetzt */
    --topbar-initials: "CC";
}
/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
    color: var(--text);
    background: repeating-linear-gradient(45deg, transparent 0, transparent 140px, rgba(0, 0, 0, 0.02) 140px, rgba(0, 0, 0, 0.02) 141px), radial-gradient(circle at top, #ffffff 0, var(--bg-soft) 38%, var(--bg) 100%);
    background: #eef0f3;
    background-attachment: initial;

}
@media (max-width:1120px) {
    .grid {
        grid-template-columns: 1fr;
        padding: 18px 0 60px;
    }
    .sidebar.right {
        order: 3;
    }
}
.row {
    display: flex;
    gap: 14px;
}
.row.center {
    align-items: center
}
.row.between {
    justify-content: space-between
}
.row.gap {
    gap: 16px
}
/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.10), rgba(16, 185, 129, 0.10)), rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(191, 219, 254, .9);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}
.topbar .container {
    padding: 10px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .18);
}
.brand-text {
    font-weight: 700;
    letter-spacing: .12em;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #111827;
}
/* User-Badge rechts in der Topbar (Kreis + Name) */
.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* ===================== Background: Clean Gray Pulse (override) ===================== */

/* 1) Bewegtes Overlay komplett deaktivieren */
body::before {
  display: none !important;
  animation: none !important;
  background-image: none !important;
}

/* 2) Alten Muster-/Gradient-Background raus, stattdessen ruhiges Grau + sanfter Wechsel */
body {
  background: #eef0f3 !important;
  background-attachment: initial !important;
  animation: grayPulse 10s ease-in-out infinite !important;
}

/* 3) Sanfter Hell->Dunkel->Hell Effekt */
@keyframes grayPulse {
0%   { background-color: #f2f4f7; }
50%  { background-color: #e7ebf0; }
100% { background-color: #f2f4f7; }
}

#whoAmI {
    position: relative;
    padding: 6px 14px 6px 38px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.06);
    font-size: 0.82rem;
    color: #0f172a;
    border: 1px solid rgba(191, 219, 254, 0.9);
    font-weight: 500;
}
/* Kreis vor dem Namen – Initialen kommen aus JS */
#whoAmI::before {
    content: var(--topbar-initials, "??");
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}
/* ---------- Inputs & Controls ---------- */
.input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .15s ease, transform .06s ease;
}
.input::placeholder {
    color: #9ca3af;
}
.input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(147, 197, 253, .8), 0 0 0 6px rgba(191, 219, 254, .7);
    background: #ffffff;
    transform: translateY(-1px);
}
.input.search {
    min-width: 280px;
}
.input.textarea {
    min-height: 170px;
    resize: vertical;
}
.input.select {
    appearance: none;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path d="M4.5 7l4.5 4 4.5-4" stroke="%236b7280" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 12px center / 16px;
}
/* ---------- Buttons ---------- */
.btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s ease, border-color .15s ease, box-shadow .18s ease, transform .08s ease, color .15s ease;
}
.btn:hover {
    background: #f9fafb;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}
.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}
/* Primär-Buttons mit zweifarbigem Gradient (z.B. Antwort senden / Frage stellen) */
.btn.primary {
    background: linear-gradient(135deg, var(--accent), #22c55e);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .35);
}
.btn.primary:hover {
    filter: brightness(1.02);
}
.btn.ghost {
    background: transparent;
}
.btn.wide {
    width: 100%;
}
.btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}
/* Danger */
.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn.danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}
/* Toggle (z.B. „Meine Fragen“) */
.btn.toggle-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
/* ---------- Cards ---------- */
.card {
    background: linear-gradient(135deg, #ffffff 0, #f9fafb 45%, #f3f4f6 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: box-shadow .18s ease, transform .1s ease, border-color .18s ease;
}
.card::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0, transparent 60%);
    top: -70px;
    right: -50px;
    opacity: 0;
    transition: opacity .2s ease, transform .15s ease;
}
.card:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.45);
}
.card:hover::before {
    opacity: 1;
    transform: translateY(8px);
}
.card-title {
    margin: 0 0 14px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #111827;
}
/* Fragen-Liste */
.list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* Sticky-Elemente -> deaktiviert (sollen sich NICHT mehr bewegen) */
.card.sticky, .sticky-left {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}
/* ---------- Sidebars ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sidebar .card {
    position: relative;
    z-index: 1;
}
/* ---------- Typografie & kleine Elemente ---------- */
.muted {
    color: var(--muted);
}
.small {
    font-size: 0.8rem;
}
.label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
}
.tips {
    padding-left: 18px;
    margin: 6px 0 0;
    color: var(--muted);
}
.tips li {
    margin-bottom: 6px;
}
/* ---------- Login-Gate ---------- */
.gate {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #e5edff, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}
.gate-card {
    width: min(560px, 94vw);
    background: linear-gradient(135deg, #ffffff 0, #eff3ff 45%, #e0ecff 100%);
    border-radius: 28px;
    border: 1px solid rgba(191, 219, 254, .9);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
    padding: 30px 26px 26px;
}
.gate-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}
.brand-title {
    font-size: 1.6rem;
    margin: 0;
}
.brand-sub {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.gate-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.gate .row {
    gap: 10px;
}
.gate .btn {
    flex: 1;
}
/* ---------- Sortierleiste ---------- */
#sortBar {
    /* NICHT mehr sticky */
    position: static;
    top: auto;
    z-index: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: auto;
    padding: 12px 18px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #d4d7de;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    margin-bottom: 22px;
}
.sortbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.sort-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.sort-controls label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.sort-select-fixed {
    width: 190px;
    padding-top: 8px;
    padding-bottom: 8px;
}
#sortBar .card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #1f2937;
}
/* ---------- Frage-Karte (Premium) ---------- */
.question.card {
    padding: 24px 22px 20px 26px;
    border-radius: var(--radius-lg);
    border: 1px solid #e4e7f0;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
    position: relative;
}
/* linke Accent-Leiste VON OBEN BIS UNTEN */
.question.card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    background: linear-gradient(to bottom, var(--accent), #22c55e);
}
.q-header {
    margin-bottom: 4px;
}
.q-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 2px;
    color: #111827;
}
.q-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 14px;
}
.q-body {
    font-size: 0.98rem;
    line-height: 1.6;
    margin: 0 0 14px;
    color: #374151;
}
/* ---------- „Frage stellen“-Karte highlighten ---------- */
#askSection.card {
    background: linear-gradient(135deg, #ffffff 0, #e0f2fe 45%, #e0f7ff 100%);
    border: 1px solid rgba(56, 189, 248, 0.7);
    box-shadow: 0 20px 60px rgba(8, 47, 73, 0.12);
}
/* Abstand im Frage-stellen-Kasten */
#askSection {
    margin-top: -6px !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#askSection .input {
    margin-bottom: 10px;
}
#askSection button {
    margin-top: 12px;
}
/* Blinkender grüner Punkt bei "Frage stellen" */
#askSection .card-title {
    position: relative;
    padding-left: 18px;
    margin-bottom: 16px;
}
#askSection .card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    transform: translateY(-50%);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: askDotPulse 1.6s ease-out infinite;
}
@keyframes askDotPulse {
    0% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    60% {
        transform: translateY(-50%) scale(1.6);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}
.sidebar.right>.card:first-child {
    margin-top: 0 !important;
}
/* ---------- Tags ---------- */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    font-size: 0.8rem;
    color: #4338ca;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .16s ease;
}
.tag:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(129, 140, 248, 0.25);
}
/* Beliebte Tags – wie blaue Badges */
.tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    border: 1px solid #e0e7ff;
    background: #eef2ff;
    font-size: 0.8rem;
    color: #4338ca;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .08s ease, box-shadow .16s ease;
}
.tag-btn:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(129, 140, 248, 0.25);
}
.tag-count {
    font-size: 0.75rem;
    color: var(--muted);
}
/* ---------- Antworten ---------- */
.answers-block {
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}
.answers-block.collapsed {
    display: none;
}
.answers-toggle-row {
    margin: 4px 0 6px;
}
.answer {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 10px;
    transition: background .15s ease, border-color .15s ease, box-shadow .16s ease, transform .08s ease;
}
.answer:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 8px 18px rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
}
.answer-meta {
    margin: 0 0 4px;
    font-size: 0.78rem;
    color: var(--muted);
}
.answer-body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}
.answer-empty {
    margin: 4px 0 0;
}
/* Antwortformular */
.answer-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.answer-input {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 9px 11px;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.answer-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.8), 0 0 0 6px rgba(219, 234, 254, 0.9);
}
/* ---------- Frage-Footer ---------- */
/* alles untereinander, damit Löschen + Stern UNTER „Antwort senden“ landen */
.q-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin-top: 0.75rem;
}
/* Antwortformular füllt die Breite */
.q-footer .answer-form {
    flex: 1;
}
/* Aktionen-Reihe unter dem Button: Löschen 80%, Stern 20% */
.q-footer-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}
/* Lösch-Button breit (ca. 80%) */
.q-footer-actions .btn.danger {
    flex: 4;
}
/* Stern / Like schmal (ca. 20%) */
.q-footer-actions .like-btn {
    flex: 1;
    white-space: nowrap;
}
/* ---------- Like-Button ---------- */
.like-btn {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    transition: background .15s ease, transform .1s ease, color .15s ease, border-color .15s ease, box-shadow .16s ease;
}
.like-btn:hover {
    background: #e5e7eb;
    box-shadow: 0 8px 18px rgba(148, 163, 184, 0.4);
}
.like-btn.liked {
    background: var(--accent);
    border-color: #1d4ed8;
    color: #fff;
    transform: translateY(-1px);
}
/* ---------- Nach oben Button ---------- */
#toTopBtn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
#toTopBtn.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
/* ---------- Modals (Frage löschen – #deleteModal) ---------- */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.32);
}
.modal.show {
    display: flex;
}
.modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px 16px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    border: 1px solid #fecaca;
}
.modal-dialog h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #b91c1c;
}
.modal-dialog p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #4b5563;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
/* ---------- Hard Modals (Antwort löschen etc.) ---------- */
.hard-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, 0.32) !important;
    z-index: 9998 !important;
}
.hard-modal.show {
    display: flex !important;
}
.hard-modal-content {
    background: #ffffff !important;
    padding: 18px 20px 16px !important;
    border-radius: 16px !important;
    max-width: 380px !important;
    width: 90% !important;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25) !important;
    border: 1px solid #e5e7eb !important;
}
.hard-modal-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 8px !important;
}
/* ---------- Top-Karten auf ähnliche Höhe ---------- */
#askSection, .sidebar.right>.card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
/* ---------- Avatar Badges ---------- */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-right: 8px;
    user-select: none;
    flex-shrink: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}
.avatar.small {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
    margin-right: 6px;
}
/* Farben rotieren */
.avatar.color-1 {
    background: #2563eb;
}
.avatar.color-2 {
    background: #7c3aed;
}
.avatar.color-3 {
    background: #db2777;
}
.avatar.color-4 {
    background: #059669;
}
.avatar.color-5 {
    background: #d97706;
}
.avatar.color-6 {
    background: #334155;
}
/* Großer Avatar für Fragen */
.avatar.big {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    margin-right: 12px;
}
@media (max-width: 640px) {
    .avatar.big {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}
/* ---------- Responsive Tweaks Desktop->Tablet ---------- */
@media (max-width:900px) {
    .topbar .container {
        padding-inline: 16px;
    }
    .input.search {
        min-width: 0;
        width: 160px;
    }
    .card {
        padding: 18px;
    }
    .question.card {
        padding: 20px;
    }
    .q-title {
        font-size: 1.15rem;
    }
}
/* ===== Neues Grid-Layout für Hauptbereich ===== */
.layout-main {
    display: grid;
    grid-template-columns: 340px 1fr 320px;
    grid-template-areas: "sortBar sortBar sortBar""left questions tags";
    gap: 32px;
    padding: 28px 0 80px;
}
/* linker Stack: Ask + Tipps immer untereinander */
#leftCol {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-self: flex-start;
}
/* Sidebar-Karten nicht mit in die Höhe ziehen */
#askSection, #tipsCard, #tagsCard {
    align-self: flex-start;
    max-height: 360px;
    /* kannst du bei Bedarf anpassen (z.B. 320 / 400) */
    overflow: hidden;
    /* falls der Inhalt höher ist, wird gescrollt/versteckt */
}
/* Zuordnung der Bereiche */
#sortBar {
    grid-area: sortBar;
}
#tagsCard {
    grid-area: tags;
}
#questions {
    grid-area: questions;
}
/* Alte .grid und .sidebar brauchst du dann eigentlich nicht mehr für das Layout, schaden aber auch nicht, falls noch CSS dafür drin ist. */
@media (max-width: 1120px) {
    .layout-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sortBar"
            "left"
            "tags"
            "questions";
        gap: 16px;
        padding: 16px 0 60px;
    }

    /* linke Spalte sauber */
    #leftCol {
        gap: 16px;
    }

    /* nichts abschneiden */
    #askSection,
    #tipsCard,
    #tagsCard {
        max-height: none;
        overflow: visible;
    }
}


/* ===== Mobile Optimierung (Smartphones) ===== */
@media (max-width: 720px) {
    /* Layout: alles untereinander */
    .container {
        padding: 0 12px;
    }
    .grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 16px 0 60px;
    }
    /* Reihenfolge mobile: 1. Sortier-Leiste (in .content oben) 2. Frage-Formular + Tipps (Sidebar) 3. Fragen-Liste (Rest von .content) 4. rechte Sidebar */
    .content {
        order: 1;
    }
    .sidebar {
        order: 2;
    }
    .sidebar.right {
        order: 4;
    }
    /* TOPBAR kompakter */
    .topbar .container {
        padding-inline: 12px;
        flex-direction: column;
        gap: 6px;
    }
    .brand-text {
        font-size: 0.95rem;
    }
    .logo-img {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }
    .userbox {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    #whoAmI {
        font-size: 0.78rem;
        padding: 4px 10px 4px 30px;
    }
    #whoAmI::before {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        left: 6px;
    }
    /* Suche vollbreit unter Marke */
    .search-wrap {
        width: 100%;
        margin-top: 4px;
    }
    .input.search {
        width: 100%;
        min-width: 0;
    }
    /* Karten kompakter */
    .card {
        padding: 14px;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }
    .question.card {
        padding: 16px;
    }
    .q-title {
        font-size: 1.05rem;
    }
    .q-body {
        font-size: 0.9rem;
    }
    .answer-body {
        font-size: 0.85rem;
    }
    /* Sortier-Leiste mobile: NICHT sticky, kompakter */
    #sortBar {
        position: static !important;
        top: auto !important;
        margin-bottom: 10px;
        padding: 8px 10px;
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
    }
    #sortBar .card-title {
        font-size: 0.95rem;
    }
    .sortbar-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .sort-controls {
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }
    .sort-select-fixed {
        width: 160px;
        font-size: 0.82rem;
        padding: 6px 10px;
    }
    /* Frage stellen-Box: direkt unter Sortieren, schön luftiger & für Touch optimiert */
    #askSection {
        position: static !important;
        top: auto !important;
        margin-top: 4px !important;
    }
    #askSection .card-title {
        font-size: 1.05rem;
        margin-bottom: 10px;
    }
    #askSection .input {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }
    #askSection button {
        width: 100%;
        margin-top: 6px;
    }
    .sidebar .card {
        margin-bottom: 8px;
    }
    /* Footer unter jeder Frage */
    .q-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .q-footer .answer-form {
        width: 100%;
    }
    .q-footer-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
        gap: 8px;
    }
    .answer-form .input, .answer-form .answer-input {
        font-size: 0.9rem;
    }
    /* Nach oben Button etwas kleiner */
    #toTopBtn {
        right: 10px;
        bottom: 10px;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}
#askSection.is-collapsed {
    max-height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
body {
    position: relative;
}
.toggle-active {
    opacity: 1;
    transform: none;
    filter: none;
}
/* Ask-Section einklappen, aber im Layout behalten */
#askSection.is-collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
/* =============================== SORTBAR – SIMPLE & CLEAN (FINAL) =============================== */
#sortBar {
    position: static;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 14px 18px;
    border-radius: 14px;
}
/* keine Deko-Leiste, kein Blur */
#sortBar::after {
    display: none;
}
/* Zeile */
.sortbar-row {
    align-items: center;
    gap: 14px;
}
/* Titel ruhig */
#sortBar .card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}
/* Controls */
.sort-controls {
    gap: 10px;
}
/* Label klein & dezent */
.sort-controls label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
/* Select schlicht */
.sort-select-fixed {
    width: 180px;
    height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}
/* Buttons wie Text-Tabs */
#sortBar .btn.ghost.small {
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 0.85rem;
    color: #475569;
}
/* Hover nur leicht */
#sortBar .btn.ghost.small:hover {
    background: #f1f5f9;
    border-radius: 8px;
}
/* Aktiv – sehr dezent */
#sortBar .btn.toggle-active {
    background: #e0e7ff;
    color: #1d4ed8;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: none;
}
#tipsCard {
    max-height: none;
    /* kein Abschneiden */
    overflow: visible;
}
/* Liste sauberer */
#tipsCard .tips {
    margin: 10px 0 0;
    padding-left: 18px;
}
#tipsCard .tips li {
    margin-bottom: 8px;
    line-height: 1.5;
}
#tipsCard .tips li:last-child {
    margin-bottom: 0;
}
/* Veröffentlichungs-Button absichern */
#askSection form {
    display: flex;
    flex-direction: column;
}
#askSection button[type="submit"], #askSection .submit-btn {
    margin-top: 16px;
    position: relative;
    z-index: 2;
}
/* nichts abschneiden */
#askSection {
    overflow: visible !important;
    max-height: none !important;
}
/* linke Spalte sauber untereinander */
#leftCol {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
/* Tipps nicht mehr "rumfliegen" */
#tipsCard {
    position: static !important;
    max-height: none;
}
#tipsCard {
    border: 1px dashed var(--line);
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}
/* Badge neben "Unbeantwortet" */
.count-badge {
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  background: #e5e7eb;
  color: #1f2937;
}

/* Badge wenn Button aktiv (blau) */
.btn.toggle-active .count-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
/* Aktiver Filter-Button (Meine Fragen / Unbeantwortet) */
.btn.toggle-active {
  background: linear-gradient(135deg, var(--accent), #22c55e);
  border-color: var(--accent);
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

/* Badge bleibt lesbar */
.btn.toggle-active .count-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
/* FIX: Aktiver Zustand in der SortBar MUSS die "ghost"-Regel überstimmen */
#sortBar .btn.ghost.small.toggle-active {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

/* Optional: Hover für aktive Buttons */
#sortBar .btn.ghost.small.toggle-active:hover {
  filter: brightness(1.03);
}
#sortBar .btn.ghost.small.toggle-active .count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
/* ===== GRID-ZUORDNUNG FINAL FIX ===== */

/* Desktop Grid */
.layout-main {
  display: grid;
  grid-template-columns: 340px 1fr 320px;
  grid-template-areas:
    "sortBar sortBar sortBar"
    "left questions tags";
}

#leftCol   { grid-area: left; }
#questions { grid-area: questions; }
#tagsCard  { grid-area: tags; }


/* Sicherheit: nichts floatet oder rutscht */
#leftCol,
#questions,
#tagsCard {
  align-self: flex-start;
}
/* ===== FIX: Seitenbreite begrenzen ===== */
.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}
/* ===== FIX: Fragen-Spalte nicht zu breit ===== */
#questions {
  max-width: 760px;
  width: 100%;
}
#questions {
  margin-left: auto;
  margin-right: auto;
}
/* ================= MOBILE FIX – Layout reset ================= */
@media (max-width: 900px) {

  .layout-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 16px 0 60px !important;
  }

  #sortBar {
    order: 1;
  }

  /* Frage stellen + Tipps */
  #leftCol {
    order: 2;
  }

  /* ⭐ Beliebte Tags DIREKT nach Tipps */
  #tagsCard {
    order: 3;
  }

  /* Fragenliste danach */
  #questions {
    order: 4;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

/* ================= MOBILE FIX – Layout reset ================= */
@media (max-width: 900px) {

  /* Grid komplett ausschalten */
  .layout-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 16px 0 60px !important;
  }

  /* Reihenfolge festlegen */
  #sortBar {
    order: 1;
  }

  #leftCol {
    order: 2;
  }

  #questions {
    order: 3;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #tagsCard {
    order: 4;
  }

  /* Karten volle Breite */
  .card,
  .question.card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}
