:root {
    --schramberg-black: #1a1a1a;
    --schramberg-gold: #ffcc00;
    --schramberg-gold-dark: #e6b800;
    --schramberg-gold-light: #fff3b3;
    --text-dark: #2c2c2c;
    --text-medium: #666;
    --text-light: #999;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-section: #f8f6f2;
    --border-light: #e6e6e6;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --red-bg: #fef2f2;
    --red-border: #dc2626;
    --red-text: #991b1b;
    --orange-bg: #fffbeb;
    --orange-border: #f59e0b;
    --orange-text: #92400e;
    --green-bg: #f0fdf4;
    --green-border: #16a34a;
    --green-text: #166534;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}
.header {
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    text-align: center;
    padding: 2.5rem 1rem;
    box-shadow: var(--shadow-light);
}
.header-logo { margin-bottom: 1rem; }
.header-logo img { 
    max-width: 200px; 
    height: auto; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); 
}
.header h1 { font-size: 2.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.header .version { font-size: 0.9rem; color: var(--schramberg-gold-light); opacity: 0.8; font-weight: 500; }
.header .subtitle { font-size: 1.1rem; margin-top: 1rem; font-weight: 300; color: #ccc; }
nav {
    background: var(--bg-white);
    border-bottom: 3px solid var(--schramberg-gold);
    padding: 0;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}
nav .nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
nav a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
nav a:hover, nav a.active {
    color: var(--schramberg-black);
    border-bottom-color: var(--schramberg-gold);
    background: var(--schramberg-gold-light);
}
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }
section {
    margin: 2.5rem 0;
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow-light);
}
section.hero {
    background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-white) 100%);
    border-left: 6px solid var(--schramberg-gold);
}
section.alert-section {
    border-left: 6px solid var(--red-border);
    background: linear-gradient(135deg, var(--red-bg) 0%, var(--bg-white) 100%);
}
h2 {
    font-size: 1.8rem;
    color: var(--schramberg-black);
    margin-bottom: 1.2rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}
h2:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: var(--schramberg-gold);
}
h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin: 1.5rem 0 0.8rem;
    font-weight: 500;
}
h4 { margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; color: var(--text-dark); font-size: 1rem; }
ul { padding-left: 2rem; margin: 1rem 0; }
li { margin-bottom: 0.5rem; color: var(--text-dark); }
a { color: var(--schramberg-gold-dark); }

/* Fact cards */
.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.fact-card {
    padding: 1.2rem;
    border-radius: 8px;
    border-left: 4px solid;
    text-align: center;
}
.fact-card.fact-red { background: var(--red-bg); border-color: var(--red-border); }
.fact-card.fact-orange { background: var(--orange-bg); border-color: var(--orange-border); }
.fact-card.fact-green { background: var(--green-bg); border-color: var(--green-border); }
.fact-number { font-size: 1.8rem; font-weight: 700; color: var(--schramberg-black); }
.fact-label { font-size: 0.95rem; font-weight: 600; margin: 0.3rem 0; }
.fact-context { font-size: 0.8rem; color: var(--text-medium); }

