/* Referenzkunde — Apple-Pastell Lavender (Referenzkunde, Breitnau) */
:root {
    --bg: #ffffff;
    --bg-soft: #f8f6ff;
    --paper: #ffffff;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #64748b;
    --line: #ede9fe;
    --line-soft: #f1edfd;
    --line-strong: #c4b5fd;
    --accent: #7c3aed;
    --accent-deep: #6d28d9;
    --accent-mid: #a78bfa;
    --accent-light: #c4b5fd;
    --accent-soft: #f5f3ff;
    --good: #10b981;
    --good-soft: #ecfdf5;
    --warn: #f59e0b;
    --warn-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --info: #06b6d4;
    --info-soft: #ecfeff;
    --shadow-sm: 0 1px 2px rgba(124,58,237,0.05), 0 4px 12px rgba(124,58,237,0.04);
    --shadow-md: 0 4px 20px rgba(124,58,237,0.08), 0 1px 3px rgba(124,58,237,0.05);
    --shadow-lg: 0 10px 40px rgba(124,58,237,0.12), 0 4px 12px rgba(124,58,237,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv01", "cv11";
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

/* Topbar — sticky glass */
.topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1200px; margin: 0 auto; padding: 16px 32px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--ink);
}
.brand .mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.brand .label {
    font-size: 16px; font-weight: 700; letter-spacing: -0.025em;
    color: var(--ink); line-height: 1.2;
}
.brand .label small {
    display: block; font-size: 11.5px; font-weight: 500;
    color: var(--muted); letter-spacing: 0; margin-top: 2px;
}

.topbar-right {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
    padding: 8px 16px; border-radius: 99px;
    color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
    letter-spacing: -0.01em; transition: all 0.15s;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent); }
.nav a.active {
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.btn-print {
    padding: 8px 18px; border-radius: 99px; border: 1px solid var(--line);
    background: var(--accent-soft); color: var(--accent);
    font-size: 13px; font-weight: 600; cursor: pointer;
    letter-spacing: -0.01em; transition: all 0.15s;
}
.btn-print:hover { background: var(--line); }

.container { max-width: 1200px; margin: 0 auto; padding: 32px; }
.container.wide { max-width: 1600px; }

/* Hero */
.hero {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 48px 56px;
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
}
.eyebrow {
    font-size: 12px; font-weight: 700; color: var(--accent);
    letter-spacing: 0.18em; text-transform: uppercase;
    margin-bottom: 16px; display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
    content: ''; width: 24px; height: 1px; background: var(--accent);
}
.hero h1 {
    font-size: 42px; font-weight: 700; letter-spacing: -0.035em;
    line-height: 1.08; margin-bottom: 18px; color: var(--ink);
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .lead {
    font-size: 18px; color: var(--ink-soft);
    line-height: 1.55; letter-spacing: -0.01em; max-width: 720px;
}
.hero .lead a { font-weight: 600; }

/* Sections */
.section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 36px 40px;
    margin-bottom: 22px;
}
.section h2 {
    font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
    color: var(--ink); margin-bottom: 18px; line-height: 1.2;
    display: flex; align-items: center; gap: 14px;
}
.section h2 .num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 14px; font-weight: 700;
}
.section p, .section li {
    color: var(--ink-soft); line-height: 1.65; font-size: 15px;
}
.section p strong { color: var(--ink); font-weight: 600; }

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Feature cards */
.feature {
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 24px;
    transition: all 0.15s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--accent-light); }
.feature .icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    color: #fff; font-size: 18px; margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.feature h3 {
    font-size: 16px; font-weight: 700; color: var(--ink);
    letter-spacing: -0.015em; margin-bottom: 6px;
}
.feature p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

/* Fact cards (KPI) */
.fact {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    text-align: left;
}
.fact .value {
    font-size: 26px; font-weight: 700; letter-spacing: -0.025em;
    color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums;
}
.fact .value.warn { color: var(--warn); }
.fact .value.good { color: var(--good); }
.fact .label {
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-top: 10px; font-weight: 600;
}
.fact .sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* Timeline */
.timeline { position: relative; padding-left: 32px; margin-top: 18px; }
.timeline::before {
    content: ''; position: absolute;
    left: 11px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 60%, var(--line-strong) 100%);
}
.timeline-item { position: relative; margin-bottom: 22px; padding-left: 8px; }
.timeline-item::before {
    content: ''; position: absolute;
    left: -25px; top: 6px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent-light);
}
.timeline-item.done::before { background: var(--accent); border-color: var(--accent); }
.timeline-item.now::before {
    background: var(--warn); border-color: var(--warn);
    box-shadow: 0 0 0 5px rgba(245,158,11,0.18);
}
.timeline-item.future::before { background: var(--paper); border-color: var(--line-strong); }
.timeline-item .when {
    font-size: 11px; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
}
.timeline-item .what {
    font-size: 16px; color: var(--ink); font-weight: 600;
    margin: 4px 0; letter-spacing: -0.01em;
}
.timeline-item .detail {
    font-size: 14px; color: var(--ink-soft); line-height: 1.6;
}

