:root {
    --brand-950: #06231d;
    --brand-900: #063a2b;
    --brand-700: #0b7a4d;
    --brand-600: #12905d;
    --brand-100: #e5f4ed;
    --ink: #18312a;
    --muted: #6b7f78;
    --line: #dfe8e4;
    --surface: #ffffff;
    --canvas: #f4f7f6;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --success: #087443;
    --success-bg: #e8f7ef;
    --info-bg: #edf7ff;
    --shadow: 0 18px 45px rgba(18, 52, 42, .08);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(20, 157, 98, .22), transparent 30%),
        linear-gradient(135deg, var(--brand-950), var(--brand-900) 52%, var(--brand-700));
}
.auth-shell { width: 100%; max-width: 480px; }
.auth-panel { background: rgba(255,255,255,.98); border-radius: 30px; padding: 38px; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.auth-panel h1 { margin: 6px 0 10px; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.04; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--brand-900), var(--brand-600)); color: white; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 12px 28px rgba(6,58,43,.24); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 14px; font-size: .9rem; }

.eyebrow { margin: 0 0 6px; color: var(--brand-700); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }
.eyebrow.light { color: rgba(255,255,255,.7); }
.muted { color: var(--muted); line-height: 1.65; }
.text-link { display: inline-block; margin-top: 20px; color: var(--brand-700); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.stack-lg { display: grid; gap: 18px; margin-top: 26px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: .9rem; font-weight: 750; }
.field small { color: var(--muted); }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 14px; padding: 13px 14px; outline: none; transition: .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(18,144,93,.12); }
input[readonly] { background: #f4f7f6; color: var(--muted); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.button.primary { background: var(--brand-700); color: #fff; box-shadow: 0 10px 20px rgba(11,122,77,.2); }
.button.primary:hover { background: var(--brand-900); }
.button.secondary { background: var(--brand-100); color: var(--brand-900); }
.button.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.button.light { background: #fff; color: var(--brand-900); }
.button.danger { background: var(--danger-bg); color: var(--danger); }
.button.full { width: 100%; }
.small-button { padding: 9px 13px; font-size: .84rem; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; background: var(--brand-100); color: var(--brand-900); }
.icon-button.danger { background: var(--danger-bg); color: var(--danger); }
.icon-button.delete-icon { font-size: 1rem; }

.alert { margin: 0 0 18px; border-radius: 16px; padding: 14px 16px; line-height: 1.5; }
.alert p { margin: 8px 0 0; }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.info { background: var(--info-bg); color: #0a5d86; }

.app-shell { display: grid; grid-template-columns: 270px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 18px; background: linear-gradient(180deg, var(--brand-950), var(--brand-900)); color: #fff; display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 5px 8px 24px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: rgba(255,255,255,.65); font-size: .84rem; margin-top: 2px; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 12px 13px; color: rgba(255,255,255,.76); text-decoration: none; font-weight: 700; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); }
.sidebar-footer { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-footer span, .sidebar-footer small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer small { margin-top: 3px; color: rgba(255,255,255,.58); }
.sidebar-backdrop { display: none; }

.app-main { min-width: 0; }
.topbar { min-height: 78px; padding: 16px 28px; background: rgba(255,255,255,.9); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.topbar p { margin-bottom: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.content-wrap { padding: 30px; max-width: 1500px; margin: 0 auto; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.04em; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.hero-card { min-height: 250px; padding: 34px; border-radius: var(--radius-xl); background: linear-gradient(135deg, var(--brand-950), var(--brand-900) 48%, var(--brand-700)); color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; box-shadow: var(--shadow); }
.hero-card h1 { margin: 6px 0 12px; max-width: 760px; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.055em; }
.hero-card p:not(.eyebrow) { max-width: 760px; margin: 0; color: rgba(255,255,255,.72); line-height: 1.7; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 10px 0 2px; font-size: 2.2rem; letter-spacing: -.04em; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-two.aligned-start { align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow); }
.sticky-card { position: sticky; top: 100px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.card-header h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.025em; }
.feature-list, .activity-list { display: grid; gap: 12px; }
.feature-list > div { padding: 15px; border: 1px solid var(--line); border-radius: 16px; }
.feature-list strong, .feature-list span { display: block; }
.feature-list span { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.activity-item { display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 12px; align-items: start; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-600); margin-top: 5px; box-shadow: 0 0 0 5px var(--brand-100); }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { text-transform: capitalize; }
.activity-item small { margin-top: 3px; color: var(--muted); }
.empty-state { color: var(--muted); padding: 24px 0; text-align: center; }

.role-badge, .status-badge, .count-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; font-size: .78rem; font-weight: 800; }
.role-badge { background: var(--brand-100); color: var(--brand-900); }
.count-badge { background: var(--brand-950); color: #fff; min-width: 34px; justify-content: center; }
.status-badge { background: #edf1ef; color: #51665f; }
.status-badge.aktiv, .status-badge.angenommen { background: var(--success-bg); color: var(--success); }
.status-badge.offen, .status-badge.planned { background: #fff6db; color: #8a6200; }
.status-badge.widerrufen, .status-badge.abgelaufen, .status-badge.deaktiviert, .status-badge.gesperrt { background: var(--danger-bg); color: var(--danger); }

.copy-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.actions-cell { text-align: right; }
.actions-cell form { display: inline-block; }
code { background: #f0f4f2; padding: 4px 7px; border-radius: 8px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.pagination a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; background: #f1f5f3; }
.pagination a.active { background: var(--brand-700); color: #fff; }

@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid-two { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(2,20,15,.48); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .menu-button { display: grid; place-items: center; }
    .content-wrap { padding: 20px; }
    .topbar { padding: 13px 18px; }
    .topbar-actions .role-badge { display: none; }
    .hero-card { align-items: flex-start; flex-direction: column; min-height: auto; padding: 26px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .auth-body { padding: 12px; }
    .auth-panel { padding: 26px 20px; border-radius: 24px; }
    .stats-grid { grid-template-columns: 1fr; }
    .content-wrap { padding: 14px; }
    .card { padding: 18px; border-radius: 20px; }
    .copy-row { grid-template-columns: 1fr; }
    .topbar strong { font-size: .9rem; }
    .topbar .eyebrow { display: none; }
    .topbar-actions .button { padding: 9px 11px; }
}

/* Phase 2: Beiträge */
.compact-hero { min-height: 230px; }
.compact-hero h1 { max-width: 900px; font-size: clamp(2rem, 4.5vw, 3.6rem); }
.filter-card { margin: 18px 0 28px; }
.filter-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(145px, .75fr)) auto; gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 1px; }
.filter-grid .field > span { font-size: .78rem; }
.filter-grid input, .filter-grid select { padding: 11px 12px; }
.post-section { margin-top: 30px; }
.done-section { margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.3rem); letter-spacing: -.035em; }
.post-list { display: grid; gap: 14px; }
.post-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); background: #fff; border: 1px solid var(--line); border-left: 5px solid #cbd8d3; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 22px 55px rgba(18,52,42,.12); }
.post-card.priority-dringend { border-left-color: #b42318; }
.post-card.priority-hoch { border-left-color: #d97706; }
.post-card.priority-normal { border-left-color: var(--brand-600); }
.post-card.priority-niedrig { border-left-color: #8da49b; }
.post-card-link { position: absolute; inset: 0; z-index: 1; }
.post-thumbnail { width: 176px; min-height: 150px; background: #eaf0ed; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-content { min-width: 0; padding: 20px 22px; }
.post-card h3 { margin: 11px 0 8px; font-size: 1.28rem; letter-spacing: -.025em; }
.post-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.post-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.type-badge, .priority-badge, .post-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: .72rem; font-weight: 850; }
.type-badge { background: #edf2f0; color: #3f5a50; }
.type-fehler { background: #fff0ee; color: #a52a20; }
.type-funktionswunsch { background: #e8f7ef; color: #087443; }
.type-verbesserung { background: #edf7ff; color: #0a5d86; }
.priority-badge { background: #f3f4f4; color: #5d6f68; }
.priority-badge.priority-dringend { background: #fff0ee; color: #b42318; }
.priority-badge.priority-hoch { background: #fff4df; color: #9a5d00; }
.priority-badge.priority-normal { background: var(--brand-100); color: var(--brand-900); }
.priority-badge.priority-niedrig { background: #edf1ef; color: #667a72; }
.post-status { margin-left: auto; background: #fff6db; color: #8a6200; }
.status-in_bearbeitung { background: #edf7ff; color: #0a5d86; }
.status-erledigt { background: var(--success-bg); color: var(--success); }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 15px; color: var(--muted); font-size: .82rem; }
.empty-panel { display: grid; gap: 5px; padding: 35px; text-align: center; background: #fff; border: 1px dashed #cddbd5; border-radius: 22px; }
.empty-panel span { color: var(--muted); }

.form-card { min-height: 600px; }
.form-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.rich-editor-wrap { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; transition: .18s ease; }
.rich-editor-wrap:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(18,144,93,.12); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #f7f9f8; }
.editor-toolbar button { min-width: 36px; height: 34px; padding: 0 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); }
.editor-toolbar button:hover { background: #fff; border-color: var(--line); }
.rich-editor { min-height: 320px; padding: 18px; outline: none; line-height: 1.7; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #91a19b; pointer-events: none; }
.rich-editor p:first-child { margin-top: 0; }
.rich-editor p:last-child { margin-bottom: 0; }
.upload-zone { min-height: 220px; border: 2px dashed #bfd1c9; border-radius: 20px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; background: #f8fbf9; transition: .18s ease; cursor: pointer; }
.upload-zone:hover, .upload-zone.drag-active { border-color: var(--brand-600); background: var(--brand-100); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone small { color: var(--muted); }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: #fff; color: var(--brand-700); font-size: 1.8rem; box-shadow: var(--shadow); }
.compact-upload { min-height: 155px; margin-top: 16px; }
.image-preview-grid, .existing-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.image-preview-item, .existing-image-item { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.image-preview-item img, .existing-image-item img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.image-preview-item span, .existing-image-item > span { display: block; padding: 8px 10px; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-image-item input { width: auto; margin-right: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.vertical-actions { flex-direction: column; }
.alert-list { margin: 8px 0 0; padding-left: 20px; }

.detail-breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; color: var(--muted); font-size: .88rem; }
.detail-breadcrumb a { color: var(--brand-700); font-weight: 750; text-decoration: none; }
.post-detail-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 30px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--brand-600); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.post-detail-header.priority-dringend { border-top-color: #b42318; }
.post-detail-header.priority-hoch { border-top-color: #d97706; }
.post-detail-header.priority-niedrig { border-top-color: #8da49b; }
.post-detail-header h1 { margin: 13px 0 8px; max-width: 1000px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; }
.detail-meta { margin-top: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions form { margin: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.detail-content, .detail-sidebar { display: grid; gap: 18px; min-width: 0; }
.content-card { padding: clamp(22px, 4vw, 40px); }
.rich-content { font-size: 1.03rem; line-height: 1.8; overflow-wrap: anywhere; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content a { color: var(--brand-700); font-weight: 700; }
.rich-content blockquote { margin: 20px 0; padding: 14px 18px; border-left: 4px solid var(--brand-600); background: #f5f8f7; border-radius: 0 14px 14px 0; }
.detail-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.detail-image-button { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; }
.detail-image-button img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; transition: transform .2s ease; }
.detail-image-button:hover img { transform: scale(1.025); }
.detail-image-button span { display: block; padding: 10px 12px; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-list { display: grid; gap: 14px; }
.comment-item { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.avatar-circle { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-100); color: var(--brand-900); font-weight: 850; }
.comment-header { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.comment-header time { margin-left: auto; color: var(--muted); font-size: .78rem; }
.comment-body p { margin: 8px 0 0; line-height: 1.65; }
.comment-form { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.comment-form .button { margin-top: 12px; }
.status-control-card { top: 98px; }
.resolution-note { margin: 16px 0 0; padding: 12px; border-radius: 13px; background: var(--success-bg); color: var(--success); font-size: .84rem; line-height: 1.5; }
.history-list { display: grid; gap: 14px; }
.history-item { display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 10px; }
.history-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
.history-item strong, .history-item small { display: block; }
.history-item strong { font-size: .9rem; text-transform: capitalize; }
.history-item small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.lightbox { position: fixed; inset: 0; z-index: 100; padding: 38px; display: grid; place-items: center; background: rgba(2,20,15,.9); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 96vw); max-height: 90vh; object-fit: contain; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.lightbox-close { position: fixed; top: 18px; right: 22px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #fff; color: var(--brand-950); font-size: 2rem; }
.lightbox-open { overflow: hidden; }

@media (max-width: 1250px) {
    .filter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .filter-actions { grid-column: span 3; }
}

@media (max-width: 1080px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .detail-sidebar .sticky-card { position: static; }
}

@media (max-width: 760px) {
    .post-card { grid-template-columns: 1fr; }
    .post-thumbnail { width: 100%; height: 180px; }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .filter-search, .filter-actions { grid-column: 1 / -1; }
    .post-detail-header { align-items: flex-start; flex-direction: column; padding: 22px; }
    .detail-sidebar { grid-template-columns: 1fr; }
    .detail-image-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .filter-grid, .form-grid-two { grid-template-columns: 1fr; }
    .filter-search, .filter-actions { grid-column: auto; }
    .filter-actions { flex-direction: column; align-items: stretch; }
    .post-card-content { padding: 17px; }
    .post-status { margin-left: 0; }
    .detail-actions { width: 100%; }
    .detail-actions .button, .detail-actions form, .detail-actions form .button { width: 100%; }
    .image-preview-grid, .existing-image-grid { grid-template-columns: 1fr; }
    .comment-header time { width: 100%; margin-left: 0; }
    .topbar-new-button { display: none; }
    .lightbox { padding: 16px; }
}

/* Phase 3: Benachrichtigungen, Stimmen und Planung */
.button.soft { background: var(--brand-100); color: var(--brand-900); }
.notification-bell { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--brand-900); text-decoration: none; font-size: 1.35rem; }
.notification-bell:hover { background: var(--brand-100); }
.notification-bell b { position: absolute; top: -6px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: #b42318; color: #fff; font-size: .66rem; line-height: 1; }
.notification-bell.has-unread { border-color: #b8d8c9; box-shadow: 0 0 0 4px rgba(18,144,93,.08); }
.page-heading-actions { align-items: flex-end; }
.tabs-row { display: flex; gap: 8px; margin-bottom: 14px; }
.tab-link { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); text-decoration: none; font-weight: 800; }
.tab-link.active { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.tab-link span { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.18); font-size: .72rem; }
.notification-card-list { padding: 0; overflow: hidden; }
.notification-row { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.notification-row:last-child { border-bottom: 0; }
.notification-row.unread { background: linear-gradient(90deg, var(--brand-100), #fff 46%); }
.notification-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #f1f5f3; color: var(--brand-800, var(--brand-900)); font-weight: 900; }
.notification-row.unread .notification-symbol { background: var(--brand-700); color: #fff; }
.notification-main { min-width: 0; display: grid; gap: 4px; text-decoration: none; }
.notification-main > span:not(.notification-title-line), .notification-main small { color: var(--muted); }
.notification-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notification-title-line i { border-radius: 999px; padding: 3px 7px; background: var(--brand-700); color: #fff; font-size: .64rem; font-style: normal; text-transform: uppercase; letter-spacing: .08em; }
.notification-main small { font-size: .76rem; }
.notification-read-form { margin: 0; }
.profile-notification-card { margin-top: 18px; }
.card-intro { margin: -4px 0 18px; color: var(--muted); line-height: 1.6; }
.settings-check-list { display: grid; gap: 10px; }
.setting-check { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfc; cursor: pointer; }
.setting-check:hover { border-color: #bad5c9; background: #f6faf8; }
.setting-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-700); }
.setting-check strong, .setting-check small { display: block; }
.setting-check small { margin-top: 3px; color: var(--muted); line-height: 1.45; }
.settings-check-list .button { justify-self: start; margin-top: 6px; }
.planning-card { margin-top: 0; }
.detail-actions .button { min-height: 42px; }

@media (max-width: 680px) {
    .notification-row { grid-template-columns: 40px minmax(0,1fr); padding: 15px; }
    .notification-read-form { grid-column: 2; }
    .notification-read-form .icon-button { width: auto; height: 34px; padding: 0 12px; border-radius: 999px; }
    .page-heading-actions form, .page-heading-actions .button { width: 100%; }
    .tabs-row { overflow-x: auto; padding-bottom: 3px; }
}

/* Phase 4: E-Mail-Einstellungen und SMTP-Diagnose */
.mail-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.mail-status-card { min-height: 104px; display: flex; align-items: center; gap: 14px; padding: 19px 21px; }
.mail-status-card small, .mail-status-card strong { display: block; }
.mail-status-card small { color: var(--muted); margin-bottom: 4px; }
.mail-status-card strong { font-size: .96rem; }
.mail-status-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: #eef3f1; color: #8ca098; }
.mail-status-icon.ok { background: var(--success-bg); color: var(--success); }
.mail-status-icon.warning { background: #fff4df; color: #b25d00; }
.mail-status-icon.muted { background: #eff2f1; color: #82938c; }
.mail-settings-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(310px, .38fr); gap: 18px; align-items: start; }
.mail-settings-main { min-width: 0; display: grid; gap: 18px; }
.mail-settings-side { min-width: 0; }
.mail-auth-grid { margin-top: 16px; }
.field-wide { grid-column: 1 / -1; }
.compact-check { margin-top: 16px; }
.danger-check { border-color: #efc5c1; background: #fff9f8; }
.danger-check:hover { border-color: #dc9e98; background: #fff5f3; }
.switch-control { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control > span { position: relative; width: 48px; height: 27px; border-radius: 999px; background: #cad5d1; transition: .18s ease; }
.switch-control > span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .18s ease; }
.switch-control input:checked + span { background: var(--brand-700); }
.switch-control input:checked + span::after { transform: translateX(21px); }
.switch-control b { font-size: .84rem; }
.mail-test-card { top: 98px; }
.mail-test-summary { display: grid; gap: 10px; margin: 16px 0; }
.mail-test-summary span { padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbfa; }
.mail-test-summary small, .mail-test-summary strong { display: block; }
.mail-test-summary small { color: var(--muted); font-size: .72rem; margin-bottom: 3px; }
.mail-test-summary strong { overflow-wrap: anywhere; }
.mail-test-divider { height: 1px; margin: 18px 0; background: var(--line); }
.full-button { width: 100%; justify-content: center; }
.form-help { margin: 12px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.mail-test-alert p { margin-bottom: 0; }
.mail-debug-details { margin-top: 14px; border-top: 1px solid rgba(0,0,0,.1); padding-top: 12px; }
.mail-debug-details summary { cursor: pointer; font-weight: 800; }
.mail-debug-details pre { max-height: 360px; overflow: auto; margin: 12px 0 0; padding: 14px; border-radius: 12px; background: #10201b; color: #d9eee5; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; line-height: 1.5; }

@media (max-width: 1050px) {
    .mail-settings-layout { grid-template-columns: 1fr; }
    .mail-test-card { position: static; }
}
@media (max-width: 760px) {
    .mail-status-grid { grid-template-columns: 1fr; }
    .mail-settings-layout .card-header { align-items: flex-start; flex-direction: column; }
}
.mail-secondary-save { margin-top: 9px; }