/* Problem list */
.problem-list { margin: 1rem 0; }
.problem-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: var(--bg-section);
    border-radius: 6px;
}
.problem-rank {
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.problem-item p { font-size: 0.9rem; margin: 0.3rem 0 0; color: var(--text-medium); }

/* Projekt grid */
.projekt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.projekt-card {
    background: var(--bg-section);
    border-radius: 6px;
    padding: 1.5rem;
    border-left: 4px solid var(--schramberg-gold);
    transition: transform 0.2s ease;
}
.projekt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-light); }
.projekt-card h4 { font-size: 1.1rem; color: var(--schramberg-black); font-weight: 600; }
.projekt-card p { font-size: 0.9rem; color: var(--text-medium); margin: 0.5rem 0; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}
.status-ok { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }
.status-planung { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.status-warnung { background: var(--orange-bg); color: var(--orange-text); border: 1px solid var(--orange-border); }
.status-kritisch { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.status-aktiv { background: var(--schramberg-gold-light); color: var(--schramberg-black); }
.status-beschlossen { background: #e8f5e8; color: #2e7d2e; }

/* Projekt detail sections */
.projekt-detail {
    margin: 2rem 0;
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border-left: 6px solid var(--schramberg-gold);
}
.projekt-detail.status-border-red { border-left-color: var(--red-border); }
.projekt-detail.status-border-orange { border-left-color: var(--orange-border); }
.projekt-detail.status-border-green { border-left-color: var(--green-border); }

.projekt-detail h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.projekt-detail h2 .status-badge { margin-left: auto; }

.source-list {
    background: var(--bg-section);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.source-list h4 { margin-bottom: 0.5rem; color: var(--text-dark); }
.source-list a { display: block; margin-bottom: 0.3rem; word-break: break-all; }

.bewertung-box {
    background: var(--schramberg-gold-light);
    border: 1px solid var(--schramberg-gold-dark);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.bewertung-box.bewertung-warnung {
    background: var(--orange-bg);
    border-color: var(--orange-border);
}
.bewertung-box.bewertung-kritisch {
    background: var(--red-bg);
    border-color: var(--red-border);
}
.bewertung-box.bewertung-positiv {
    background: var(--green-bg);
    border-color: var(--green-border);
}

.timeline {
    background: var(--bg-section);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.timeline h4 { color: var(--schramberg-black); margin-bottom: 0.5rem; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.data-table th {
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    font-weight: 500;
}
.data-table tr:hover { background: var(--bg-section); }
.data-table .trend-down { color: var(--red-text); font-weight: 600; }
.data-table .trend-up { color: var(--green-text); font-weight: 600; }

.hinweis {
    background: var(--schramberg-gold-light);
    border: 1px solid var(--schramberg-gold-dark);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 2rem 0;
    font-size: 0.95rem;
}
.hinweis strong { color: var(--schramberg-black); }

.tag {
    display: inline-block;
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.footer {
    background: var(--schramberg-black);
    color: var(--schramberg-gold-light);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.9rem;
}
.footer a { color: var(--schramberg-gold); text-decoration: none; }
.footer p { margin-bottom: 0.3rem; }

/* Empfehlungen */
.empfehlung-card {
    background: var(--bg-section);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--schramberg-gold);
}
.empfehlung-card h4 { color: var(--schramberg-black); margin-bottom: 0.5rem; }
.empfehlung-card p { font-size: 0.9rem; margin-bottom: 0; }

/* Version blocks */
.version-block {
    background: var(--bg-white);
    border-left: 6px solid var(--schramberg-gold);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}
.version-block .date { font-size: 0.9rem; color: var(--text-medium); font-weight: 500; }

/* Schichtprinzip — aufklappbare Vertiefungen */
details {
    margin: 1rem 0;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}
details[open] {
    border-color: var(--schramberg-gold);
}
details summary {
    padding: 1rem 1.5rem;
    background: var(--bg-section);
    cursor: pointer;
    font-weight: 600;
    color: var(--schramberg-black);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
details[open] summary::before { transform: rotate(90deg); }
details summary:hover { background: var(--schramberg-gold-light); }
details .details-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}
details.tiefe-2 {
    border-left: 3px solid var(--schramberg-gold);
    margin-left: 0.5rem;
}
details.tiefe-2 summary {
    font-size: 0.95rem;
    padding: 0.8rem 1.2rem;
}

/* Quellen-Wald (Forschungsschicht) */
details.quellen-wald summary {
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
}
details.quellen-wald summary:hover {
    background: #333;
}
details.quellen-wald[open] {
    border-color: var(--schramberg-black);
}

/* Zitat-Box */
.zitat {
    border-left: 4px solid var(--schramberg-gold);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    background: var(--bg-section);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}
.zitat .zitat-autor {
    font-style: normal;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-top: 0.5rem;
}

/* Chronologie */
.chrono-list {
    position: relative;
    padding-left: 2rem;
}
.chrono-list::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--schramberg-gold);
}
.chrono-item {
    position: relative;
    margin-bottom: 1.2rem;
    padding-left: 1rem;
}
.chrono-item::before {
    content: '';
    position: absolute;
    left: -1.85rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--schramberg-gold);
    border: 2px solid var(--schramberg-black);
}
.chrono-date {
    font-weight: 700;
    color: var(--schramberg-black);
    font-size: 0.9rem;
}
.chrono-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-top: 0.2rem;
}

/* Kennzahl-Highlight */
.kennzahl-highlight {
    display: inline-block;
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Version-Details im Changelog */
.version-block details {
    border: none;
    margin: 0.5rem 0;
}
.version-block details summary {
    background: transparent;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}
.version-block details .details-content {
    padding: 0.5rem 0 0.5rem 1rem;
    border-top: none;
    border-left: 2px solid var(--border-light);
}

/* Theme-Grid (Dashboard-Kacheln) */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin: 2rem 0;
}
.theme-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 1.8rem 1.5rem;
    border-left: 4px solid var(--schramberg-gold);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-light);
}
.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-left-color: var(--schramberg-black);
}
.theme-card .card-kennzahl {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--schramberg-black);
    margin-bottom: 0.3rem;
}
.theme-card .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}
.theme-card .card-teaser {
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.4;
}
/* Card icon — hidden on desktop, replaces kennzahl on mobile */
.theme-card .card-icon {
    display: none;
}
.theme-card .card-arrow {
    display: block;
    text-align: right;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--schramberg-gold-dark);
    font-weight: 600;
    transition: transform 0.2s ease;
}