/* Ask list (numbered to-do) */
.ask {
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 26px;
    margin-top: 16px;
}
.ask ul { list-style: none; padding: 0; margin: 0; }
.ask li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--line-strong);
    color: var(--ink); font-size: 14.5px;
    display: flex; gap: 14px; align-items: flex-start; line-height: 1.55;
}
.ask li:last-child { border-bottom: none; }
.ask li .num {
    flex-shrink: 0;
    min-width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    color: #fff; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
    margin-top: 1px;
    box-shadow: 0 2px 6px rgba(124,58,237,0.25);
}
.ask li strong { color: var(--ink); font-weight: 600; }

/* Contact card */
.contact-card {
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 36px 40px;
    margin-top: 22px;
}
.contact-card h2 {
    font-size: 22px; font-weight: 700; letter-spacing: -0.025em;
    color: var(--ink); margin-bottom: 22px;
}
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-item .label {
    font-size: 11px; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
}
.contact-item .value {
    font-size: 15px; color: var(--ink); font-weight: 600; margin-top: 6px;
    letter-spacing: -0.01em; line-height: 1.5;
}
.contact-item .value a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent-light); }
.contact-item .value a:hover { border-bottom-color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 99px;
    font-weight: 600; font-size: 14.5px;
    text-decoration: none; transition: all 0.15s;
    letter-spacing: -0.01em; border: 1px solid transparent;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,0.3);
    margin-top: 22px;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(124,58,237,0.45); color: #fff; }

/* Footer */
.footer-note {
    text-align: center; margin-top: 32px;
    font-size: 12.5px; color: var(--muted); line-height: 1.6;
    padding: 18px 0;
}

/* Status banner & info banner (messkonzept) */
.status-banner {
    background: var(--warn-soft);
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warn);
    border-radius: 12px;
    padding: 14px 22px; margin-bottom: 18px;
    font-size: 13.5px; color: #78350f; line-height: 1.55;
}
.status-banner strong { color: #b45309; font-weight: 700; }

.info-banner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    padding: 22px 28px; margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.info-banner h2 {
    font-size: 18px; font-weight: 700; color: var(--accent);
    letter-spacing: -0.02em; margin-bottom: 10px;
}
.info-banner p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; margin: 0; }

/* Card (messkonzept content blocks) */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}
.card h3 {
    font-size: 18px; font-weight: 700; color: var(--ink);
    letter-spacing: -0.02em; margin-bottom: 14px;
}
.card h4 {
    font-size: 14px; font-weight: 700; color: var(--ink);
    letter-spacing: -0.015em; margin-bottom: 8px;
}

/* Schaltplan */
.schaltplan {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow-x: auto;
}
.schaltplan h3 {
    font-size: 18px; font-weight: 700; color: var(--ink);
    letter-spacing: -0.02em; margin-bottom: 22px;
}
.spannungsebene {
    border: 1.5px dashed var(--line-strong);
    border-radius: 14px;
    padding: 18px 22px; margin-bottom: 16px; position: relative;
    background: var(--bg-soft);
}
.spannungsebene .label {
    position: absolute; top: -10px; left: 18px;
    background: var(--paper); padding: 0 10px;
    font-size: 11.5px; color: var(--ink-soft); font-weight: 700;
    letter-spacing: 0.04em;
}
.section-label {
    font-size: 11.5px; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin: 18px 0 10px;
}

.flow-row {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 10px; margin: 8px 0;
}
.verbindung-v {
    width: 2px; background: var(--line-strong);
    height: 28px; margin: 0 auto;
}
.sammelschiene {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-mid), var(--accent));
    border-radius: 2px; margin: 14px 0;
    box-shadow: 0 2px 8px rgba(124,58,237,0.2);
}

/* Schaltplan-Nodes (semantic colors preserved, softer pastel) */
.node {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 12px 16px; border-radius: 12px; margin: 4px;
    font-size: 12.5px; min-width: 110px; text-align: center;
    border: 1.5px solid; transition: all 0.15s;
    background: var(--paper);
}
.node:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.node .icon { font-size: 18px; margin-bottom: 4px; }
.node .name { font-weight: 700; font-size: 12px; color: var(--ink); letter-spacing: -0.01em; }
.node .detail { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.35; }
.node .plan-value { font-weight: 700; font-size: 13.5px; margin-top: 6px; letter-spacing: -0.01em; }

