
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #17233d;
    --muted: #71809a;
    --line: #e8edf4;
    --yellow: #f5ad18;
    --yellow-soft: #fff4d9;
    --blue: #4389e8;
    --blue-soft: #eaf3ff;
    --green: #18a66a;
    --green-soft: #e4f7ee;
    --purple: #7568d9;
    --purple-soft: #eeecff;
    --radius: 24px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.app-shell {
    width: min(100%, 920px);
    min-height: 100vh;
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: max(14px, env(safe-area-inset-top)) 20px 14px;
    background: rgba(245,247,251,.96);
    border-bottom: 1px solid rgba(220,226,235,.7);
    backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
    width: 46px; height: 46px; border-radius: 15px;
    display: grid; place-items: center;
    font-size: 25px; font-weight: 700;
}
.brand-icon.yellow { background: var(--yellow-soft); color: var(--yellow); }
.brand-icon.blue { background: var(--blue-soft); color: var(--blue); }
.brand-title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.brand-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.update { position: relative; padding-right: 18px; text-align: right; color: var(--muted); font-size: 11px; line-height: 1.35; }
.update span, .update strong { display: block; }
.update strong { color: #53617a; font-weight: 600; }
.status-dot {
    position: absolute; right: 0; top: 12px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #28b978;
}

.content {
    padding: 18px 16px 110px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(226,231,239,.75);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 6px 22px rgba(35,52,82,.045);
}

.hero {
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hero.pv { background: linear-gradient(135deg, #fffdf7, #fff8e9); }
.hero.blue { background: linear-gradient(135deg, #fbfdff, #eff6ff); }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; }
.hero-value { margin: 5px 0 4px; font-size: clamp(38px, 10vw, 54px); line-height: 1; letter-spacing: -.045em; font-weight: 800; }
.hero-note { color: var(--muted); font-size: 13px; }
.delta {
    white-space: nowrap; padding: 8px 11px; border-radius: 999px;
    font-weight: 750; font-size: 13px;
}
.delta.up { background: var(--green-soft); color: #168657; }
.delta.down { background: var(--green-soft); color: #168657; }


/* Große gemeinsame PV-Übersichtskachel */
.pv-summary-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e7 100%);
    border: 1px solid rgba(238, 218, 165, .65);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 14px;
    box-shadow: 0 8px 28px rgba(35,52,82,.055);
}
.pv-summary-main {
    position: relative;
    min-height: 205px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.pv-eyebrow { color: #64738c; font-size: 17px; font-weight: 600; }
.pv-hero-value {
    margin: 8px 0 9px;
    font-size: clamp(48px, 10vw, 72px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 850;
}
.pv-comparison {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #697a95;
    font-size: 15px;
}
.pv-summary-divider { height: 1px; background: rgba(224, 205, 157, .65); }
.pv-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 0;
}
.pv-metric {
    text-align: center;
    min-width: 0;
    padding: 0 15px;
    border-right: 1px solid rgba(224, 205, 157, .48);
}
.pv-metric:last-child { border-right: 0; }
.pv-metric .metric-icon { margin: 0 auto 10px; }
.pv-metric .metric-value { font-size: clamp(22px, 4.8vw, 31px); }
.pv-metric .metric-note { font-size: 12px; }
.pv-forecast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr);
    align-items: center;
    gap: 28px;
    padding-top: 20px;
}
.forecast-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.forecast-note { color: #71809a; font-size: 13px; margin-top: 3px; }
.pv-progress { margin: 12px 0 7px; }
.pv-progress > div { background: #ffb719; }
.forecast-result { display: flex; align-items: baseline; gap: 12px; }
.forecast-result strong { font-size: 27px; }
.forecast-result span { color: #71809a; font-size: 13px; }
.forecast-total {
    text-align: right;
    min-width: 0;
    align-self: center;
}
.forecast-total strong { display: block; font-size: 31px; letter-spacing: -.03em; }
.forecast-total span { display: block; color: #71809a; font-size: 12px; margin-top: 2px; }
.range-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 15px;
}
.range-tabs button {
    border: 0;
    border-radius: 13px;
    padding: 10px 6px;
    background: #f1f4f8;
    color: #60718d;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}
.range-tabs button.active { background: #fff0c8; color: #a66a00; }

@media (max-width: 700px) {
    .pv-summary-card { padding: 19px; border-radius: 23px; }
    .pv-summary-main { min-height: 175px; }
    .pv-eyebrow { font-size: 15px; }
    .pv-comparison { font-size: 13px; }
    .pv-metrics { padding: 17px 0; }
    .pv-metric { padding: 0 8px; }
    .pv-metric .metric-value { font-size: 21px; }
    .pv-metric .metric-label { font-size: 12px; }    .pv-forecast {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .55fr);
        gap: 18px;
    }
    .forecast-icon { width: 46px; height: 46px; }    .forecast-total {
        grid-column: auto;
        text-align: right;
        min-width: 0;
        margin-top: 0;
    }    .forecast-total strong {
        display: block;
        font-size: 24px;
        margin-right: 0;
    }    .forecast-total span {
        display: block;
        font-size: 11px;
    }
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.metric { padding: 18px; min-height: 126px; }
.metric-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; margin-bottom: 13px;
    font-size: 19px; font-weight: 700;
}
.metric-icon.yellow { background: var(--yellow-soft); color: var(--yellow); }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.purple { background: var(--purple-soft); color: var(--purple); }
.metric-label { color: #53617a; font-size: 13px; }
.metric-value { font-size: clamp(20px, 5.5vw, 28px); font-weight: 800; margin-top: 5px; letter-spacing: -.025em; }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 5px; }

.section-title {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 15px;
    font-size: 18px; font-weight: 750;
}
.section-title span { color: var(--muted); font-size: 12px; font-weight: 500; }

.forecast-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.forecast-value { font-size: 18px; font-weight: 800; }
.progress {
    height: 12px; margin: 15px 0 9px; background: #edf1f6;
    border-radius: 999px; overflow: hidden;
}
.progress > div {
    height: 100%; width: 89%; background: var(--yellow);
    border-radius: inherit;
}
.forecast-bottom { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.forecast-percent { color: var(--text); font-size: 24px; font-weight: 800; }

.chart {
    height: 190px; display: flex; align-items: end; gap: 5px;
    padding: 15px 3px 24px;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #edf1f6 43px);
}
.bar { flex: 1; max-width: 18px; margin: 0 auto; border-radius: 7px 7px 2px 2px; background: #f4b529; }
.chart.blue .bar { background: #78aef0; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding-top: 7px; }

.flow {
    display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr;
    align-items: center; gap: 7px; text-align: center;
}
.flow-icon {
    width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 50%;
    display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.flow-arrow { color: #7d90a9; font-size: 22px; }
.flow-value { font-size: 20px; font-weight: 800; }
.flow-label { color: var(--muted); font-size: 12px; margin-top: 3px; }

.compare-row {
    display: grid; grid-template-columns: 1.5fr 1fr 1fr .8fr;
    gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line);
    align-items: center; font-size: 13px;
}
.compare-row:last-child { border-bottom: 0; }
.compare-head { color: var(--muted); font-size: 11px; }
.compare-value { font-weight: 700; }
.good { color: var(--green); font-weight: 750; text-align: right; }

.bottom-nav {
    position: fixed;
    z-index: 30;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 920px);
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 9px 8px max(9px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid #e3e8ef;
    backdrop-filter: blur(16px);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 54px; border-radius: 16px; color: #71809a; gap: 2px;
}
.bottom-nav a span { font-size: 23px; line-height: 1; }
.bottom-nav a small { font-size: 11px; font-weight: 650; }
.bottom-nav a.active.pv { color: var(--yellow); background: var(--yellow-soft); }
.bottom-nav a.active.meter { color: var(--blue); background: var(--blue-soft); }
.bottom-nav a.active.stats { color: var(--purple); background: var(--purple-soft); }
.bottom-nav a.active.costs { color: var(--green); background: var(--green-soft); }
.bottom-nav a.active.settings { color: #53617a; background: #eef1f5; }

.page-placeholder { text-align: center; padding: 50px 20px; color: var(--muted); }
.settings-list { display: grid; gap: 10px; }
.setting-row {
    display:flex; justify-content:space-between; align-items:center;
    padding: 16px 0; border-bottom:1px solid var(--line);
}
.setting-row:last-child { border-bottom:0; }
.setting-row strong { font-size:15px; }
.setting-row span { color:var(--muted); font-size:14px; }

@media (max-width: 600px) {
    .topbar { padding-left: 14px; padding-right: 14px; }
    .update { font-size: 10px; }
    .brand-title { font-size: 18px; }
    .brand-subtitle { font-size: 12px; }
    .content { padding-left: 12px; padding-right: 12px; }
    .card { border-radius: 21px; padding: 17px; }
    .hero { padding: 19px; }
    
/* Große gemeinsame PV-Übersichtskachel */
.pv-summary-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e7 100%);
    border: 1px solid rgba(238, 218, 165, .65);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 14px;
    box-shadow: 0 8px 28px rgba(35,52,82,.055);
}
.pv-summary-main {
    position: relative;
    min-height: 205px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.pv-eyebrow { color: #64738c; font-size: 17px; font-weight: 600; }
.pv-hero-value {
    margin: 8px 0 9px;
    font-size: clamp(48px, 10vw, 72px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 850;
}
.pv-comparison {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #697a95;
    font-size: 15px;
}
.pv-summary-divider { height: 1px; background: rgba(224, 205, 157, .65); }
.pv-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 0;
}
.pv-metric {
    text-align: center;
    min-width: 0;
    padding: 0 15px;
    border-right: 1px solid rgba(224, 205, 157, .48);
}
.pv-metric:last-child { border-right: 0; }
.pv-metric .metric-icon { margin: 0 auto 10px; }
.pv-metric .metric-value { font-size: clamp(22px, 4.8vw, 31px); }
.pv-metric .metric-note { font-size: 12px; }
.pv-forecast {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
}
.forecast-icon { width: 56px; height: 56px; margin: 0; font-size: 30px; }
.forecast-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.forecast-note { color: #71809a; font-size: 13px; margin-top: 3px; }
.pv-progress { margin: 12px 0 7px; }
.pv-progress > div { background: #ffb719; }
.forecast-result { display: flex; align-items: baseline; gap: 12px; }
.forecast-result strong { font-size: 27px; }
.forecast-result span { color: #71809a; font-size: 13px; }
.forecast-total { text-align: right; min-width: 135px; }
.forecast-total strong { display: block; font-size: 31px; letter-spacing: -.03em; }
.forecast-total span { display: block; color: #71809a; font-size: 12px; margin-top: 2px; }
.range-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 15px;
}
.range-tabs button {
    border: 0;
    border-radius: 13px;
    padding: 10px 6px;
    background: #f1f4f8;
    color: #60718d;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}
.range-tabs button.active { background: #fff0c8; color: #a66a00; }

@media (max-width: 700px) {
    .pv-summary-card { padding: 19px; border-radius: 23px; }
    .pv-summary-main { min-height: 175px; }
    .pv-eyebrow { font-size: 15px; }
    .pv-comparison { font-size: 13px; }
    .pv-metrics { padding: 17px 0; }
    .pv-metric { padding: 0 8px; }
    .pv-metric .metric-value { font-size: 21px; }
    .pv-metric .metric-label { font-size: 12px; }
    .pv-forecast { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; }
    .forecast-icon { width: 46px; height: 46px; }
    .forecast-total { grid-column: 2; text-align: left; min-width: 0; margin-top: -5px; }
    .forecast-total strong { display: inline; font-size: 24px; margin-right: 7px; }
    .forecast-total span { display: inline; font-size: 11px; }
}
.grid-3 { gap: 8px; }
    .metric { padding: 14px; min-height: 118px; }
    .metric-icon { width: 32px; height: 32px; font-size: 17px; margin-bottom: 10px; }
    .flow { grid-template-columns: 1fr 20px 1fr 20px 1fr; }
    .flow-icon { width: 46px; height: 46px; font-size: 22px; }
    .flow-value { font-size: 17px; }
}

@media (max-width: 390px) {
    .update { display: none; }
    
/* Große gemeinsame PV-Übersichtskachel */
.pv-summary-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e7 100%);
    border: 1px solid rgba(238, 218, 165, .65);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 14px;
    box-shadow: 0 8px 28px rgba(35,52,82,.055);
}
.pv-summary-main {
    position: relative;
    min-height: 205px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.pv-eyebrow { color: #64738c; font-size: 17px; font-weight: 600; }
.pv-hero-value {
    margin: 8px 0 9px;
    font-size: clamp(48px, 10vw, 72px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 850;
}
.pv-comparison {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #697a95;
    font-size: 15px;
}
.pv-summary-divider { height: 1px; background: rgba(224, 205, 157, .65); }
.pv-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 0;
}
.pv-metric {
    text-align: center;
    min-width: 0;
    padding: 0 15px;
    border-right: 1px solid rgba(224, 205, 157, .48);
}
.pv-metric:last-child { border-right: 0; }
.pv-metric .metric-icon { margin: 0 auto 10px; }
.pv-metric .metric-value { font-size: clamp(22px, 4.8vw, 31px); }
.pv-metric .metric-note { font-size: 12px; }
.pv-forecast {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
}
.forecast-icon { width: 56px; height: 56px; margin: 0; font-size: 30px; }
.forecast-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.forecast-note { color: #71809a; font-size: 13px; margin-top: 3px; }
.pv-progress { margin: 12px 0 7px; }
.pv-progress > div { background: #ffb719; }
.forecast-result { display: flex; align-items: baseline; gap: 12px; }
.forecast-result strong { font-size: 27px; }
.forecast-result span { color: #71809a; font-size: 13px; }
.forecast-total { text-align: right; min-width: 135px; }
.forecast-total strong { display: block; font-size: 31px; letter-spacing: -.03em; }
.forecast-total span { display: block; color: #71809a; font-size: 12px; margin-top: 2px; }
.range-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin-top: 15px;
}
.range-tabs button {
    border: 0;
    border-radius: 13px;
    padding: 10px 6px;
    background: #f1f4f8;
    color: #60718d;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}
.range-tabs button.active { background: #fff0c8; color: #a66a00; }

@media (max-width: 700px) {
    .pv-summary-card { padding: 19px; border-radius: 23px; }
    .pv-summary-main { min-height: 175px; }
    .pv-eyebrow { font-size: 15px; }
    .pv-comparison { font-size: 13px; }
    .pv-metrics { padding: 17px 0; }
    .pv-metric { padding: 0 8px; }
    .pv-metric .metric-value { font-size: 21px; }
    .pv-metric .metric-label { font-size: 12px; }
    .pv-forecast { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; }
    .forecast-icon { width: 46px; height: 46px; }
    .forecast-total { grid-column: 2; text-align: left; min-width: 0; margin-top: -5px; }
    .forecast-total strong { display: inline; font-size: 24px; margin-right: 7px; }
    .forecast-total span { display: inline; font-size: 11px; }
}
.grid-3 { grid-template-columns: 1fr; }
    .metric { min-height: auto; }
    .hero { align-items: flex-start; }
    .compare-row { grid-template-columns: 1.3fr 1fr 1fr; }
    .compare-row .good { grid-column: 3; }
}


/* ---------------------------------------------------------
   PV-Seite – finale Anordnung
   Keine dekorative Illustration, Prognose ausgewogen
   --------------------------------------------------------- */

.pv-summary-main {
    min-height: 175px;
    justify-content: flex-start;
}

.pv-forecast {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(150px, .75fr) minmax(145px, .65fr);
    align-items: center;
    gap: 24px;
    padding-top: 20px;
}

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

.forecast-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding-left: 20px;
    border-left: 1px solid rgba(224, 205, 157, .48);
}

.forecast-result strong {
    font-size: 30px;
    line-height: 1;
}

.forecast-result span {
    color: #71809a;
    font-size: 12px;
}

.forecast-total {
    min-width: 0;
    text-align: right;
    padding-left: 20px;
    border-left: 1px solid rgba(224, 205, 157, .48);
}

.forecast-total strong {
    display: block;
    font-size: 31px;
    letter-spacing: -.03em;
}

.forecast-total span {
    display: block;
    color: #71809a;
    font-size: 12px;
    margin-top: 3px;
}

@media (max-width: 700px) {
    .pv-summary-main {
        min-height: 150px;
    }

    .pv-forecast {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
        padding-top: 18px;
    }

    .forecast-content {
        grid-column: 1 / -1;
    }

    .forecast-result {
        border-left: 0;
        padding-left: 0;
    }

    .forecast-total {
        border-left: 1px solid rgba(224, 205, 157, .48);
        padding-left: 18px;
        text-align: right;
    }

    .forecast-result strong {
        font-size: 26px;
    }

    .forecast-total strong {
        font-size: 25px;
    }
}

@media (max-width: 390px) {
    .pv-forecast {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .forecast-result {
        padding-left: 0;
    }

    .forecast-total {
        padding-left: 14px;
    }
}