/* Theme-Content: Hidden by default */
.theme-content {
    display: none;
}
.theme-content h2 { margin-top: 0; }
.theme-content section {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

/* Modal-Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.modal-close {
    position: sticky;
    top: 0;
    float: right;
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}
.modal-close:hover {
    background: #333;
}
body.modal-open {
    overflow: hidden;
}

/* ===== DESKTOP: Modal-Modus ===== */
@media (min-width: 769px) {
    .theme-item.active .theme-content {
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 900px;
        max-height: 85vh;
        background: var(--bg-white);
        border-radius: 12px;
        z-index: 1001;
        overflow-y: auto;
        padding: 2.5rem;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        animation: modalFadeIn 0.25s ease;
    }
    .theme-item.active .theme-card {
        border-left-color: var(--schramberg-black);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===== MOBILE: Akkordeon-Modus ===== */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .header h1 { font-size: 2.2rem; }
    .header-logo img { max-width: 150px; }
    section { margin: 1.5rem 0; padding: 1.5rem 1rem; }
    .container { padding: 0 1rem; }
    .projekt-grid { grid-template-columns: 1fr; gap: 1rem; }
    .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .fact-card { padding: 0.8rem; }
    nav a { padding: 0.8rem 1rem; font-size: 0.9rem; }
    .projekt-detail { padding: 1.5rem 1rem; }
    .projekt-detail h2 { flex-direction: column; align-items: flex-start; }
    .projekt-detail h2 .status-badge { margin-left: 0; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 0.4rem 0.5rem; }

    /* Kacheln einspaltig */
    .theme-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 1.5rem 0;
    }

    /* Kacheln kompakter auf Mobile */
    .theme-card {
        border-radius: 0;
        border-left: none;
        border-bottom: 1px solid var(--border-light);
        padding: 1.2rem 1rem;
        box-shadow: none;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        background: var(--bg-white);
        overflow: hidden;
        max-width: 100%;
    }
    .theme-card:hover {
        transform: none;
        box-shadow: none;
    }
    .theme-item:first-child .theme-card {
        border-radius: 8px 8px 0 0;
    }
    .theme-item:last-child .theme-card {
        border-radius: 0 0 8px 8px;
        border-bottom: none;
    }
    .theme-item.active .theme-card {
        background: var(--schramberg-gold-light);
        border-bottom-color: var(--schramberg-gold);
    }
    .theme-item.active:last-child .theme-card {
        border-radius: 0;
    }
    .theme-card .card-icon {
        display: block;
        font-size: 1.4rem;
        flex-shrink: 0;
        width: 36px;
        text-align: center;
        line-height: 1;
    }
    .theme-card .card-kennzahl {
        display: none;
    }
    .theme-card .card-title {
        font-size: 1rem;
        margin-bottom: 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .theme-card .card-teaser {
        display: none;
    }
    .theme-card .card-arrow {
        margin-top: 0;
        margin-left: auto;
        flex-shrink: 0;
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }
    .theme-item.active .card-arrow {
        transform: rotate(90deg);
    }

    /* Akkordeon-Inhalt */
    .theme-item.active .theme-content {
        display: block;
        padding: 1.5rem 1rem;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-light);
        border-left: 3px solid var(--schramberg-gold);
        animation: accordionSlide 0.3s ease;
    }
    .theme-item.active:last-child .theme-content {
        border-radius: 0 0 8px 8px;
    }

    /* Kein Modal-Close-Button auf Mobile */
    .modal-close { display: none; }

    /* Kein Backdrop auf Mobile */
    .modal-backdrop { display: none !important; }

    /* Tabellen horizontalscrollbar */
    .theme-content .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@keyframes accordionSlide {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 3000px; }
}

/* ===== CSS-Balkendiagramme (rein CSS) ===== */
.bar-chart { margin: 1.5rem 0; }
.bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 0.8rem;
}
.bar-label {
    flex: 0 0 160px;
    font-size: 0.85rem;
    text-align: right;
    color: var(--text-dark);
    font-weight: 500;
}
.bar-track {
    flex: 1;
    height: 28px;
    background: var(--bg-section);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    transition: width 0.6s ease;
}
.bar-fill.bar-gold, .timeline-bar.bar-gold { background: var(--schramberg-gold); color: var(--schramberg-black); }
.bar-fill.bar-red, .timeline-bar.bar-red { background: var(--red-border); }
.bar-fill.bar-orange, .timeline-bar.bar-orange { background: var(--orange-border); color: var(--schramberg-black); }
.bar-fill.bar-dark, .timeline-bar.bar-dark { background: var(--schramberg-black); color: var(--schramberg-gold); }
.bar-fill.bar-green, .timeline-bar.bar-green { background: var(--green-border); }
.bar-fill.bar-muted, .timeline-bar.bar-muted { background: #999; }
.bar-value {
    flex: 0 0 90px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Liquiditäts-Verlauf */
.liqui-timeline {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin: 1.5rem 0;
    padding: 1rem 0;
    height: 220px;
    border-bottom: 2px solid var(--text-dark);
    position: relative;
}
.liqui-timeline::after {
    content: '0 €';
    position: absolute;
    bottom: -1.5rem;
    right: 0;
    font-size: 0.7rem;
    color: var(--text-medium);
}
.liqui-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}
.liqui-bar {
    width: 60%;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease;
    min-height: 2px;
}
.liqui-bar.positive { background: var(--schramberg-gold); }
.liqui-bar.negative {
    background: var(--red-border);
    border-radius: 0 0 4px 4px;
    position: absolute;
    bottom: -2px;
    transform: translateY(100%);
}
.liqui-amount {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
    text-align: center;
}
.liqui-year {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: var(--text-dark);
}
.liqui-danger-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 2px dashed var(--red-border);
    font-size: 0.65rem;
    color: var(--red-text);
    padding-top: 0.2rem;
    text-align: right;
}

