/* =====================================================
   White-Label Post-Generator - Stylesheet
   Farben:  primary #5b3a8a, surface #f5efe6, accent #e85a4f
   Fonts:   Inter (Body), Bricolage Grotesque (Display)
   ===================================================== */

:root {
    --primary: #92c312;
    --primary-dark: #7aa00f;
    --primary-light: #eef7d4;
    --accent: #2d4a00;
    --surface: #f6f8ec;
    --bg: #fcfdf7;
    --text: #1a1f10;
    --muted: #6a715c;
    --border: #e2e7d1;
    --success: #2f8a52;
    --warning: #c97a18;
    --danger: #c0392b;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(20, 14, 40, .06);
    --shadow-md: 0 4px 18px rgba(20, 14, 40, .07);
    --max-w: 1100px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-mark {
    font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.15;
}

h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .875rem; }
.danger { color: var(--danger); }
.warn { color: var(--warning); }

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.1rem;
    border-radius: var(--radius);
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform .1s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .8rem; font-size: .875rem; }
.btn-link { background: transparent; color: var(--primary); border: 0; padding: .25rem .5rem; cursor: pointer; font: inherit; }
.btn-link.danger { color: var(--danger); }
.btn-link:hover { text-decoration: underline; }

.btn-icon {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .35rem .7rem;
    border-radius: 6px;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex; gap: .3rem; align-items: center;
}
.btn-icon:hover { background: white; }

.ms-auto { margin-left: auto; }

/* ---- Landing Nav ---- */

.landing-nav {
    border-bottom: 1px solid var(--border);
    background: white;
    padding: .9rem 1rem;
}
.landing-nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.landing-nav nav { display: flex; gap: 1.5rem; align-items: center; }
.landing-nav nav .nav-parent-link {
    font-size: 0.85rem;
    color: var(--muted);
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}
.landing-nav nav .nav-parent-link:hover { color: var(--primary); }
@media (max-width: 720px) {
    .landing-nav nav a:not(.btn) { display: none; }
    .landing-nav nav { gap: 0; }
}
.brand-mark { font-size: 1.4rem; color: var(--text); }
.brand-mark::after { content: ""; }

/* ---- Landing ---- */

.landing { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    color: var(--text);
}
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 600px; margin: 0 auto 2.5rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; align-items: center; flex-wrap: wrap; }