.node-netz { border-color: #fca5a5; background: #fef2f2; }
.node-netz .plan-value { color: #dc2626; }
.node-trafo { border-color: #fcd34d; background: #fffbeb; }
.node-trafo .plan-value { color: #d97706; }
.node-pv { border-color: #fde047; background: #fefce8; }
.node-pv .plan-value { color: #ca8a04; }
.node-bhkw { border-color: #fdba74; background: #fff7ed; }
.node-bhkw .plan-value { color: #ea580c; }
.node-bess { border-color: var(--accent-light); background: var(--accent-soft); }
.node-bess .plan-value { color: var(--accent); }
.node-verbrauch { border-color: #93c5fd; background: #eff6ff; }
.node-verbrauch .plan-value { color: #2563eb; }
.node-zaehler { border-color: #67e8f9; background: var(--info-soft); }
.node-zaehler .plan-value { color: #0891b2; }
.node-regler { border-color: #a5b4fc; background: #eef2ff; }
.node-regler .plan-value { color: #4f46e5; }
.node-loxone { border-color: #6ee7b7; background: var(--good-soft); }
.node-loxone .plan-value { color: #059669; }
.node-tbd { border-color: #cbd5e1; background: #f8fafc; border-style: dashed; opacity: 0.75; }
.node-tbd .plan-value { color: var(--muted); }

/* Badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.badge-erzeuger { background: #dcfce7; color: #166534; }
.badge-verbrauch { background: #dbeafe; color: #1e40af; }
.badge-netz { background: #fee2e2; color: #991b1b; }
.badge-speicher { background: var(--accent-soft); color: var(--accent); }
.badge-messung { background: var(--info-soft); color: #075985; }
.badge-tbd { background: #f1f5f9; color: var(--muted); border: 1px dashed #cbd5e1; }

/* Meter table */
.meter-table {
    width: 100%; border-collapse: collapse; margin-top: 14px;
    font-size: 13px;
}
.meter-table th {
    background: linear-gradient(135deg, var(--accent-mid), var(--accent));
    color: #fff; padding: 11px 14px; text-align: left;
    font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.meter-table th:first-child { border-top-left-radius: 8px; }
.meter-table th:last-child { border-top-right-radius: 8px; }
.meter-table td {
    padding: 9px 14px; border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
}
.meter-table td strong { color: var(--ink); font-weight: 600; }
.meter-table tr:hover td { background: var(--accent-soft); }

/* Insight cards (signal grid in messkonzept) */
.insight-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-top: 16px;
}
@media (max-width: 900px) { .insight-grid { grid-template-columns: 1fr; } }
.insight {
    padding: 16px 20px; border-radius: 12px;
    border-left: 4px solid; line-height: 1.55;
}
.insight .ihead { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; letter-spacing: -0.01em; }
.insight .ibody { font-size: 13px; line-height: 1.6; }
.insight.warn  { background: var(--warn-soft);   border-color: var(--warn);   }
.insight.warn .ihead   { color: #b45309; } .insight.warn .ibody   { color: #78350f; }
.insight.danger { background: var(--danger-soft); border-color: var(--danger); }
.insight.danger .ihead { color: #991b1b; } .insight.danger .ibody { color: #7f1d1d; }
.insight.good  { background: var(--good-soft);   border-color: var(--good);   }
.insight.good .ihead   { color: #065f46; } .insight.good .ibody   { color: #064e3b; }
.insight.accent { background: var(--accent-soft); border-color: var(--accent); }
.insight.accent .ihead { color: var(--accent-deep); } .insight.accent .ibody { color: #4c1d95; }
.insight.info  { background: var(--info-soft);   border-color: var(--info);   }
.insight.info .ihead   { color: #075985; } .insight.info .ibody   { color: #164e63; }
.insight.muted { background: #f1f5f9; border-color: #64748b; }
.insight.muted .ihead  { color: #334155; } .insight.muted .ibody  { color: #1e293b; }

/* Hero-callout (Kern-Fragestellung) */
.callout {
    margin-top: 22px; padding: 22px 26px;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
    border: 1.5px solid var(--accent-light);
    border-radius: 14px;
}
.callout h4 {
    font-size: 16px; font-weight: 700; color: var(--accent-deep);
    margin-bottom: 12px; letter-spacing: -0.02em;
}
.callout p {
    font-size: 14px; color: var(--ink); line-height: 1.7; margin-bottom: 10px;
}
.callout p:last-child { margin-bottom: 0; }
.callout p em { color: var(--ink-soft); font-style: italic; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1024px) { .grid-2 { grid-template-columns: 1fr; } }

.fact-grid-mk {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 24px;
}
@media (max-width: 1024px) { .fact-grid-mk { grid-template-columns: repeat(2, 1fr); } }

.footer-note-mk {
    margin-top: 24px; padding: 22px 26px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 12.5px; color: var(--ink-soft); line-height: 1.65;
    box-shadow: var(--shadow-sm);
}
.footer-note-mk strong { color: var(--ink); font-weight: 700; }

@media (max-width: 900px) {
    .container { padding: 22px 18px; }
    .hero { padding: 32px 24px; }
    .hero h1 { font-size: 32px; }
    .section { padding: 24px 22px; }
    .section h2 { font-size: 20px; }
    .contact-card { padding: 24px; }
    .topbar-inner { padding: 14px 18px; }
}

@media print {
    body { background: #fff; }
    .topbar { box-shadow: none; position: static; background: #fff; border-bottom: 2px solid var(--accent); }
    .nav, .btn-print, .btn { display: none !important; }
    .hero, .section, .card, .schaltplan, .info-banner, .contact-card { box-shadow: none; border: 1px solid #e5e7eb; page-break-inside: avoid; }
    .status-banner { display: none; }
}