/* Detail-Seiten-Sections */
.detail-section {
    margin: 2rem 0;
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-light);
}
.detail-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.detail-section h2 .section-icon {
    font-size: 1.4rem;
}
.detail-section.section-alert {
    border-left: 6px solid var(--red-border);
}
.detail-section.section-gold {
    border-left: 6px solid var(--schramberg-gold);
}

/* Zwei-Spalten-Layout für Detail-Karten */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.detail-card {
    background: var(--bg-section);
    border-radius: 6px;
    padding: 1.5rem;
    border-left: 4px solid var(--schramberg-gold);
}
.detail-card h4 { margin-bottom: 0.5rem; }
.detail-card .big-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--schramberg-black);
    margin-bottom: 0.3rem;
}
.detail-card .big-number.text-red { color: var(--red-text); }
.detail-card .sub-text {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* CTA-Link */
.cta-link {
    display: inline-block;
    background: var(--schramberg-black);
    color: var(--schramberg-gold);
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease;
    margin: 1rem 0;
}
.cta-link:hover {
    background: #333;
    color: var(--schramberg-gold);
}

@media (max-width: 768px) {
    .bar-label { flex: 0 0 90px; font-size: 0.75rem; }
    .bar-value { flex: 0 0 70px; font-size: 0.75rem; }
    .bar-track { height: 22px; }
    .bar-fill { font-size: 0.65rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-section { padding: 1.5rem 1rem; }
    .liqui-bar-wrap .liqui-amount { font-size: 0.6rem; }
    .liqui-timeline { height: 180px; }
}

/* ===== BOTTOM NAVIGATION (Mobile) ===== */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Hide top nav on mobile */
    nav:not(.bottom-nav) {
        display: none;
    }

    /* Show bottom nav — aggressive overrides to prevent nav inheritance */
    .bottom-nav {
        display: flex !important;
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: auto !important;
        background: var(--schramberg-black) !important;
        z-index: 9999 !important;
        justify-content: space-around;
        align-items: center;
        padding: 0.4rem 0 0.5rem;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
        border: none !important;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
    }
    .bottom-nav a {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        text-decoration: none;
        color: #999;
        font-size: 0.65rem;
        font-weight: 500;
        padding: 0.3rem 0.5rem;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        border: none !important;
        background: none !important;
    }
    .bottom-nav a.active {
        color: var(--schramberg-gold);
    }
    .bottom-nav a:hover {
        color: var(--schramberg-gold-light);
    }
    .bottom-nav svg {
        width: 22px;
        height: 22px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Body padding so content isn't hidden behind bottom nav */
    body {
        padding-bottom: 70px;
    }
}

/* ===== ZEITREIHEN-BALKENDIAGRAMME ===== */
.timeline-chart { margin: 1.5rem 0; }
.timeline-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.timeline-year {
    flex: 0 0 65px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
}
.timeline-bar-track {
    flex: 1;
    height: 30px;
    background: var(--bg-section);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.timeline-bar {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: width 0.3s;
}
.timeline-value {
    flex: 0 0 90px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* Typ-Tags fuer Ist/Plan/Prognose */
.tag-ist {
    font-size: 0.7rem;
    background: var(--schramberg-gold);
    color: #000;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}
.tag-plan {
    font-size: 0.7rem;
    background: #555;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}
.tag-prognose {
    font-size: 0.7rem;
    background: transparent;
    color: #999;
    border: 1px solid #666;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Vergleichsbalken (Einnahmen vs. Ausgaben) */
.compare-chart { margin: 1.5rem 0; }
.compare-row {
    display: grid;
    grid-template-columns: 65px 1fr 1fr 100px;
    gap: 4px;
    align-items: center;
    margin-bottom: 0.5rem;
}
.compare-year {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
}
.compare-bar-pos {
    height: 24px;
    border-radius: 3px;
    background: var(--green-border);
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}
.compare-bar-neg {
    height: 24px;
    border-radius: 3px;
    background: var(--red-border);
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}
.compare-result {
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}
.compare-result.positive { color: var(--green-text); }
.compare-result.negative { color: var(--red-text); }

@media (max-width: 768px) {
    .timeline-year { flex: 0 0 50px; font-size: 0.75rem; }
    .timeline-value { flex: 0 0 70px; font-size: 0.75rem; }
    .timeline-bar-track { height: 24px; }
    .timeline-bar { font-size: 0.65rem; padding: 0 4px; }
    .compare-row { grid-template-columns: 50px 1fr 1fr 80px; }
    .compare-bar-pos, .compare-bar-neg { font-size: 0.6rem; height: 20px; }
    .compare-result { font-size: 0.75rem; }
    .compare-year { font-size: 0.75rem; }
}