.features { padding: 4rem 0; }
.features h2 { text-align: center; margin-bottom: 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.feature {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.feature-num {
    width: 36px; height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}

.pricing { padding: 4rem 0 5rem; }
.pricing h2 { text-align: center; margin-bottom: .5rem; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0 1.5rem;
}
.price-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.price-card.featured { border: 2px solid var(--primary); transform: scale(1.03); }
.price-card h3 { color: var(--primary); }
.price { font-size: 2rem; margin: 1rem 0 .25rem; }
.price-meta { color: var(--muted); margin: 0 0 1.5rem; }
.price-card ul { list-style: none; padding: 0; text-align: left; margin: 0 0 1.5rem; }
.price-card ul li { padding: .35rem 0; border-bottom: 1px dotted var(--border); }
.price-card ul li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* ---- Auth ---- */

.auth-shell {
    min-height: calc(100vh - 80px);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    max-width: 400px;
    width: 100%;
}
.auth-brand { font-size: 1.6rem; color: var(--text); margin: 0 0 2rem; text-align: center; }
.auth-brand::after { content: ""; }
.auth-brand-link { color: inherit; text-decoration: none; display: inline-block; }
.auth-brand-link:hover { text-decoration: none; opacity: .85; }
.admin-tag { background: var(--text); color: white; font-size: .65em; padding: .2em .6em; border-radius: 4px; vertical-align: middle; font-weight: 500; letter-spacing: .03em; }
.quick-date { background: var(--surface); border: 1px solid var(--border); padding: .15rem .5rem; margin-left: .25rem; border-radius: 4px; font-size: .8rem; cursor: pointer; font-family: inherit; }
.quick-date:hover { background: var(--primary-light); border-color: var(--primary); }
.auth-tagline { text-align: center; color: var(--muted); margin: 0 0 2rem; font-size: .95rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label { display: flex; flex-direction: column; gap: .35rem; }
.auth-form label > span { font-size: .85rem; font-weight: 600; color: var(--text); }
.auth-form input,
.auth-form select,
.auth-form textarea {
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: white;
}
.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.auth-foot { text-align: center; margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; }

/* ---- App Header ---- */

/* ===== App-Layout mit linker Seitenleiste ===== */
:root { --sidebar-w: 232px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: .6rem; }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.landing-nav .brand-mark::before, .app-sidebar .brand-mark::before, .app-mobilebar .brand-mark::before, .auth-brand::before {
    content: "";
    display: inline-block;
    width: 28px; height: 28px;
    background: url("icon.png") center/contain no-repeat;
    border-radius: 6px;
    vertical-align: -7px;
    margin-right: .5rem;
}
.auth-brand::before { width: 40px; height: 40px; vertical-align: -10px; }

.app-shell { min-height: 100vh; }
.app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 1rem .75rem; z-index: 50;
}
/* Logo oben, dann Abstand + Trennlinie (wie unten vor dem Meta-Block) vor dem ersten Menuepunkt */
.sidebar-brand { padding: .4rem .6rem 1rem; font-size: 1.1rem; margin-bottom: .6rem; border-bottom: 1px solid var(--border); }
.side-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; padding-top: .3rem; }
/* Markenprofil ganz nach unten schieben (bleibt oberhalb der unteren Trennlinie/.side-meta) */
.side-nav-bottom { margin-top: auto; }
.side-nav a {
    display: flex; align-items: center; gap: .7rem;
    color: var(--text); font-weight: 500; font-size: .92rem;
    padding: .6rem .7rem; border-radius: 9px; text-decoration: none;
    transition: background .15s, color .15s;
}
.side-nav a .material-symbols-outlined { font-size: 1.25rem; color: var(--muted); }
.side-nav a:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.side-nav a:hover .material-symbols-outlined { color: var(--primary-dark); }
.side-nav a.nav-active { background: var(--accent, #2d4a00); color: #fff; }
.side-nav a.nav-active .material-symbols-outlined { color: var(--primary); }

.side-meta { display: flex; flex-direction: column; gap: .5rem; padding-top: .9rem; margin-top: .9rem; border-top: 1px solid var(--border); }
.credits, .license {
    background: var(--surface); padding: .4rem .65rem; border-radius: 6px; font-size: .8rem; color: var(--muted);
}
.credits strong { color: var(--text); }
.credits-low { background: #fdecea; color: var(--danger); }
.license-soon { background: #fff4e0; color: var(--warning); }
.side-logout { display: flex; align-items: center; gap: .5rem; font-size: .85rem; padding: .35rem .2rem; }
.side-logout .material-symbols-outlined { font-size: 1.1rem; }

.app-content { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-content > .app-footer { margin-top: auto; }

/* Mobile-Topbar standardmaessig versteckt (Sidebar ist sichtbar am Desktop) */
.app-mobilebar { display: none; }
.hamburger { display: none; }

@media (max-width: 900px) {
    .app-mobilebar {
        display: flex; align-items: center; justify-content: space-between;
        background: #fff; border-bottom: 1px solid var(--border); padding: .7rem 1rem;
        position: sticky; top: 0; z-index: 60;
    }
    .hamburger {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        background: none; border: none; cursor: pointer; padding: 6px;
    }
    .hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; transition: transform .2s, opacity .2s; }
    .nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .hamburger span:nth-child(2) { opacity: 0; }
    .nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .app-sidebar {
        transform: translateX(-100%); transition: transform .22s ease; width: 260px;
        box-shadow: 0 0 40px rgba(0,0,0,.15); top: 0;
    }
    .sidebar-brand { display: none; }
    .nav-open .app-sidebar { transform: translateX(0); }
    .app-content { margin-left: 0; }
}

/* Admin-Header (horizontaler Balken oben). Die Admin-Seiten nutzen NICHT die
   Kunden-Sidebar aus renderAppHeader(), sondern diesen eigenen Header. Die
   zugehoerigen Klassen .app-header/.main-nav/.user-meta wurden beim Umbau auf
   die globale Sidebar (commit 81c04a4) versehentlich aus dem CSS entfernt und
   sind hier fuer den Admin-Bereich wiederhergestellt. */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .8rem 1rem;
    position: sticky; top: 0; z-index: 50;
}
.app-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex; align-items: center; gap: 2rem;
}
.main-nav { display: flex; gap: .35rem; flex: 1; }
.main-nav a {
    color: var(--text); font-weight: 500;
    padding: .45rem .9rem; border-radius: 7px; text-decoration: none;
    transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.main-nav a.nav-active { background: var(--primary); color: #fff; }
.main-nav a.nav-active:hover { background: var(--primary-dark); color: #fff; }
.user-meta { display: flex; align-items: center; gap: 1rem; font-size: .85rem; color: var(--muted); }

@media (max-width: 720px) {
    .app-header-inner { flex-wrap: wrap; gap: 1rem; }
    .main-nav { flex-wrap: wrap; gap: .25rem; }
}

.admin-header .brand-mark { color: var(--text); }
.admin-header .brand-mark::after { content: ""; }

/* ---- Page Layout ---- */

.page { padding: 2rem 1rem 4rem; }
.page-inner { max-width: var(--max-w); margin: 0 auto; }
.page-inner.narrow { max-width: 720px; }
.page-head { margin-bottom: 2rem; }
.page-head h1 { margin-bottom: .35rem; }

/* ---- Dashboard ---- */

.welcome { margin-bottom: 2rem; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.card-action { text-decoration: none; color: var(--text); display: block; }
.card-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.card-icon svg { width: 26px; height: 26px; }
.card-action:hover .card-icon { background: var(--primary); color: white; }
.card-cta { color: var(--primary); font-weight: 600; font-size: .9rem; margin-top: .75rem; display: inline-block; }
.card-warning { border-left: 3px solid var(--warning); }

.usage-bar {
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}
.usage-bar-small { height: 4px; flex: 1; max-width: 200px; }
.usage-fill { height: 100%; background: var(--primary); transition: width .3s; }

/* Dezente Footer-Leiste mit Kontingent-Info */
.usage-strip { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.usage-strip-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.usage-strip-text { color: var(--text); }
.usage-strip-text strong { color: var(--text); }
.usage-warn-inline { width: 100%; background: #fdecea; padding: .65rem .9rem; border-radius: 6px; margin: .5rem 0 0; font-size: .85rem; color: var(--danger); }

.recent { background: white; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.recent-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.recent-list li { border-top: 1px solid var(--border); }
.recent-list li:first-child { border-top: 0; }
.recent-list a { display: flex; justify-content: space-between; padding: .75rem 0; color: var(--text); }
.recent-list a:hover { text-decoration: none; color: var(--primary); }
.recent-date { color: var(--muted); font-size: .85rem; }

/* ---- Forms ---- */

.brand-form, .generate-form, .admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.admin-form .grid-2, .admin-form .grid-3 { gap: 1.25rem; }
.admin-form .field { gap: .4rem; }
.form-block {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin: 0;
}
.form-block legend {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0 .5rem;
    color: var(--primary);
    margin-bottom: 0;
}
.form-block > legend + .field > .label,
.form-block > legend + .grid-2 .label { margin-top: 0; }
.form-block > legend + .help { margin-top: 0; }

.field { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.field .label { font-weight: 600; font-size: .85rem; color: var(--text); margin-top: 1.5rem; }
.field .label em { color: var(--accent); font-style: normal; }
.admin-form .field > .label, .admin-form label > .label { margin-bottom: .1rem; }
.field input:not([type=checkbox]):not([type=radio]),
.field select,
.field textarea,
.admin-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.admin-form select,
.admin-form textarea {
    padding: .65rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: white;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
    color: var(--text);
}
.field textarea, .admin-form textarea {
    resize: none;
    overflow: hidden;
    min-height: 2.8rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}
.field input:disabled { background: var(--surface); color: var(--muted); }
.field .help { font-size: .8rem; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.style-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.style-option {
    display: flex; gap: .5rem; align-items: center;
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: white;
    transition: border .15s, background .15s;
}
.style-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }

.channel-picker { display: flex; gap: .5rem; flex-wrap: wrap; }
.channel-option {
    display: inline-flex; gap: .5rem; align-items: center;
    padding: .5rem .9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    background: white;
    user-select: none;
}
.channel-option:has(input:checked) { background: var(--primary); color: white; border-color: var(--primary); }
.channel-option input { display: none; }

.save-indicator { font-size: .85rem; color: var(--muted); }
.save-indicator.saved { color: var(--success); }
.save-indicator.saving { color: var(--muted); }
.save-indicator.error { color: var(--danger); }

/* ---- Generate ---- */

.generate-cta { display: flex; flex-direction: column; gap: .5rem; align-items: center; padding: 1rem 0; }
.generate-cost { color: var(--muted); font-size: .9rem; }

.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 14, 40, .8);
    z-index: 1000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white;
}
.loading-overlay[hidden] { display: none !important; }
.loading-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}
.loading-text { text-align: center; font-size: 1.1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Posts ---- */

.post-list { display: flex; flex-direction: column; gap: 1.25rem; }
.gen-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.gen-card.gen-open { border-color: var(--primary); }
.gen-head {
    display: flex; gap: 1rem; padding: 1.25rem 1.5rem;
    background: var(--primary-light);
    align-items: flex-start;
}
.gen-meta { flex: 1; }
.gen-date { color: var(--muted); font-size: .85rem; }
.gen-title { font-size: 1.15rem; margin: .15rem 0 0; }
.gen-title a { color: var(--text); }
.gen-thumb {
    flex-shrink: 0;
    width: 96px; height: 96px;
    border-radius: var(--radius);
    overflow: hidden;
}
.gen-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gen-brief {
    padding: 1rem 1.5rem;
    background: var(--surface);
    font-size: .95rem;
    border-bottom: 1px solid var(--border);
}

.channel-list { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.channel-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: white;
}
.channel-block-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .75rem;
}
.channel-badge {
    background: #fde7e7;
    color: #b53b3b;
    padding: .25rem .7rem;
    border-radius: 5px;
    font-size: .8rem;
    font-weight: 600;
}
.channel-actions { display: flex; gap: .35rem; }
.post-text {
    width: 100%;
    min-height: 80px;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    resize: none;
    overflow: hidden;
    line-height: 1.5;
    color: var(--text);
}
.post-text:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.channel-block-foot {
    display: flex; justify-content: space-between;
    margin-top: .5rem;
    font-size: .8rem;
    color: var(--muted);
}
.gen-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); text-align: right; }

.empty-state { background: white; padding: 3rem; text-align: center; border-radius: var(--radius-lg); border: 1px dashed var(--border); }

/* ---- Flash ---- */

.flash {
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .95rem;
}
.flash-error { background: #fdecea; color: var(--danger); border: 1px solid #f5b8b0; }
.flash-success { background: #e7f5ec; color: var(--success); border: 1px solid #b8e0c5; }
.flash-info { background: #eef4ff; color: #2c5fa3; border: 1px solid #c5d8f0; }

/* ---- Admin Table ---- */

.filter-bar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.filter-bar a:not(.btn) { color: var(--muted); font-weight: 500; padding: .35rem 0; }
.filter-bar a:not(.btn).active { color: var(--primary); border-bottom: 2px solid var(--primary); }
.filter-bar a:not(.btn):hover { text-decoration: none; }

.admin-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.admin-table th, .admin-table td {
    padding: .85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { background: var(--surface); font-weight: 600; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.admin-table tr:last-child td { border-bottom: 0; }
.status-pill { padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; display: inline-block; line-height: 1.5; }
.status-active { background: #e7f5ec; color: var(--success); }
.status-pending { background: #fff8e1; color: #e6a200; }
.status-suspended { background: #fdecea; color: var(--danger); }
.status-expired { background: var(--surface); color: var(--muted); }
/* Ampel-System: rot / gelb-orange / grün, pastellig */
.status-open    { background: #fde7e7; color: #b53b3b; }
.status-partial { background: #fff2d4; color: #8a5a14; }
.status-done    { background: #e2f0c9; color: #4a7314; }
.status-approved { background: #dbeafe; color: #2563eb; }
/* Idee: gleiche Optik wie im Kalender (pink umrandet, nicht gefuellt). */
.status-idea { background: transparent; color: #a01e63; border: 1px solid #e6398b; }

/* Dashboard Status-Tiles */
.status-overview { background: white; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 2rem; }
.status-overview h3 { margin-bottom: 1rem; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.status-tile {
    display: block;
    padding: 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: transform .1s, border-color .15s;
}
.status-tile:hover { transform: translateY(-2px); text-decoration: none; }
.status-tile .status-num { font-size: 2.25rem; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; line-height: 1; }
.status-tile .status-label { font-weight: 600; margin-top: .25rem; }
.status-tile .status-hint { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.status-tile-open    { background: #fde7e7; border-color: #f3c4c4; }
.status-tile-open:hover    { border-color: #b53b3b; }
.status-tile-open .status-num { color: #b53b3b; }
.status-tile-partial { background: #fff2d4; border-color: #efd89a; }
.status-tile-partial:hover { border-color: #8a5a14; }
.status-tile-partial .status-num { color: #8a5a14; }
.status-tile-done    { background: #e2f0c9; border-color: #c5dba0; }
.status-tile-done:hover    { border-color: #4a7314; }
.status-tile-done .status-num { color: #4a7314; }
.status-tile-approved { background: #dbeafe; border-color: #b5cef8; }
.status-tile-approved:hover { border-color: #1d4ed8; }
.status-tile-approved .status-num { color: #2563eb; }

/* 4er-Grid: alle gleich breit */
.status-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) {
    .status-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .status-grid-4 { grid-template-columns: 1fr; }
}

/* Klickbarer Bereich innerhalb einer div-Kachel */
.status-tile-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.status-tile-link:hover { text-decoration: none; }

/* Freigabe-Link in der Offen-Kachel */
.status-tile .status-link {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(181, 59, 59, 0.2);
    display: flex; gap: .4rem; align-items: center;
}
.status-link-btn {
    flex: 1; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding: .55rem .7rem;
    border: 1px solid #f3c4c4;
    border-radius: 6px;
    background: white;
    color: #b53b3b;
    font: inherit; font-size: .85rem; font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.status-link-btn:hover { background: #b53b3b; color: white; text-decoration: none; }
.status-link-copy {
    background: white;
    border: 1px solid #f3c4c4;
    border-radius: 6px;
    width: 36px; height: 36px;
    cursor: pointer;
    color: #b53b3b;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.status-link-copy:hover { background: #b53b3b; color: white; }
.status-link-copy.copied { background: #15803d; color: white; border-color: #15803d; }
.status-link-copy * { pointer-events: none; }

/* Recent-Liste */
.recent-meta { display: flex; gap: .5rem; align-items: center; }

/* Channel-Veröffentlicht */
.channel-block.channel-published .channel-badge { background: #e2f0c9; color: #4a7314; }

/* Veröffentlicht-Toggle */
.channel-block-head-left { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; }
.pub-toggle { display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; font-size: .8rem; color: var(--muted); user-select: none; }
.pub-toggle:hover { color: var(--text); }
.pub-toggle input { cursor: pointer; accent-color: var(--success); width: 16px; height: 16px; }
.pub-toggle input:checked + .pub-toggle-label { color: var(--success); font-weight: 600; }

/* Inline-Datepicker */
.gen-date { cursor: pointer; padding: .15rem .5rem; border-radius: 5px; transition: background .15s; }
.gen-date:hover { background: var(--surface); }
.inline-date { padding: .15rem .35rem; border: 1px solid var(--primary); border-radius: 4px; font: inherit; font-size: .9rem; }

/* Generation-Header */
.gen-meta-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .25rem; }

/* Gen-Foot mit mehreren Elementen */
.gen-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.gen-foot > form { margin-left: auto; }

.credentials-card {
    background: white;
    padding: 1.5rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    line-height: 2;
    margin-bottom: 1.5rem;
}
.credentials-card code { background: var(--primary-light); padding: .2rem .5rem; border-radius: 4px; }
.cta-row { display: flex; gap: 1rem; align-items: center; }

.danger-zone {
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid #f5b8b0;
    border-radius: var(--radius-lg);
    background: #fdf6f5;
}
.danger-zone h3 { color: var(--danger); margin-top: 0; }

/* ---- Prose ---- */

.prose h2 { margin: 1.5rem 0 .5rem; }
.prose p, .prose ul { color: var(--text); }
.prose ul { padding-left: 1.5rem; }

/* ---- Footer ---- */

.app-footer {
    border-top: 1px solid var(--border);
    background: white;
    padding: 1.25rem 1rem;
    margin-top: 4rem;
}
.app-footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    color: var(--muted);
    font-size: .85rem;
    display: flex; gap: .5rem; flex-wrap: wrap;
}
.app-footer-inner .sep { opacity: .4; }
.app-footer-inner a { color: var(--muted); }
.app-footer-inner a:hover { color: var(--primary); }

/* ===== Editorial Landingpage ===== */

.editorial-section {
    padding: 5rem 1.5rem;
    position: relative;
}
.editorial-narrow {
    max-width: 800px;
    margin: 0 auto;
}
.editorial-wide {
    max-width: 1100px;
    margin: 0 auto;
}

.eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}
.eyebrow-muted { color: var(--muted); }

.editorial-h1 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 5.25vw, 4.125rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin: 0 0 1.25rem;
    color: var(--text);
}
.editorial-h1-sub {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.2;
    color: var(--text);
    font-weight: 700;
}
.editorial-h2 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin: 0 0 1.25rem;
    color: var(--text);
    margin-top: 0;
}
.editorial-lead {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    line-height: 1.6;
    color: var(--text);
    max-width: 580px;
    margin: 0 auto 2.5rem;
}
.editorial-lead-left {
    margin-left: 0;
    margin-right: 0;
    max-width: 540px;
}

.editorial-center { text-align: center; }

.editorial-cta-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}
.editorial-cta-row.left { justify-content: flex-start; }

.btn-editorial {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.1rem 2rem;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-editorial:hover { background: var(--primary-dark); text-decoration: none; color: white; }

.btn-editorial-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--text);
    padding-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}
.btn-editorial-link:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

@media (max-width: 720px) {
    .editorial-section { padding: 3.5rem 1.25rem; }
    .editorial-cta-row { flex-direction: column; align-items: stretch; }
    .editorial-cta-row .btn-editorial { justify-content: center; }
}

/* ===== Editorial Hero ===== */
.ed-hero { padding-top: 3.5rem; }
.ed-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}
.ed-hero-text { text-align: left; }
.ed-hero-text .eyebrow { text-align: left; }
.ed-hero-visual {
    position: relative;
    height: 320px;
    width: 100%;
}
.ed-hero-card {
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(20, 30, 0, 0.08);
    padding: 1.5rem;
    width: 320px;
}
.ed-hero-card:first-child {
    left: 0;
    top: 40px;
    z-index: 3;
    transform: rotate(-2deg);
}
.ed-hero-card-back-1 {
    left: 80px;
    top: 0;
    z-index: 2;
    transform: rotate(3deg);
    opacity: 0.6;
    padding-bottom: 0.5rem;
}
.ed-hero-card-back-2 {
    left: 140px;
    top: -40px;
    z-index: 1;
    transform: rotate(-4deg);
    opacity: 0.35;
    padding-bottom: 0.5rem;
}
.ed-hero-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.ed-hero-card-channel {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
}
.ed-hero-card-dots { display: flex; gap: 4px; }
.ed-hero-card-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }
.ed-hero-card-body p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
}
.ed-hero-card-tags { color: var(--primary-dark); font-size: 0.8rem !important; }

@media (max-width: 900px) {
    .ed-hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .ed-hero-visual { height: 280px; }
}

/* ===== Icon-Box (für Problem, Outcomes etc) ===== */
.ed-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.ed-icon-warn {
    background: white;
    color: #b53b3b;
    border: 1px solid #f3c4c4;
}
.ed-icon-success {
    background: white;
    color: var(--primary-dark);
    border: 1px solid #c5dba0;
}

/* ===== Plan-Head (Nummer + Icon nebeneinander) ===== */
.ed-plan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.ed-plan-icon { color: var(--primary); opacity: 0.6; }

/* ===== Editorial Problem ===== */
.ed-problem-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}
@media (max-width: 720px) {
    .ed-problem-list { grid-template-columns: 1fr; }
}
.ed-problem-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}
.ed-problem-hook {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
    color: var(--text);
}
.ed-problem-text { color: var(--muted); margin: 0; line-height: 1.6; font-size: 1rem; }

/* ===== Editorial Guide ===== */
.ed-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.ed-guide-text { font-size: 1.15rem; line-height: 1.65; color: var(--text); margin: 0; }
.ed-guide-aside {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 1.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.ed-guide-aside a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ed-guide-aside a:hover { text-decoration: none; }
.ed-guide-benefits {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.ed-guide-benefit { }
.ed-guide-benefit-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 0.35rem; color: var(--text); }
.ed-guide-benefit-text { color: var(--muted); margin: 0; line-height: 1.55; font-size: 0.95rem; }

@media (max-width: 900px) {
    .ed-guide { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ===== Editorial Plan (Steps) ===== */
.ed-plan-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}
@media (max-width: 720px) {
    .ed-plan-steps { grid-template-columns: 1fr; }
}
.ed-plan-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ed-plan-num {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.ed-plan-title { font-weight: 700; font-size: 1.25rem; margin: 0; color: var(--text); }
.ed-plan-text { color: var(--muted); margin: 0; line-height: 1.6; font-size: 1rem; }

/* ===== Editorial Showcase ===== */
.ed-showcase-brief { margin: 3rem 0; }
.ed-showcase-brief-label { font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.ed-showcase-brief-box {
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    background: var(--surface);
    font-family: 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
}
.ed-showcase-tabs { display: flex; gap: 0.5rem; margin: 2rem 0 1.25rem; flex-wrap: wrap; }
.ed-showcase-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.6rem 1.1rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ed-showcase-tab:hover { background: var(--primary-light); border-color: #c5dba0; }
.ed-showcase-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.ed-showcase-output {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
}
.ed-showcase-output[hidden] { display: none; }

/* ===== Editorial Erfolg-Vision ===== */
.ed-outcomes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}
@media (max-width: 720px) {
    .ed-outcomes { grid-template-columns: 1fr; }
}
.ed-outcome {
    background: var(--primary-light);
    border: 1px solid #d6e8a8;
    border-radius: 16px;
    padding: 2rem;
}
.ed-outcome-hook {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
    color: var(--text);
}
.ed-outcome-text { color: var(--text); margin: 0; line-height: 1.6; font-size: 1rem; opacity: 0.8; }

/* ===== Editorial Pricing ===== */
.ed-pricing-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin: 3rem 0 2rem;
}
.ed-pricing-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem 1.75rem;
    text-align: center;
    position: relative;
}
.ed-pricing-col.featured {
    background: var(--primary-light);
    border-color: #c5dba0;
}
.ed-pricing-divider { display: none; }
.ed-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}
.ed-pricing-col.featured .ed-pricing-badge { background: var(--primary-dark); }

.ed-hero-microtext {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: left;
}
.ed-final-microtext {
    margin: 1.25rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.ed-final-origin {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}
.ed-final-origin a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.ed-final-origin a:hover { color: var(--primary); text-decoration: none; }
.ed-pricing-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.ed-pricing-liebling {
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.ed-pricing-price {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 1rem 0 0.5rem;
    line-height: 1;
    letter-spacing: -0.02em;
}
.ed-pricing-cap { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.ed-pricing-features {
    list-style: none;
    padding: 1.25rem 0 0;
    margin: 0 0 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-top: 1px solid var(--border);
}
.ed-pricing-features li {
    color: var(--text);
    font-size: 0.9rem;
}
.ed-pricing-col.featured .ed-pricing-features { border-top-color: #c5dba0; }
.ed-pricing-cta {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: border-color 0.15s;
}
.ed-pricing-cta:hover { border-bottom-color: var(--primary); text-decoration: none; }
.ed-pricing-footer {
    text-align: center;
    color: var(--muted);
    max-width: 600px;
    margin: 2rem auto 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .ed-pricing-cols { grid-template-columns: 1fr; gap: 100px; }
}

/* ===== Editorial Failure ===== */
.ed-failure { text-align: center; }
.ed-failure .editorial-h2 { max-width: 720px; margin-left: auto; margin-right: auto; }
.ed-failure-aside {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 640px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.ed-failure-aside a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ed-failure-aside a:hover { text-decoration: none; }

/* ===== Editorial Final-CTA ===== */
.ed-final { text-align: center; }
.ed-final-sub { color: var(--muted); font-size: 1.2rem; margin: 0 0 2.5rem; }

/* ===== Bestellformular ===== */
.order-form { display: flex; flex-direction: column; gap: 2rem; }
.order-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.order-fieldset > legend {
    padding: 0 .5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}
.order-plan-option {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}
.order-plan-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.checkbox-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; }
.checkbox-row input { margin-top: 0.25rem; }

.channel-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.channel-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}
.channel-option:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--text);
}
.channel-option input { cursor: pointer; }

/* Showcase mit Bild (v6) */
.ed-showcase-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 3rem;
    align-items: start;
}
.ed-photo-frame {
    position: relative;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: aspect-ratio 0.35s ease;
}
.ed-photo-frame.ratio-1-1 { aspect-ratio: 1 / 1; }
.ed-photo-frame.ratio-4-5 { aspect-ratio: 4 / 5; }
.ed-photo-frame.ratio-16-9 { aspect-ratio: 16 / 9; }
.ed-photo-frame.ratio-9-16 { aspect-ratio: 9 / 16; }
.ed-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ed-format-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
}
.ed-photo-hint {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}
.ed-channel-col .ed-showcase-tabs { margin-top: 0; }
@media (max-width: 820px) {
    .ed-showcase-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* === Showcase Variante A (Pfeil-Trenner) === */
.va-grid {
    display: grid;
    grid-template-columns: 1fr auto 1.4fr;
    gap: 2rem;
    align-items: stretch;
}
.va-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}
.va-col-label {
    position: absolute;
    top: -10px;
    left: 1.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.va-col-input .va-col-label { color: #c2410c; border-color: #fed7aa; background: #fff7ed; }
.va-col-output .va-col-label { color: var(--primary-dark); border-color: #c5dba0; background: var(--primary-light); }
.va-col-title { font-weight: 700; font-size: 1rem; margin: 0.5rem 0 1rem; }
.va-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--bg);
}
.va-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.va-keywords {
    background: white;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.55;
    flex: 1;
}
.va-keywords-prefix {
    display: inline-block;
    font-family: 'Menlo', 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}
.va-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
}
.va-arrow-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(146, 195, 18, 0.35);
    animation: vaPulse 2.4s ease-in-out infinite;
}
.va-arrow-icon svg { width: 28px; height: 28px; }
.va-arrow-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary-dark);
    text-align: center;
    line-height: 1.3;
}
@keyframes vaPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(146, 195, 18, 0.35); }
    50% { transform: scale(1.05); box-shadow: 0 12px 32px rgba(146, 195, 18, 0.5); }
}
.va-channel-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.va-channel-tab {
    background: white;
    border: 1px solid var(--border);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
}
.va-channel-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.va-output-frame {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.va-output-photo {
    width: 100%;
    background: var(--bg);
    position: relative;
    transition: aspect-ratio 0.35s ease;
}
.va-output-photo.ratio-16-9 { aspect-ratio: 16/9; }
.va-output-photo.ratio-4-5 { aspect-ratio: 4/5; }
.va-output-photo.ratio-1-1 { aspect-ratio: 1/1; }
.va-output-photo.ratio-9-16 { aspect-ratio: 9/16; }
.va-output-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.va-format-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255,255,255,0.95);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.va-output-text {
    padding: 1.25rem 1.4rem 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
@media (max-width: 900px) {
    .va-grid { grid-template-columns: 1fr; }
    .va-arrow { flex-direction: row; padding: 1rem 0; }
    .va-arrow-icon { transform: rotate(90deg); }
}

/* ===== Impersonation (Super-Admin schluepft in Kunden-Account) ===== */
.impersonation-banner {
    background: #fff3cd;
    color: #664d03;
    border-bottom: 2px solid #ffc107;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
}
.impersonation-banner strong { color: #533f03; }
.impersonation-banner .inline-form { display: inline; margin: 0; }
.impersonation-banner button.btn-link {
    color: #664d03;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

/* Posts-Filter-Bar: gleiche Optik wie Admin-Filter */
.post-filter { margin-top: 0; }

/* ---- Monats-Sprungleiste in "Meine Posts" ---- */
.month-jump { margin: 0 0 1.75rem; }
.month-jump-yearbar { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: .55rem; }
.month-jump-year { font-weight: 700; font-size: 1rem; min-width: 3.2rem; text-align: center; }
.month-jump-arrow {
    border: 1px solid var(--border); background: #fff; color: var(--text);
    width: 1.7rem; height: 1.7rem; border-radius: 8px; cursor: pointer; line-height: 1;
    font-size: 1.1rem; display: inline-grid; place-items: center; padding: 0;
}
.month-jump-arrow:hover:not(:disabled) { border-color: var(--primary-dark); color: var(--primary-dark); }
.month-jump-arrow:disabled { opacity: .35; cursor: default; }
.month-jump-pills { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.mj-pill {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
    letter-spacing: .02em; border: 1px solid var(--border); text-decoration: none;
}
.mj-pill.has-posts { color: var(--primary-dark); background: var(--primary-light); border-color: transparent; cursor: pointer; }
.mj-pill.has-posts:hover { background: var(--primary); color: var(--accent); text-decoration: none; }
.mj-pill.empty { color: var(--muted); background: transparent; opacity: .5; cursor: default; }
.mj-pill-count {
    background: rgba(0,0,0,.12); color: inherit; border-radius: 999px;
    padding: 0 .35rem; font-size: .68rem; min-width: 1.1rem; text-align: center;
}

/* Monats-Trenner zwischen den Post-Gruppen */
.month-divider {
    display: flex; align-items: center; gap: .8rem;
    margin: .4rem 0 -.2rem; scroll-margin-top: 90px;
}
.month-divider::before, .month-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.month-divider-label {
    font-weight: 700; font-size: .9rem; color: var(--text);
    text-transform: none; white-space: nowrap;
}

/* Admin-Liste: Aktion-Zelle mit Bearbeiten + Impersonate-Form nebeneinander */
/* Kein display:flex auf dem <td> selbst: das loest die Zelle aus dem Tabellen-
   Fluss und die Zeilen-Trennlinie der letzten Spalte sitzt dann nicht mehr auf
   gleicher Hoehe wie die der uebrigen Zellen. Zentrierung per text-align, das
   Nebeneinander der Aktionen uebernimmt ein innerer Flex-Wrapper. */
.row-actions { white-space: nowrap; text-align: center; }
.admin-table th:last-child { text-align: center; }
.row-actions .inline-form { display: inline-flex; gap: 0.6rem; align-items: center; justify-content: center; margin: 0; }
.row-actions .inline-form button.btn-link {
    background: none; border: none; padding: 0; cursor: pointer;
    color: inherit; text-decoration: underline; font: inherit;
}

/* Admin-Liste: dezenter Material-Icon-Link, kein Rahmen, kein Background */
button.icon-link,
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    color: var(--muted);
    cursor: pointer;
    transition: color .15s;
}
.icon-link:hover { color: var(--primary); }
.icon-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.icon-link .material-symbols-outlined { font-size: 22px; }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
}

/* ========================================================== */
/* Freigabe-Ansicht (oeffentliche Kunden-URL)                  */
/* ========================================================== */
.fb-page-wrap {
    --fb-info: #2563eb;
    --fb-info-light: #dbeafe;
}
.fb-head {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
    position: sticky; top: 0; z-index: 50;
}
.fb-head-inner { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.fb-brand { display: flex; align-items: center; gap: .6rem; }
.fb-brand-name { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text); }
.fb-brand-tag { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.fb-customer { text-align: right; }
.fb-customer-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fb-customer-name { font-weight: 600; font-size: 1rem; }

.fb-page { max-width: 920px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.fb-page-head { margin-bottom: 2rem; }
.fb-page-head h1 { font-size: 2rem; margin-bottom: .5rem; font-family: 'Bricolage Grotesque', sans-serif; }
.fb-page-head p { color: var(--muted); }
.fb-howto { color: var(--muted); margin: 1rem 0 0 1.2rem; padding: 0; }
.fb-howto li { margin: .35rem 0; line-height: 1.5; }

.fb-filter {
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.fb-filter a {
    color: var(--muted); font-weight: 500; padding: .35rem 0; cursor: pointer; text-decoration: none;
}
.fb-filter a.active { color: var(--text); border-bottom: 2px solid var(--primary); }
.fb-filter a:hover { color: var(--text); text-decoration: none; }

.fb-post {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.fb-post:hover { box-shadow: var(--shadow-md, 0 6px 24px rgba(0,0,0,0.06)); }
.fb-post-head {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
}
.fb-post-img { width: 100px; height: 100px; border-radius: var(--radius); object-fit: cover; background: var(--surface); cursor: zoom-in; transition: transform .15s; }
.fb-post-img:hover { transform: scale(1.03); }
.fb-post-img-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: default; }
.fb-post-img-empty:hover { transform: none; }
.fb-post-meta-row { display: flex; gap: .8rem; align-items: center; margin-bottom: .4rem; flex-wrap: wrap; }
.fb-post-date { font-size: .9rem; color: var(--muted); font-weight: 600; }
.fb-post-title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; font-family: inherit; margin: 0; }
.fb-post-toggle {
    background: none; border: 0; cursor: pointer; padding: .5rem;
    color: var(--muted); transition: transform .2s, color .15s;
    display: inline-flex; align-items: center; justify-content: center;
}
.fb-post-toggle:hover { color: var(--text); }
.fb-post.open .fb-post-toggle { transform: rotate(180deg); }
.fb-post.approved .fb-post-head { background: linear-gradient(to right, transparent, var(--fb-info-light) 30%); }
.fb-post.approved .fb-channel { border-color: var(--fb-info-light); }

.fb-post-body { display: none; padding: 0 1.5rem 1.5rem 1.5rem; }
.fb-post.open .fb-post-body { display: block; }

.fb-channels { display: flex; flex-direction: column; gap: 1rem; }
.fb-channel { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; background: white; }
.fb-channel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; gap: .5rem; }
.fb-channel-badge { background: #e8f1cf; color: #4a7314; font-weight: 600; font-size: .8rem; padding: .25rem .65rem; border-radius: 6px; }
.fb-btn-copy {
    background: none; border: 0; color: var(--muted); cursor: pointer;
    padding: .35rem; border-radius: 6px;
    display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font: inherit;
}
.fb-btn-copy:hover { color: var(--primary-dark, #7aa517); background: var(--surface); }
.fb-channel-text {
    width: 100%; border: 0; background: transparent; font: inherit; color: var(--text);
    resize: none; overflow: hidden; padding: .4rem 0; line-height: 1.5; display: block;
}
.fb-channel-text:focus { outline: 0; }
.fb-channel-text[readonly] { color: var(--muted); cursor: default; }
.fb-channel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; font-size: .75rem; color: var(--muted); }
.fb-save.saved { color: #15803d; }

.fb-post-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    gap: 1rem; flex-wrap: wrap;
}
.fb-post-foot-info { color: var(--muted); font-size: .85rem; }
.fb-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .65rem 1.2rem; border-radius: 8px;
    border: 0; font: inherit; font-weight: 600; cursor: pointer;
    transition: background .15s, transform .1s;
}
.fb-btn:hover { transform: translateY(-1px); }
.fb-btn-approve { background: var(--fb-info); color: white; }
.fb-btn-approve:hover { background: #1d4ed8; }
.fb-btn-approve:disabled { opacity: .5; cursor: wait; transform: none; }

/* Lightbox */
.fb-lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 2rem; cursor: zoom-out;
}
.fb-lightbox.open { display: flex; }
.fb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.fb-lightbox-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    background: rgba(255,255,255,0.15); border: 0; color: white;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.fb-lightbox-close:hover { background: rgba(255,255,255,0.25); }

.fb-empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.fb-foot { max-width: 920px; margin: 2rem auto 1rem; text-align: center; color: var(--muted); padding: 0 1.5rem; }
.fb-foot small { font-size: .75rem; }

@media (max-width: 600px) {
    .fb-post-head { grid-template-columns: 70px 1fr auto; gap: .8rem; padding: 1rem; }
    .fb-post-img, .fb-post-img-empty { width: 70px; height: 70px; }
    .fb-post-title { font-size: 1rem; }
    .fb-post-body { padding: 0 1rem 1rem 1rem; }
    .fb-post-foot { padding: 1rem; flex-direction: column; align-items: stretch; }
    .fb-btn { width: 100%; justify-content: center; }
}

/* ===== Login-Tabs + BNI ===== */
.auth-card-wide { max-width: 460px; }

.login-tabs {
    display: flex;
    gap: .25rem;
    margin: 0 0 1.5rem;
    border-bottom: 1px solid var(--border);
}
.login-tab {
    flex: 1;
    background: none;
    border: none;
    padding: .8rem 1rem;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 600;
    transition: color .15s, border-color .15s;
}
.login-tab:hover { color: var(--text); }
.login-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.login-pane[hidden] { display: none; }

.bni-info-box {
    background: #eef7f1;
    border: 1px solid #b8d9c2;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 0 0 1.25rem;
}
.bni-info-box h2 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    color: #1f6b40;
}
.bni-info-box p {
    margin: 0 0 .75rem;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text);
}
.bni-info-box p:last-child { margin-bottom: 0; }
.bni-slots { font-size: .95rem; }
.bni-slots strong { color: #1f6b40; font-size: 1.1rem; }

.bni-fullbox {
    background: #fdf6e7;
    border: 1px solid #e8d5a1;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.bni-fullbox h2 {
    margin: 0 0 .75rem;
    font-size: 1.15rem;
    color: #8a6500;
}
.bni-fullbox p { margin: 0; color: var(--text); }

.bni-success {
    background: #eef7f1;
    border: 1px solid #b8d9c2;
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
}
.bni-success h2 {
    margin: 0 0 .75rem;
    color: #1f6b40;
    font-size: 1.2rem;
}
.bni-success p { margin: 0; color: var(--text); line-height: 1.55; }

.login-footer-links {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.login-footer-links p {
    margin: 0 0 .5rem;
    font-size: .9rem;
    color: var(--muted);
}
.login-footer-links p:last-child { margin-bottom: 0; }
.login-footer-links a { color: var(--primary); }
.login-admin-link { font-size: .8rem !important; }
.login-admin-link a { color: var(--muted) !important; text-decoration: underline; text-underline-offset: 3px; }
.login-admin-link a:hover { color: var(--text) !important; }

/* ===== Dashboard BNI-Box ===== */
.bni-feedback-box {
    background: linear-gradient(135deg, #eef7f1 0%, #d9ecdf 100%);
    border: 1px solid #b8d9c2;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin: 0 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.bni-feedback-text { flex: 1; min-width: 280px; }
.bni-feedback-text h2 {
    margin: 0 0 .35rem;
    font-size: 1.1rem;
    color: #1f6b40;
}
.bni-feedback-text p {
    margin: 0;
    color: var(--text);
    font-size: .95rem;
    line-height: 1.5;
}
.bni-feedback-box .btn { white-space: nowrap; }
.bni-feedback-done {
    background: #eef7f1;
    border: 1px solid #b8d9c2;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin: 0 0 2rem;
    color: #1f6b40;
    font-size: .95rem;
}

/* ===== Feedback-Form ===== */
.page-narrow { max-width: 640px; margin: 0 auto; }
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.feedback-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: white;
}
.feedback-fieldset legend {
    font-weight: 600;
    padding: 0 .5rem;
    color: var(--text);
}
.rating-stars {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-top: .5rem;
}
.rating-star {
    cursor: pointer;
    color: #d9d9d9;
    transition: color .15s, transform .15s;
}
.rating-star input { position: absolute; opacity: 0; pointer-events: none; }
.rating-star-icon {
    display: inline-block;
    transition: color .15s;
}
.rating-star.rating-active .rating-star-icon { color: #f0b400; }
.rating-stars:hover .rating-star .rating-star-icon { color: #f0b400; }
.rating-star:hover ~ .rating-star .rating-star-icon { color: #d9d9d9; }
.feedback-field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.feedback-field > span {
    font-weight: 600;
    color: var(--text);
}
.feedback-field em {
    font-style: normal;
    color: var(--muted);
    font-weight: 400;
}
.feedback-field textarea {
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: white;
    resize: vertical;
    min-height: 100px;
}
.feedback-field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.feedback-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== Admin BNI ===== */
.license-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
}
.license-paid {
    background: #eef4ff;
    color: #2c5fa3;
}
.license-free {
    background: #eef7f1;
    color: #1f6b40;
}
.license-bni {
    background: #fdecea;
    color: #b3261e;
}
.license-self {
    background: #f3f3f5;
    color: #555;
}

.admin-bni-block {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: #eef7f1;
    border: 1px solid #b8d9c2;
    border-radius: var(--radius);
}
.admin-bni-block h3 {
    margin: 0 0 .5rem;
    color: #1f6b40;
    font-size: 1rem;
}
.admin-bni-block p {
    margin: 0 0 .75rem;
    font-size: .9rem;
    line-height: 1.5;
}
.admin-bni-block form { margin: 0; }

.feedback-text {
    max-width: 320px;
    white-space: normal;
    font-size: .9rem;
    line-height: 1.4;
}

/* ===== Admin: Sortierbare Tabellen-Header ===== */
.admin-table.sortable th.sortable-col {
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
    transition: background .12s;
}
.admin-table.sortable th.sortable-col:hover {
    background: var(--surface);
}
.admin-table.sortable th.sortable-col::after {
    content: '↕';
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: .25;
    font-size: .85em;
    transition: opacity .12s;
}
.admin-table.sortable th.sortable-col:hover::after {
    opacity: .55;
}
.admin-table.sortable th.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary);
}
.admin-table.sortable th.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary);
}

/* =============================================
   Markenprofil-Autofill (Website-Vorschlaege + JSON-Import)
   ============================================= */
.autofill-box {
    position: relative;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.6rem;
}
.autofill-close {
    position: absolute;
    top: .6rem;
    right: .7rem;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 1.4rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.autofill-close:hover { background: rgba(0,0,0,.06); color: var(--text); }
.autofill-head-text { padding-right: 1.5rem; }   /* Platz fuer das X */
.autofill-head {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
}
.autofill-head .material-symbols-outlined {
    color: var(--primary-dark);
    font-size: 1.6rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.autofill-title {
    font-size: 1.05rem;
    margin: 0 0 .25rem;
    color: var(--accent);
}
.autofill-sub {
    font-size: .88rem;
    color: var(--text);
    margin: 0;
    line-height: 1.45;
}
.autofill-row {
    display: flex;
    gap: .6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.autofill-row input[type=url] {
    flex: 1 1 260px;
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: white;
    color: var(--text);
}
.autofill-row input[type=url]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(146, 195, 18, .18);
}
.autofill-row .btn { flex-shrink: 0; }

.autofill-paste {
    margin-top: .9rem;
    font-size: .88rem;
}
.autofill-paste > summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    padding: .3rem 0;
    user-select: none;
}
.autofill-paste > summary:hover { color: var(--primary-dark); }
.autofill-paste-help {
    font-size: .82rem;
    color: var(--muted);
    margin: .4rem 0 .5rem;
}
.autofill-paste textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
    background: white;
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}
.autofill-paste .btn { margin-top: .5rem; }

/* Statuszeile */
.autofill-status {
    margin-top: 1rem;
    padding: .7rem .9rem;
    border-radius: var(--radius);
    font-size: .88rem;
    line-height: 1.45;
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}
.autofill-status.busy { color: var(--accent); }
.autofill-status.ok { border-color: var(--success); }
.autofill-status.warn { border-color: var(--warning); color: var(--warning); }
.autofill-status.error { border-color: var(--danger); color: var(--danger); }
.autofill-note { display: block; margin-top: .3rem; color: var(--warning); }

.autofill-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: autofill-spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: .3rem;
}
@keyframes autofill-spin { to { transform: rotate(360deg); } }

/* Vorschau-Liste */
.autofill-results { margin-top: 1rem; }
.autofill-results-head {
    font-size: .9rem;
    color: var(--text);
    margin-bottom: .8rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.autofill-diff {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .8rem .9rem;
    margin-bottom: .7rem;
}
.autofill-diff.is-applied {
    border-color: var(--success);
    background: #f3faf5;
}
.autofill-diff-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--accent);
    margin-bottom: .5rem;
}
.autofill-diff-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    margin-bottom: .6rem;
}
.autofill-diff-col { min-width: 0; }
.autofill-diff-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    margin-bottom: .25rem;
}
.autofill-diff-tag.is-new { color: var(--primary-dark); }
.autofill-diff-val {
    font-size: .85rem;
    color: var(--text);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
.autofill-diff-val.is-empty { color: var(--muted); }

@media (max-width: 560px) {
    .autofill-diff-cols { grid-template-columns: 1fr; }
}

/* Account-Nr.-Spalte im Admin (leichtere Referenzierung) */
.admin-table .col-nr {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    padding-right: 1rem;
}

/* "Ganzen Post veroeffentlichen"-Checkbox neben dem Status-Badge */
.pub-toggle-all { margin-left: auto; }   /* schiebt die Checkbox in der Meta-Zeile nach rechts */

/* Datum + Titel in einer Zeile beim Post-Erstellen (Datum schmal) */
.gen-title-row { display: flex; gap: .8rem; align-items: flex-start; }
.gen-title-row .field { margin: 0; }
.gen-title-row .field-date { flex: 0 0 22%; min-width: 130px; }
.gen-title-row .field-title { flex: 1 1 auto; }
.gen-title-row .field .label { margin-top: 0; }
@media (max-width: 480px) {
    .gen-title-row { flex-direction: column; }
    .gen-title-row .field-date { flex-basis: auto; width: 100%; }
}

/* Titel inline editierbar (Posts-Liste, aufgeklappter Post) */
.gen-title-edit { cursor: pointer; border-bottom: 1px dashed transparent; }
.gen-title-edit:hover { border-bottom-color: var(--border); }
.inline-title {
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: var(--text);
    padding: .1rem .35rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   Redaktionsplan (planer.php): Prefix pl-*
   ============================================================ */
/* Feste Breite (Steinfresh-Mai-Breite), damit der Kalender bei JEDEM Monat exakt
   gleich breit ist, egal welche oder ob Inhalte drin stehen. max-width:100% laesst
   ihn auf schmalen Viewports trotzdem schrumpfen. */
.pl-wrap { width: 1180px; max-width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; box-sizing: border-box; }
.pl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pl-eyebrow { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-dark); font-weight: 700; margin-bottom: .25rem; }
.pl-title { font-size: 1.9rem; line-height: 1.05; margin: 0; }
.pl-sub { color: var(--muted); margin: .35rem 0 0; }
.pl-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Monats-Navigation (zurueck / Heute / vor) mittig ueber dem Kalender */
.pl-monthnav { display: flex; justify-content: center; gap: .5rem; margin: .25rem 0 1rem; }

.pl-btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; font-weight: 600;
  border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 10px; padding: .5rem .8rem; cursor: pointer; text-decoration: none; }
.pl-btn:hover { border-color: var(--primary-dark); color: var(--primary-dark); }
.pl-btn .material-symbols-outlined { font-size: 1.1rem; }
.pl-btn-primary { background: var(--primary); color: var(--accent); border-color: transparent; font-weight: 700; }
.pl-btn-primary:hover { background: var(--primary-dark); color: #fff; }
.pl-btn-ghost { background: #fff; }
.pl-btn-danger { background: #fff; color: #c0392b; border-color: #ecc4bf; }
.pl-btn-danger:hover { background: #c0392b; color: #fff; border-color: transparent; }

.pl-flash { background: var(--primary-light); border: 1px solid #d6e7a6; color: var(--accent); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.pl-flash-err { background: #fbe7e4; border-color: #ecc4bf; color: #c0392b; }

/* Kalender-Grid. minmax(0,1fr) erzwingt 7 exakt gleich breite Spalten, unabhaengig
   vom Inhalt (sonst koennte ein langer Titel eine Spalte breiter ziehen). */
.pl-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(20,14,40,.06); }
.pl-dow { padding: .6rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.pl-dow:nth-child(7n) { border-right: none; }
.pl-cell { min-height: 108px; min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .35rem .35rem .5rem; cursor: pointer; transition: background .12s; overflow: hidden; }
.pl-cell:nth-child(7n) { border-right: none; }
.pl-cell:hover { background: var(--surface); }
.pl-dim { background: var(--surface); cursor: default; }
.pl-dim:hover { background: var(--surface); }
.pl-dn { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.pl-today .pl-dn { background: var(--primary); color: var(--accent); width: 1.35rem; height: 1.35rem; border-radius: 50%; display: inline-grid; place-items: center; }

/* Baender (Event/Aktion). Helle Flaeche (--bg), dunklere Klammer (--edge) nur an Start/Ende. */
.pl-band { font-size: .62rem; font-weight: 700; padding: .12rem .4rem; margin-bottom: .18rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  min-height: 1.1rem; line-height: 1; display: flex; align-items: center;
  background: var(--bg); color: var(--txt); }
.pl-band:hover { filter: brightness(.97); }
/* Mehrtaegige Baender: Mitte randlos, Start/Ende mit dunklerer Kante als Klammer */
.pl-band-start { border-radius: 5px 0 0 5px; border-left: 3px solid var(--edge); }
.pl-band-end   { border-radius: 0 5px 5px 0; border-right: 3px solid var(--edge); }
.pl-band-mid   { border-radius: 0; }
/* Eintaegige (kein multiDay): bekommen rundum-Rahmen */
.pl-band.pl-band-edge.pl-band-start.pl-band-end,
.pl-band:not(.pl-band-mid):not(.pl-band-start):not(.pl-band-end) { border-radius: 5px; border-left: 3px solid var(--edge); }

/* Posts / Ideen: einheitlich Pink, keine Kanal-Farben mehr */
/* align-items:flex-start, damit der Punkt bei zweizeiligem Titel oben buendig sitzt. */
.pl-post { font-size: .68rem; font-weight: 600; padding: .18rem .4rem; border-radius: 6px; margin-bottom: .18rem; display: flex; align-items: flex-start; gap: .35rem; cursor: pointer; line-height: 1.2; min-width: 0;
  background: #fde4f1; color: #a01e63; }
.pl-post:hover { background: #fbd2e7; }
.pl-post .pl-pd { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #e6398b; margin-top: .28rem; }
/* Titel zweizeilig: nach 2 Zeilen mit Ellipsis abschneiden. */
.pl-ptxt { overflow: hidden; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
/* Idee: kein pinker Hintergrund, sondern durchgehende pinke Umrandung + voller pinker Punkt (nicht gestrichelt). */
.pl-post-idea { background: transparent; border: 1px solid #e6398b; color: #a01e63; }
.pl-post-idea:hover { background: #fde4f1; }
.pl-post-idea .pl-pd { background: #e6398b; border: none; }

.pl-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .78rem; color: var(--muted); align-items: center; }
.pl-legend span { display: flex; align-items: center; gap: .35rem; }
.pl-legend-sep { margin-left: .5rem; font-weight: 600; }
.pl-d { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.pl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pl-dot-idea { border: 1px solid #e6398b; background: transparent; }

/* Modals */
.pl-modal { position: fixed; inset: 0; background: rgba(26,31,16,.45); display: grid; place-items: center; z-index: 1000; padding: 1rem; }
.pl-modal[hidden] { display: none; }
.pl-modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: 0 12px 40px rgba(20,14,40,.25); }
.pl-modal-wide { max-width: 760px; }
.pl-modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.pl-modal-hd h3 { margin: 0; font-size: 1.1rem; }
.pl-x { background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.pl-form { padding: 1.1rem 1.25rem 1.25rem; }
.pl-lbl { display: block; font-weight: 700; font-size: .82rem; margin: .8rem 0 .3rem; }
.pl-lbl:first-child { margin-top: 0; }
.pl-inp { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; font: inherit; font-size: .9rem; background: var(--bg); color: var(--text); }
.pl-ta { resize: vertical; line-height: 1.5; }
.pl-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.pl-channels { display: flex; flex-wrap: wrap; gap: .5rem; }
.pl-chk { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; cursor: pointer; }
.pl-modal-ft { display: flex; gap: .5rem; align-items: center; margin-top: 1.2rem; }
.pl-hint { font-size: .76rem; color: var(--muted); margin: .8rem 0 0; line-height: 1.4; }

.pl-kindpick { display: flex; gap: .5rem; flex-wrap: wrap; }
.pl-kindopt { cursor: pointer; }
.pl-kindopt input { position: absolute; opacity: 0; }
.pl-kindopt span { display: inline-block; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 20px; font-size: .8rem; font-weight: 600; }
.pl-kindopt input:checked + span { background: var(--kc); color: #fff; border-color: transparent; }

/* Import-Spalten */
.pl-import-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pl-import-col { border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; max-height: 50vh; overflow: auto; }
.pl-import-colhd { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; margin-bottom: .5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.pl-import-colhd .material-symbols-outlined { font-size: 1.1rem; color: var(--primary-dark); }
.pl-import-all { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; color: var(--primary-dark); cursor: pointer; }
.pl-import-row { display: flex; align-items: flex-start; gap: .5rem; padding: .3rem 0; font-size: .82rem; }
.pl-import-row em { color: var(--muted); font-style: normal; }
.pl-import-row small { color: var(--muted); }
.pl-import-err { font-size: .82rem; color: #c0392b; padding: .4rem 0; }

@media (max-width: 760px) {
  .pl-cell { min-height: 78px; }
  .pl-ptxt, .pl-band { font-size: .58rem; }
  .pl-import-cols { grid-template-columns: 1fr; }
  .pl-row2 { grid-template-columns: 1fr; }
}
