/* FlowNova Design System — Dual Theme · Precision Energy Engineering */
:root {
    color-scheme: light dark;
    --se-life-green: #3dcd58;
    --se-dark-green: #009530;
    --se-blue: #0087cd;
    --se-amber: #f5a623;
    --se-red: #e53935;

    --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "IBM Plex Mono", monospace;
    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transition orchestration */
    --theme-speed: 0.55s;
    --theme-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth: cubic-bezier(0.16, 1, 0.3, 1);

    /* === LIGHT THEME (default) === */
    --fn-bg: #f4f5f7;
    --fn-surface: #ffffff;
    --fn-surface-alt: #f0f1f3;
    --fn-border: #e0e3e8;
    --fn-border-subtle: #ebedef;
    --fn-text: #1a2028;
    --fn-text-secondary: #4e5d6c;
    --fn-text-muted: #667282;
    --fn-input-bg: #ffffff;
    --fn-input-border: #d0d4da;
    --fn-overlay: rgba(0, 0, 0, 0.12);
    --fn-node-fill: #ffffff;
    --fn-node-ring: #ebedef;
    --fn-glow: rgba(61, 205, 88, 0.08);
    --fn-header-bg: #1a2028;
    --fn-header-text: #ffffff;
    --fn-bar-bg: #ffffff;
    --fn-bar-seg-bg: #f0f1f3;
    --fn-bar-seg-active-bg: var(--se-life-green);
    --fn-bar-seg-active-text: #1a2028;
    --fn-bar-seg-text: #4e5d6c;
    --fn-bar-select-bg: #ffffff;
    --fn-bar-select-text: #1a2028;
    --fn-bar-select-border: #d0d4da;
    --fn-rec-section-title: var(--se-dark-green);
    --fn-item-bg: #f4f5f7;
    --fn-item-border: #ebedef;
    --fn-check-bg: #f4f5f7;
    --fn-check-border: #d0d4da;
    --fn-check-active-bg: rgba(61, 205, 88, 0.08);
    --fn-check-active-border: var(--se-life-green);
    --fn-check-active-text: var(--se-dark-green);
    --fn-sep-color: var(--se-dark-green);
    --fn-sep-line: rgba(0, 149, 48, 0.15);
    --fn-slider-track: #d0d4da;
    --fn-slider-track-hover: #b0b7c0;
    --fn-slider-value: var(--se-dark-green);
    --fn-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --fn-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --fn-shadow-glow: 0 0 20px rgba(61, 205, 88, 0.06);
    --fn-panel-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    --fn-hint-text: #1a2028;
    --fn-wizard-bg: rgba(26, 32, 40, 0.6);
    --fn-wizard-card-bg: #ffffff;
    --fn-wizard-card-border: #e0e3e8;
    --fn-wizard-card-hover-bg: rgba(61, 205, 88, 0.04);
    --fn-wizard-title: #1a2028;
    --fn-wizard-desc: #4e5d6c;
    --fn-wizard-icon-filter: none;
    --fn-stepper-bg: #ffffff;
    --fn-stepper-border: #d0d4da;
    --fn-arrow-color: %234E5D6C; /* biome-ignore parse: URL-encoded hex for SVG */
    --fn-building-color: #586574;
    --fn-ev-color: #9c27b0;
    --fn-dot-color: rgba(0, 0, 0, 0.04);
    --fn-rec-header-glow: rgba(61, 205, 88, 0.1);
    --fn-section-anchor-bg: rgba(0, 149, 48, 0.03);
}

/* === DARK THEME === */
[data-theme="dark"] {
    --fn-bg: #141a21;
    --fn-surface: #252d36;
    --fn-surface-alt: rgba(255, 255, 255, 0.04);
    --fn-border: rgba(255, 255, 255, 0.06);
    --fn-border-subtle: rgba(255, 255, 255, 0.04);
    --fn-text: #e8eaed;
    --fn-text-secondary: #b0b7c0;
    --fn-text-muted: #8a95a3;
    --fn-input-bg: rgba(255, 255, 255, 0.06);
    --fn-input-border: rgba(255, 255, 255, 0.1);
    --fn-overlay: rgba(0, 0, 0, 0.4);
    --fn-node-fill: #1e2630;
    --fn-node-ring: rgba(255, 255, 255, 0.08);
    --fn-glow: rgba(61, 205, 88, 0.12);
    --fn-header-bg: #252d36;
    --fn-header-text: #ffffff;
    --fn-bar-bg: #252d36;
    --fn-bar-seg-bg: rgba(255, 255, 255, 0.06);
    --fn-bar-seg-active-bg: var(--se-life-green);
    --fn-bar-seg-active-text: #141a21;
    --fn-bar-seg-text: #b0b7c0;
    --fn-bar-select-bg: rgba(255, 255, 255, 0.06);
    --fn-bar-select-text: #e8eaed;
    --fn-bar-select-border: rgba(255, 255, 255, 0.1);
    --fn-rec-section-title: var(--se-life-green);
    --fn-item-bg: rgba(255, 255, 255, 0.04);
    --fn-item-border: rgba(255, 255, 255, 0.04);
    --fn-check-bg: rgba(255, 255, 255, 0.04);
    --fn-check-border: rgba(255, 255, 255, 0.1);
    --fn-check-active-bg: rgba(61, 205, 88, 0.12);
    --fn-check-active-border: var(--se-life-green);
    --fn-check-active-text: var(--se-life-green);
    --fn-sep-color: var(--se-life-green);
    --fn-sep-line: rgba(61, 205, 88, 0.2);
    --fn-slider-track: rgba(255, 255, 255, 0.18);
    --fn-slider-track-hover: rgba(255, 255, 255, 0.25);
    --fn-slider-value: var(--se-life-green);
    --fn-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --fn-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --fn-shadow-glow: 0 0 24px rgba(61, 205, 88, 0.15);
    --fn-panel-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    --fn-hint-text: #e8eaed;
    --fn-wizard-bg: rgba(10, 14, 18, 0.88);
    --fn-wizard-card-bg: rgba(255, 255, 255, 0.03);
    --fn-wizard-card-border: rgba(255, 255, 255, 0.08);
    --fn-wizard-card-hover-bg: rgba(61, 205, 88, 0.06);
    --fn-wizard-title: #ffffff;
    --fn-wizard-desc: #b0b7c0;
    --fn-wizard-icon-filter: saturate(1.2);
    --fn-stepper-bg: rgba(255, 255, 255, 0.06);
    --fn-stepper-border: rgba(255, 255, 255, 0.15);
    --fn-arrow-color: %23B0B7C0; /* biome-ignore parse: URL-encoded hex for SVG */
    --fn-building-color: #9ba5b0;
    --fn-ev-color: #c06cd0;
    --fn-dot-color: rgba(255, 255, 255, 0.03);
    --fn-rec-header-glow: rgba(61, 205, 88, 0.2);
    --fn-section-anchor-bg: rgba(61, 205, 88, 0.04);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* === ORCHESTRATED THEME CROSSFADE === */
body {
    font-family: var(--font-sans);
    background: var(--fn-bg);
    color: var(--fn-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    transition:
        background var(--theme-speed) var(--theme-ease),
        color var(--theme-speed) var(--theme-ease);
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 999;
    background: var(--se-life-green);
    color: #1a2028;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Force dense dashboard zoom on desktop screens
   Simulates 80% browser zoom to fit diagram and charts vertically
   without scrolling, while creating graceful left/right margins. */
@media (min-width: 1024px) {
    body {
        zoom: 0.8;
    }
}

/* Orchestrated theme crossfade — staggered for visual depth */
.header,
.global-bar {
    transition:
        background var(--theme-speed) var(--theme-ease),
        border-color var(--theme-speed) var(--theme-ease),
        box-shadow var(--theme-speed) var(--theme-ease),
        color var(--theme-speed) var(--theme-ease);
}
.diagram-container,
.recommendation {
    transition:
        background calc(var(--theme-speed) + 0.05s) var(--theme-ease),
        border-color var(--theme-speed) var(--theme-ease),
        box-shadow calc(var(--theme-speed) + 0.1s) var(--theme-ease),
        color var(--theme-speed) var(--theme-ease);
}
.detail-panel,
.wizard,
.rec-header {
    transition:
        background calc(var(--theme-speed) + 0.08s) var(--theme-ease),
        border-color var(--theme-speed) var(--theme-ease),
        box-shadow var(--theme-speed) var(--theme-ease),
        color var(--theme-speed) var(--theme-ease);
}
.rec-section,
.rec-item,
.hint,
.time-controls,
.time-display {
    transition:
        background calc(var(--theme-speed) + 0.12s) var(--theme-ease),
        border-color var(--theme-speed) var(--theme-ease),
        box-shadow var(--theme-speed) var(--theme-ease),
        color calc(var(--theme-speed) + 0.05s) var(--theme-ease);
}

/* ========== Header ========== */
.header {
    background: linear-gradient(
        180deg,
        var(--fn-header-bg) 0%,
        color-mix(in srgb, var(--fn-header-bg) 92%, black) 100%
    );
    color: var(--fn-header-text);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--se-life-green);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.15),
        0 0 24px rgba(61, 205, 88, 0.06);
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo {
    background: linear-gradient(135deg, var(--se-life-green) 0%, var(--se-dark-green) 100%);
    color: #0a1a0f;
    font-weight: 800;
    font-size: 14px;
    padding: 5px 9px;
    border-radius: 6px;
    letter-spacing: -0.5px;
    box-shadow:
        0 0 16px rgba(61, 205, 88, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.25);
    animation: logoGlow 3s ease-in-out infinite alternate;
}
@keyframes logoGlow {
    0% {
        box-shadow:
            0 0 12px rgba(61, 205, 88, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.25);
    }
    100% {
        box-shadow:
            0 0 20px rgba(61, 205, 88, 0.55),
            0 2px 4px rgba(0, 0, 0, 0.25);
    }
}
.header h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--theme-ease);
    font-family: var(--font-sans);
}
.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--se-life-green);
}
.header-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}
.header-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(61, 205, 88, 0.12);
    border: 1px solid rgba(61, 205, 88, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    color: var(--se-life-green);
}

/* ========== Global Bar — Refined Control Strip ========== */
.global-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    background: var(--fn-bar-bg);
    border-bottom: 1px solid var(--fn-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    max-width: 1440px;
    margin: 0 auto;
    flex-wrap: wrap;
    position: relative;
}
.global-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.global-group > label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fn-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.global-group .segmented-control {
    padding: 2px;
    gap: 2px;
    background: var(--fn-bar-seg-bg);
}
.global-group .seg-btn {
    padding: 6px 14px;
    font-size: 12px;
    color: var(--fn-bar-seg-text);
}
.global-group .seg-btn.active {
    background: var(--fn-bar-seg-active-bg);
    color: var(--fn-bar-seg-active-text);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(61, 205, 88, 0.25);
}
.global-group select {
    width: auto;
    min-width: 180px;
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    background: var(--fn-bar-select-bg);
    border-color: var(--fn-bar-select-border);
    color: var(--fn-bar-select-text);
}

/* ========== Layout — Single Column, Scroll-Based ========== */
.main {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    background: var(--fn-bg);
}

/* Top area: Diagram + Charts side by side on desktop */
.main-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--fn-border);
}
@media (min-width: 1024px) {
    .main-top {
        height: calc(100vh - 46px);
        overflow: hidden;
    }
    /* Diagram SVG should scale to fill container */
    .energy-diagram {
        flex: 1;
        min-height: 0;
        height: 0;
    }
}

/* Tooltip */
.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--fn-surface-alt);
    color: var(--fn-text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}
.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fn-header-bg);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    width: max-content;
    max-width: 260px;
    z-index: 50;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tooltip:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--fn-header-bg);
    z-index: 50;
}
/* Touch: tap toggles tooltip via focus */
@media (hover: none) {
    .tooltip {
        cursor: pointer;
    }
    .tooltip:focus::after {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--fn-header-bg);
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.4;
        width: max-content;
        max-width: 260px;
        z-index: 50;
        white-space: normal;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    .tooltip:focus::before {
        content: "";
        position: absolute;
        bottom: calc(100% + 2px);
        left: 50%;
        transform: translateX(-50%);
        border: 4px solid transparent;
        border-top-color: var(--fn-header-bg);
        z-index: 50;
    }
}

/* ========== Segmented Control (global bar) ========== */
.segmented-control {
    display: flex;
    background: var(--fn-bar-seg-bg);
    border-radius: var(--radius);
    padding: 3px;
    gap: 3px;
}
.seg-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--fn-text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--theme-ease);
}
.seg-btn.active {
    background: var(--fn-bar-seg-active-bg);
    color: var(--fn-bar-seg-active-text);
    box-shadow: 0 1px 4px rgba(61, 205, 88, 0.2);
    font-weight: 600;
}
.seg-btn:hover:not(.active) {
    color: var(--fn-text);
}
.seg-btn:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 2px;
}

/* ========== Stepper (used by panel-stepper-row) ========== */
.stepper-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--fn-stepper-border);
    background: var(--fn-stepper-bg);
    border-radius: 6px;
    font-size: 18px;
    font-weight: 500;
    color: var(--fn-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.stepper-btn:hover:not(:disabled) {
    border-color: var(--se-life-green);
    color: var(--se-dark-green);
}
.stepper-btn:active:not(:disabled) {
    background: var(--fn-surface-alt);
    transform: scale(0.95);
}
.stepper-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.stepper-btn:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 2px;
}
.stepper-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}
/* ========== Dropdown ========== */
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--fn-input-border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--fn-text);
    background: var(--fn-input-bg);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23586574' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
select:focus {
    outline: none;
    border-color: var(--se-life-green);
    box-shadow: 0 0 0 2px rgba(61, 205, 88, 0.2);
}

/* ========== Recommendation — Full Width Flow ========== */
.recommendation {
    background: var(--fn-surface);
    border-top: 1px solid var(--fn-border);
}

/* === Compact Metrics Strip === */
.rec-strip {
    padding: 14px 24px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid var(--fn-border);
    position: relative;
}
.rec-strip::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    background: linear-gradient(180deg, var(--se-life-green), var(--se-dark-green));
    border-radius: 0 4px 4px 0;
}
.rec-strip-headline {
    flex-shrink: 0;
    min-width: 200px;
    border-left: 3px solid var(--se-life-green);
    padding-left: 14px;
}
.optimize-action-bar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 166, 35, 0.1);
    border: 1px dashed var(--se-amber);
    padding: 12px 20px;
    border-radius: 8px;
    animation: optimizePulse 2s infinite;
}
.optimize-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--fn-text);
}
.optimize-btn {
    background: linear-gradient(135deg, var(--se-life-green), var(--se-dark-green));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s var(--spring);
    box-shadow: 0 4px 12px rgba(61, 205, 88, 0.3);
}
.optimize-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(61, 205, 88, 0.4);
}
.optimize-btn:active {
    transform: scale(0.95);
}
@keyframes optimizePulse {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(245, 166, 35, 0);
    }
    50% {
        box-shadow: 0 0 14px rgba(245, 166, 35, 0.25);
    }
}
.rec-strip-metrics {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}
/* === XAI Rationale (Begründung) === */
.rec-reasons-list {
    flex-basis: 100%;
    list-style: none;
    padding: 0;
    margin-top: 16px;
    border-top: 1px dashed var(--fn-sep-line);
    padding-top: 12px;
}
.rec-reasons-list li {
    font-size: 13px;
    color: var(--fn-text);
    line-height: 1.5;
    margin-bottom: 8px;
    position: relative;
    padding-left: 24px;
}
.rec-reasons-list li::before {
    content: "\2713"; /* Checkmark */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--se-life-green);
    font-weight: bold;
    font-size: 14px;
}
.rec-reasons-list:empty {
    display: none;
}

/* === Auswertung Toggle Button === */
.rec-details-toggle-wrap {
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--fn-border);
}
.rec-details-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid var(--fn-border);
    border-radius: 10px;
    background: var(--fn-surface-alt);
    color: var(--fn-text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--spring);
    letter-spacing: 0.3px;
}
.rec-details-toggle:hover {
    background: rgba(61, 205, 88, 0.06);
    border-color: var(--se-life-green);
    color: var(--se-dark-green);
    box-shadow: 0 2px 8px rgba(61, 205, 88, 0.1);
}
[data-theme="dark"] .rec-details-toggle:hover {
    color: var(--se-life-green);
}
.rec-details-toggle:active {
    transform: scale(0.98);
    transition-duration: 80ms;
}
.rec-details-toggle-icon {
    font-size: 10px;
    transition: transform 0.3s var(--spring);
}
.rec-details-toggle.open .rec-details-toggle-icon {
    transform: rotate(180deg);
}

/* === Collapsible Details === */
.rec-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--smooth);
}
.rec-details-inner {
    overflow: hidden;
    min-height: 0;
}
.rec-details.open {
    grid-template-rows: 1fr;
}
.rec-details.open .rec-details-inner {
    border-top: 1px solid var(--fn-border);
}

/* === REC HEADER === */
.rec-header {
    position: relative;
}
.rec-header::before {
    display: none;
}
.rec-header::after {
    display: none;
}
.rec-header.pulse .rec-subtitle {
    animation: recValueFlash 0.4s var(--spring);
}
@keyframes recValueFlash {
    0% {
        color: var(--fn-text);
    }
    40% {
        color: var(--se-life-green);
    }
    100% {
        color: var(--fn-text);
    }
}
.rec-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--fn-text-muted);
    position: relative;
}
.rec-subtitle {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-top: 4px;
    font-family: var(--font-sans);
    position: relative;
    line-height: 1.3;
    color: var(--fn-text);
    text-wrap: balance;
}
/* Green accent on the value portion */
.rec-subtitle .rec-value-highlight {
    color: var(--se-dark-green);
}
[data-theme="dark"] .rec-subtitle .rec-value-highlight {
    color: var(--se-life-green);
}

/* === REC SECTIONS — Visual Anchors === */
.rec-section {
    padding: 14px 24px;
    border-bottom: 1px solid var(--fn-border);
    position: relative;
}
.rec-section:last-child {
    border-bottom: none;
}
.rec-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--fn-rec-section-title);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fn-sep-line);
}
.rec-section h3::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--se-life-green);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(61, 205, 88, 0.5);
    animation: sectionDotPulse 2s ease-in-out infinite;
}
@keyframes sectionDotPulse {
    0%,
    100% {
        box-shadow: 0 0 6px rgba(61, 205, 88, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(61, 205, 88, 0.7);
    }
}

/* Sizing grid */
.rec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rec-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.rec-item {
    background: var(--fn-item-bg);
    border-radius: 10px;
    padding: 14px 14px 12px;
    border: 1px solid var(--fn-item-border);
    border-left: 3px solid rgba(61, 205, 88, 0.25);
    transition: all 0.25s var(--spring);
}
.rec-item:hover {
    border-color: rgba(61, 205, 88, 0.2);
    border-left-color: var(--se-life-green);
    box-shadow:
        0 6px 16px rgba(61, 205, 88, 0.12),
        0 0 0 1px rgba(61, 205, 88, 0.06);
    transform: translateY(-3px);
}
.rec-item-label {
    font-size: 10px;
    color: var(--fn-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
}
/* KPI mit Erklärung: Hilfe-Cursor + dezente gepunktete Unterlinie am Label */
.rec-item-info {
    cursor: help;
}
.rec-item-info .rec-item-label {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    text-decoration-color: var(--fn-text-secondary);
}
.rec-item-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--fn-text);
    letter-spacing: -0.5px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease, transform 0.3s ease;
}
.rec-item:hover .rec-item-value {
    color: var(--se-life-green);
    transform: scale(1.05);
}

/* Hints */
.hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}
.hint-info {
    border-left-color: var(--se-blue);
}
.hint-warning {
    border-left-color: var(--se-amber);
}
.hint-critical {
    border-left-color: var(--se-red);
}
.hint:last-child {
    margin-bottom: 0;
}
.hint-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.hint-info {
    background: rgba(0, 135, 205, 0.08);
    color: var(--fn-hint-text);
}
.hint-info .hint-dot {
    background: var(--se-blue);
    box-shadow: 0 0 6px rgba(0, 135, 205, 0.3);
}
.hint-warning {
    background: rgba(245, 166, 35, 0.1);
    color: var(--fn-hint-text);
}
.hint-warning .hint-dot {
    background: var(--se-amber);
    box-shadow: 0 0 6px rgba(245, 166, 35, 0.3);
}
.hint-critical {
    background: rgba(229, 57, 53, 0.1);
    color: var(--fn-hint-text);
}
.hint-critical .hint-dot {
    background: var(--se-red);
    box-shadow: 0 0 6px rgba(229, 57, 53, 0.3);
}

/* Komponentenliste */
.rec-komponentenliste {
    list-style: none;
    font-size: 12px;
    font-family: var(--font-mono);
}
.rec-komponentenliste li {
    padding: 8px 0;
    color: var(--fn-text);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--fn-border-subtle);
    transition: all 0.15s;
}
.rec-komponentenliste li:hover {
    background: var(--fn-surface-alt);
    margin: 0 -8px;
    padding: 8px 8px;
    border-radius: 6px;
}
.rec-komponentenliste li:last-child {
    border-bottom: none;
}
.komp-ref {
    color: var(--fn-text-muted);
    font-size: 11px;
}

/* Auto-suggestions */
.rec-vorschlaege-list:empty {
    display: none;
}
.rec-vorschlaege-list:empty + .rec-section {
    border-top: none;
}
#rec-vorschlaege-section:has(.rec-vorschlaege-list:empty) {
    display: none;
}

/* Warnings empty state */
.rec-warnungen-list:empty::after {
    content: "Keine Warnungen";
    color: var(--fn-text-muted);
    font-size: 12px;
}

/* ========== Energy Flow Diagram — Premium Container ========== */
.diagram-container {
    background: var(--fn-surface);
    background-image:
        radial-gradient(ellipse at 50% 10%, var(--fn-glow) 0%, transparent 50%),
        radial-gradient(circle, var(--fn-dot-color) 0.5px, transparent 0.5px);
    background-size:
        100% 100%,
        18px 18px;
    background-position:
        0 0,
        9px 9px;
    padding: 4px 12px;
    position: relative;
    border-right: 1px solid var(--fn-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
/* Sparkline chart */
.sparkline-chart {
    width: 100%;
    height: auto;
    max-height: 140px;
    border: 1px solid var(--fn-border);
    border-radius: 6px;
    background: var(--fn-surface-alt);
    margin-top: 8px;
}

.level3-hint {
    background: rgba(229, 57, 53, 0.08);
    color: var(--se-red);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(229, 57, 53, 0.2);
    margin-bottom: 8px;
    text-align: center;
}
.diagram-hint {
    text-align: center;
    font-size: 11px;
    color: var(--fn-text-secondary);
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 2px 16px 0;
    order: 10;
    flex-shrink: 0;
}
.diagram-hint.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}
.energy-diagram {
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
}

/* Nav hint: hidden — redundant with diagram-hint, caused text collision */
.diagram-nav-hint {
    display: none;
}

/* === DIAGRAM MICRO-INTERACTIONS — Satisfying Feedback === */

/* Nodes: enhanced scale + glow with spring physics */
.energy-diagram .node {
    transition:
        opacity 300ms ease,
        filter 350ms var(--spring),
        transform 350ms var(--spring);
    transform-origin: center;
    cursor: pointer;
}
.energy-diagram .node:hover {
    filter: drop-shadow(0 0 20px rgba(61, 205, 88, 0.45)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
    transform: scale(1.1);
}
.energy-diagram .node:active {
    filter: drop-shadow(0 0 10px rgba(61, 205, 88, 0.3));
    transform: scale(0.92);
    transition-duration: 80ms;
}
.energy-diagram .node:focus {
    outline: 2px solid transparent;
}
.energy-diagram .node:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 8px;
    filter: drop-shadow(0 0 14px rgba(61, 205, 88, 0.4));
}
.energy-diagram .node:active circle:first-child {
    transform: scale(0.92);
    transition: transform 0.1s ease;
}
.energy-diagram .node.active-node {
    filter: drop-shadow(0 0 18px rgba(61, 205, 88, 0.55)) drop-shadow(0 0 8px rgba(61, 205, 88, 0.3));
    animation: nodeActivePulse 2s ease-in-out infinite;
}
/* Steuerbox: matching interaction */
.energy-diagram .steuerbox-node:hover rect:first-of-type {
    stroke-width: 2.5;
    filter: url(#ctrl-box-shadow) drop-shadow(0 0 6px rgba(0, 135, 205, 0.25));
}
.energy-diagram .stealerbox-node:active rect:first-of-type {
    transform: scale(0.97);
}
@keyframes nodeActivePulse {
    0%,
    100% {
        filter: drop-shadow(0 0 14px rgba(61, 205, 88, 0.45));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 26px rgba(61, 205, 88, 0.7));
        transform: scale(1.03);
    }
}

/* Flow glow underlay */
.energy-diagram .flow-glow {
    pointer-events: none;
    transition:
        opacity 500ms ease,
        stroke-width 500ms ease;
}
/* Flow lines: glow effect + smoother animation */
.energy-diagram .flow-line {
    stroke-linecap: round;
    transition:
        opacity 400ms ease,
        stroke-width 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.energy-diagram .flow-line.active {
    animation: dash-flow 0.8s linear infinite;
    filter: drop-shadow(0 0 4px rgba(61, 205, 88, 0.35));
}
.energy-diagram .flow-line.reverse {
    animation: dash-flow 0.8s linear infinite reverse;
    filter: drop-shadow(0 0 4px rgba(61, 205, 88, 0.35));
}

/* SOC ring: smooth with glow */
.energy-diagram #soc-ring {
    transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 6px rgba(61, 205, 88, 0.5));
}

/* === Time Controls — Polished Playback Bar === */
.time-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    margin: 0 -12px;
    background: var(--fn-surface-alt);
    border-top: 1px solid var(--fn-border);
    border-radius: 0;
    order: 20;
    touch-action: manipulation;
    flex-shrink: 0;
}
.time-play-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--se-life-green) 0%, var(--se-dark-green) 100%);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--spring);
    box-shadow:
        0 2px 12px rgba(61, 205, 88, 0.35),
        0 0 0 3px rgba(61, 205, 88, 0.08);
    flex-shrink: 0;
    position: relative;
}
.time-play-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(61, 205, 88, 0.15);
    transition: all 0.3s var(--spring);
}
.time-play-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 20px rgba(61, 205, 88, 0.5);
}
.time-play-btn:hover::after {
    inset: -5px;
    border-color: rgba(61, 205, 88, 0.3);
}
.time-play-btn:active {
    transform: scale(0.9);
    transition-duration: 80ms;
}
.time-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--fn-slider-track);
    border-radius: 3px;
    outline: none;
    transition: background 0.15s;
    touch-action: manipulation;
}
.time-slider:hover {
    background: var(--fn-slider-track-hover);
}
.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--se-life-green);
    cursor: grab;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(61, 205, 88, 0.35);
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s;
}
.time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 2px 14px rgba(61, 205, 88, 0.5);
}
.time-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}
.time-display {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--se-dark-green);
    min-width: 60px;
    text-align: center;
    background: rgba(61, 205, 88, 0.08);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(61, 205, 88, 0.15);
    letter-spacing: -0.5px;
}
[data-theme="dark"] .time-display {
    color: var(--se-life-green);
    background: rgba(61, 205, 88, 0.12);
    border-color: rgba(61, 205, 88, 0.2);
}
.time-speed {
    width: auto;
    min-width: 80px;
    min-height: 40px; /* Tap-Target-Ergonomie */
    padding: 9px 24px 9px 10px;
    font-size: 12px;
    border: 1px solid var(--fn-input-border);
    border-radius: 6px;
    background: var(--fn-input-bg);
    color: var(--fn-text);
    appearance: none;
    cursor: pointer;
    font-family: var(--font-sans);
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%234E5D6C' stroke-width='1.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
[data-theme="dark"] .time-speed {
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23B0B7C0' stroke-width='1.2'/%3E%3C/svg%3E");
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -24;
    }
}
.energy-diagram .flow-line.active {
    animation: dash-flow 1s linear infinite;
}
.energy-diagram .flow-line.reverse {
    animation: dash-flow 1s linear infinite reverse;
}

/* ========== Backdrop — Refined Blur ========== */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: var(--fn-overlay);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--theme-ease);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.panel-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========== Detail Panel — Smooth Spring Physics ========== */
.detail-panel {
    position: fixed;
    top: 52px;
    right: -420px;
    width: 380px;
    max-height: calc(100vh - 60px);
    background: var(--fn-surface);
    box-shadow: var(--fn-panel-shadow);
    scrollbar-width: thin;
    scrollbar-color: var(--se-life-green) transparent;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    overflow-y: auto;
    z-index: 200;
    border-left: 1px solid var(--fn-border);
    transition:
        right 0.45s var(--smooth),
        opacity 0.3s ease,
        transform 0.45s var(--smooth);
    opacity: 0;
    transform: translateX(20px);
    overscroll-behavior: contain;
}
.detail-panel.open {
    right: 0;
    opacity: 1;
    transform: translateX(0);
}
.detail-panel::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--fn-surface), transparent);
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 0 var(--radius-lg);
}
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-left: 3px solid var(--se-life-green);
    border-bottom: 1px solid var(--fn-border);
    background: linear-gradient(135deg, var(--fn-glow), transparent 60%);
}
.detail-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--fn-text);
}
.detail-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--fn-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}
.detail-close:hover {
    background: var(--fn-surface-alt);
    color: var(--fn-text);
    transform: scale(1.1);
}
.detail-close:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 2px;
}
.detail-body {
    padding: 16px 20px;
}

.panel-config-separator {
    grid-column: 1 / -1;
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--se-life-green);
    font-size: 11px;
    font-weight: 700;
    color: var(--se-life-green);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--fn-border-subtle);
    font-size: 13px;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    color: var(--fn-text-secondary);
}
.detail-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--fn-text);
}
.detail-critical .detail-value {
    color: var(--se-red);
    font-weight: 600;
}
.detail-warning .detail-value {
    color: var(--se-amber);
    font-weight: 600;
}
.detail-info .detail-value {
    color: var(--se-blue);
}

/* Panel config zone */
.panel-config-zone {
    margin-bottom: 0;
}
.panel-field {
    margin-bottom: 12px;
}
.panel-field:last-child {
    margin-bottom: 0;
}
.panel-field > label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fn-text-secondary);
    margin-bottom: 4px;
}
.panel-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--fn-slider-track);
    border-radius: 3px;
    outline: none;
    transition: background 0.15s;
    accent-color: var(--se-life-green);
}
.panel-slider:hover {
    background: var(--fn-slider-track-hover);
}
.panel-slider:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 4px;
}
.panel-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--se-life-green);
    cursor: grab;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s;
}
.panel-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(61, 205, 88, 0.4);
}
.panel-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}
.panel-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--se-life-green);
    cursor: grab;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.panel-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}
.panel-slider::-moz-range-thumb:active {
    cursor: grabbing;
}
.detail-panel input[type="range"] {
    accent-color: var(--se-life-green);
}
.detail-panel input[type="range"]::-webkit-slider-runnable-track {
    background: var(--fn-border);
    height: 4px;
    border-radius: 2px;
}
.detail-panel input[type="range"]::-moz-range-track {
    background: var(--fn-border);
    height: 4px;
    border-radius: 2px;
}
.panel-slider-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    min-width: 70px;
    text-align: right;
    color: var(--fn-slider-value);
}
.panel-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--fn-input-border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--fn-text);
    background: var(--fn-input-bg);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23B0B7C0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.panel-toggle {
    display: flex;
    background: var(--fn-bar-seg-bg);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.panel-toggle-btn {
    flex: 1;
    padding: 6px 8px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--fn-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.panel-toggle-btn.active {
    background: var(--fn-bar-seg-active-bg);
    color: var(--fn-bar-seg-active-text);
    box-shadow: none;
    font-weight: 700;
}
.panel-stepper-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-stepper-row .stepper-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    min-width: 36px;
}
.panel-stepper-row .stepper-value {
    font-size: 16px;
    min-width: 32px;
    font-weight: 700;
}

/* Panel hint text */
.panel-hint {
    font-size: 11px;
    color: var(--fn-text-muted);
    margin-top: 3px;
}

/* Panel checkboxes */
.panel-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.panel-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid var(--fn-check-border);
    background: var(--fn-check-bg);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    color: var(--fn-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.panel-checkbox.checked {
    background: var(--fn-check-active-bg);
    border-color: var(--fn-check-active-border);
    color: var(--fn-check-active-text);
    font-weight: 600;
}
.panel-checkbox input[type="checkbox"] {
    accent-color: var(--se-life-green);
    width: 14px;
    height: 14px;
}

/* Separator between config and results */
.panel-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    color: var(--fn-sep-color);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}
.panel-separator::before,
.panel-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--fn-sep-line);
}

/* Override slider */
.detail-override {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--fn-border);
}
.detail-override label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fn-text-secondary);
    margin-bottom: 8px;
}
.override-slider {
    width: calc(100% - 50px);
    vertical-align: middle;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--fn-slider-track);
    border-radius: 3px;
    outline: none;
}
.override-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--se-life-green);
    cursor: pointer;
    border: 2px solid var(--fn-surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.override-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--se-life-green);
    cursor: pointer;
    border: 2px solid var(--fn-surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.override-value {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
    vertical-align: middle;
}
.override-hint {
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}
.override-hint.warning {
    color: var(--se-amber);
}
.override-hint.info {
    color: var(--se-blue);
}
.override-hint.critical {
    color: var(--se-red);
}
.override-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.override-reg {
    margin-top: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
}
.override-reg-item {
    padding: 2px 0;
    color: var(--fn-text-muted);
}

/* ========== Responsive: Tablet (<=1200px) ========== */
@media (max-width: 1200px) and (min-width: 701px) {
    .global-bar {
        padding: 8px 16px;
        gap: 12px;
    }
    .main-top {
        grid-template-columns: 1fr 1fr;
    }
    .rec-strip {
        flex-direction: column;
        gap: 12px;
    }
    .rec-strip-headline {
        min-width: 0;
    }

    /* Detail panel -> bottom sheet */
    .detail-panel {
        width: 100%;
        right: 0;
        bottom: -100vh;
        top: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 75vh;
        transition:
            bottom 0.4s cubic-bezier(0.32, 1.2, 0.5, 1),
            opacity 0.3s ease;
    }
    .detail-panel.open {
        bottom: 0;
        right: 0;
    }
    .detail-panel::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: var(--fn-text-muted);
        border-radius: 2px;
        margin: 10px auto 6px;
        opacity: 0.4;
    }

    /* Tablet: tighter KPI sizing */
    .fn-kpi-value {
        font-size: 20px;
    }
    .fn-kpi-label {
        font-size: 9px;
    }

    /* Tablet: rec items */
    .rec-item-value {
        font-size: 16px;
    }

    /* Tablet: charts */
    .fn-charts-wrap {
        padding: 6px 12px 8px;
    }
}

/* ========== Responsive: Mobile (<=700px) — Premium Mobile ========== */
@media (max-width: 700px) {
    .main {
        padding: 0;
    }
    .main-top {
        grid-template-columns: 1fr;
    }
    .diagram-container {
        border-right: none;
        border-bottom: 1px solid var(--fn-border);
        min-height: 300px;
        overflow: visible;
    }
    .rec-strip {
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
    }
    .rec-strip-headline {
        min-width: 0;
    }
    .rec-strip-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .rec-section {
        padding: 14px 16px;
    }
    .rec-details-toggle-wrap {
        padding: 10px 16px;
    }

    /* Header: compact but premium */
    .header {
        padding: 10px 14px;
    }
    .header h1 {
        font-size: 15px;
    }
    .header-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    .header-badge {
        display: none;
    }

    /* Global bar: styled horizontal scroll with fade edges */
    .global-bar {
        padding: 10px 14px;
        gap: 14px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        position: relative;
        border-bottom: 1px solid var(--fn-border);
        /* Fade edges to indicate scroll */
        mask-image: linear-gradient(90deg, transparent 0px, black 14px, black calc(100% - 20px), transparent);
        -webkit-mask-image: linear-gradient(90deg, transparent 0px, black 14px, black calc(100% - 20px), transparent);
    }
    .global-bar::-webkit-scrollbar {
        display: none;
    }
    .global-group {
        flex-shrink: 0;
    }
    .global-group .seg-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 40px;
        border-radius: 8px;
    }

    /* Diagram: fill available space */
    .diagram-container {
        padding: 4px 4px 0;
    }

    /* Time controls: better ergonomics */
    .time-controls {
        padding: 10px 10px;
        gap: 8px;
        margin: 0 -6px;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        flex-wrap: nowrap;
    }
    .time-play-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
        flex-shrink: 0;
    }
    .time-play-btn::after {
        inset: -2px;
    }
    .time-display {
        font-size: 14px;
        min-width: 52px;
        padding: 6px 8px;
    }
    .time-speed {
        min-width: 68px;
        min-height: 40px;
        font-size: 11px;
        padding: 9px 20px 9px 8px;
    }

    /* Diagram hint: compact */
    .diagram-hint {
        font-size: 11px;
        padding: 4px 8px 2px;
    }

    /* Rec card: compact mobile */
    .rec-section {
        padding: 18px 16px;
    }
    .rec-section h3 {
        font-size: 10px;
        letter-spacing: 1.4px;
    }
    .rec-details-toggle-wrap {
        padding: 0 16px 14px;
    }
    .rec-grid {
        gap: 8px;
    }
    .rec-item {
        padding: 14px 12px 12px;
    }
    .rec-item-value {
        font-size: 16px;
    }
    .rec-title {
        font-size: 11px;
        letter-spacing: 1.2px;
    }
    .rec-subtitle {
        font-size: 18px;
    }
    .rec-title {
        font-size: 9px;
    }
    .rec-subtitle {
        font-size: 15px;
    }

    /* Bottom sheet: larger for mobile */
    .detail-panel {
        max-height: 85vh;
    }

    /* Panel inputs: larger touch targets */
    .panel-stepper-row .stepper-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
        min-width: 44px;
    }
    .panel-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    .panel-checkbox {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    /* Wizard: premium bottom sheet */
    .wizard-overlay {
        align-items: flex-end;
    }
    .wizard {
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
        width: 100%;
        max-height: 95vh;
        overflow-y: auto;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: wizardSlideUpMobile 0.5s var(--smooth);
        -webkit-overflow-scrolling: touch;
    }
    .wizard::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: var(--fn-text-muted);
        border-radius: 2px;
        margin: 0 auto 14px;
        opacity: 0.35;
    }
    @keyframes wizardSlideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    .wizard-header {
        margin-bottom: 16px;
    }
    .wizard-header h2 {
        font-size: 20px;
    }
    .wizard-header p {
        font-size: 13px;
        line-height: 1.5;
    }
    .wizard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .wizard-card {
        padding: 22px 14px 18px;
        min-height: 125px;
        border-radius: 14px;
    }
    .wizard-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    .wizard-title {
        font-size: 12.5px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    .wizard-desc {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* ========== Responsive: Small phone (<=380px) ========== */
@media (max-width: 380px) {
    .header h1 {
        font-size: 13px;
        letter-spacing: -0.5px;
    }
    .main {
        padding: 8px 6px;
    }
    .rec-grid {
        grid-template-columns: 1fr;
    }
    .rec-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .wizard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .diagram-container {
        min-height: 0;
    }
}

/* ========== Responsive: Landscape mobile ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .wizard {
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }
    .wizard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .wizard-card {
        padding: 12px 8px 10px;
    }
    .wizard-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    .detail-panel {
        max-height: 100vh;
        width: 50%;
        right: -50%;
        bottom: auto;
        top: 52px;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }
    .detail-panel.open {
        right: 0;
        bottom: auto;
    }
}

/* ========== Print Button ========== */
.print-btn {
    background: var(--fn-surface-alt);
    border: 1px solid var(--fn-border);
    border-radius: 8px;
    color: var(--fn-text-muted);
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    line-height: 1;
}
.print-btn:hover {
    border-color: var(--fn-text-muted);
    color: var(--fn-text);
}

/* ========== Print Styles — Professional Layout ========== */
@media print {
    @page {
        size: A4;
        margin: 14mm 12mm 18mm;
    }
    * {
        animation: none !important;
        transition: none !important;
    }
    body {
        background: white !important;
        font-size: 10.5px;
        color: #1a2028 !important;
        padding: 0;
        margin: 0;
        line-height: 1.4;
    }
    .header {
        display: none !important;
    }
    .global-bar {
        display: none !important;
    }
    .panel-backdrop,
    .detail-panel,
    .print-btn,
    .diagram-hint,
    .level3-hint,
    .wizard-overlay,
    .time-controls,
    .diagram-nav-hint,
    .rec-details-toggle-wrap {
        display: none !important;
    }
    .rec-details {
        grid-template-rows: 1fr !important;
    }
    .rec-details-inner {
        overflow: visible !important;
    }

    .main {
        display: block;
        padding: 0;
        max-width: none;
    }
    .main-top {
        display: block !important;
    }
    .diagram-container {
        height: auto !important;
        max-height: 300px !important;
        min-height: auto !important;
        border-right: none !important;
    }

    /* Print branded header */
    .main::before {
        content: "FlowNova — Energiefluss-Simulation · Presales Report";
        display: block;
        font-size: 18px;
        font-weight: 700;
        color: #009530;
        margin-bottom: 4px;
        padding-bottom: 6px;
        border-bottom: 3px solid #3dcd58;
        font-family: "IBM Plex Sans", sans-serif;
        letter-spacing: -0.3px;
    }
    .main::after {
        content: "Generiert mit FlowNova · energyflow.pages.dev · " attr(data-date);
        display: block;
        font-size: 8px;
        color: #8a95a3;
        margin-top: 16px;
        padding-top: 8px;
        border-top: 1px solid #e0e3e8;
        font-family: "IBM Plex Mono", monospace;
    }

    /* Diagram: compact, clean */
    .diagram-container {
        background: white !important;
        background-image: none !important;
        box-shadow: none !important;
        border: 1px solid #d0d4da !important;
        border-radius: 8px !important;
        padding: 6px !important;
        margin-bottom: 12px !important;
        min-height: auto !important;
        page-break-inside: avoid;
    }
    .energy-diagram {
        max-height: 260px !important;
    }

    /* Rec card: full width, professional */
    .recommendation {
        position: static;
        max-height: none;
        overflow: visible;
        box-shadow: none !important;
        border: 1px solid #d0d4da;
        width: 100%;
        border-radius: 8px;
    }
    .rec-header {
        padding: 10px 16px !important;
        border-left: 3px solid #009530 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rec-title {
        font-size: 9px !important;
    }
    .rec-subtitle {
        font-size: 14px !important;
    }
    .rec-section {
        padding: 10px 16px !important;
        page-break-inside: avoid;
    }
    .rec-section h3 {
        position: static !important;
        background: none !important;
        font-size: 10px !important;
        margin-bottom: 8px !important;
    }
    .rec-section h3::before {
        box-shadow: none !important;
    }
    .rec-grid {
        gap: 6px !important;
    }
    .rec-item {
        border: 1px solid #e0e3e8 !important;
        padding: 8px 10px !important;
        border-left-width: 3px !important;
    }
    .rec-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .rec-item-value {
        font-size: 14px !important;
    }
    .hint {
        page-break-inside: avoid;
    }
    .hint-dot,
    .hint-info,
    .hint-warning,
    .hint-critical {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Component list: tighter */
    .rec-komponentenliste li {
        padding: 4px 0 !important;
    }
    .rec-komponentenliste li:hover {
        background: none !important;
        margin: 0 !important;
        padding: 4px 0 !important;
    }
}

/* ========== Wizard — Memorable First Impression ========== */
.wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--fn-wizard-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wizardFadeIn 0.4s ease;
}
.wizard-overlay.hidden {
    display: none;
}
@keyframes wizardFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wizard {
    background: var(--fn-surface);
    border-radius: var(--radius-xl);
    box-shadow:
        0 32px 100px rgba(0, 0, 0, 0.3),
        var(--fn-shadow-glow),
        0 0 0 1px var(--fn-border);
    max-width: 880px;
    width: 95%;
    max-height: 90vh; /* biome-ignore lint/suspicious/noDuplicateProperties: dvh fallback */
    max-height: 90dvh;
    padding: 48px 44px 40px;
    animation: wizardSlideUp 0.6s var(--smooth);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
/* Animated gradient accent line */
.wizard::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--se-life-green),
        var(--se-dark-green),
        var(--se-life-green),
        transparent
    );
    background-size: 200% 100%;
    animation: wizardAccentSlide 3s ease-in-out infinite;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
@keyframes wizardAccentSlide {
    0%,
    100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
}
@keyframes wizardSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wizard-header {
    text-align: center;
    margin-bottom: 36px;
}
.wizard-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--fn-wizard-title);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    text-wrap: balance;
}
.wizard-header p {
    font-size: 14px;
    color: var(--fn-wizard-desc);
    line-height: 1.5;
}

.wizard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 700px) {
    .wizard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
}
@media (max-width: 380px) {
    .wizard-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
    }
}
.wizard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 14px 20px;
    border: 1px solid var(--fn-wizard-card-border);
    border-radius: 14px;
    background: var(--fn-wizard-card-bg);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    font-family: var(--font-sans);
    opacity: 0;
    transform: translateY(20px);
    animation: wizardCardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
}
.wizard-card:nth-child(1) {
    animation-delay: 0.08s;
}
.wizard-card:nth-child(2) {
    animation-delay: 0.14s;
}
.wizard-card:nth-child(3) {
    animation-delay: 0.2s;
}
.wizard-card:nth-child(4) {
    animation-delay: 0.26s;
}
.wizard-card:nth-child(5) {
    animation-delay: 0.32s;
}
.wizard-card:nth-child(6) {
    animation-delay: 0.38s;
}
.wizard-card:nth-child(7) {
    animation-delay: 0.44s;
}
.wizard-card:nth-child(8) {
    animation-delay: 0.5s;
}
@keyframes wizardCardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.wizard-card:hover {
    border-color: var(--se-life-green);
    background: var(--fn-wizard-card-hover-bg);
    box-shadow:
        0 16px 48px rgba(61, 205, 88, 0.2),
        0 0 0 1px rgba(61, 205, 88, 0.3),
        inset 0 1px 0 rgba(61, 205, 88, 0.1);
    transform: translateY(-8px) scale(1.03);
}
.wizard-card:active {
    transform: translateY(-2px) scale(0.99);
    transition-duration: 100ms;
}
.wizard-card:focus-visible {
    outline: 2px solid var(--se-life-green);
    outline-offset: 2px;
}

.wizard-icon {
    font-size: 48px;
    margin-bottom: 14px;
    display: block;
    line-height: 1;
    filter: var(--fn-wizard-icon-filter);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wizard-card:hover .wizard-icon {
    transform: scale(1.15) rotate(-3deg);
}
.wizard-card:hover .wizard-title {
    color: var(--se-life-green);
    transition: color 0.25s ease;
}
.wizard-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--fn-wizard-title);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}
.wizard-desc {
    font-size: 12px;
    color: var(--fn-wizard-desc);
    line-height: 1.45;
}

.wizard-card-custom {
    border-style: dashed;
    border-color: var(--fn-border);
}
.wizard-card-custom:hover {
    border-color: var(--fn-text-muted);
    background: var(--fn-surface-alt);
    box-shadow: var(--fn-shadow-lg);
}

/* Active scenario cards — green top accent */
.wizard-card:not(.wizard-card-disabled):not(.wizard-card-custom)::after {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    background: linear-gradient(90deg, var(--se-life-green), var(--se-dark-green));
    border-radius: 0 0 3px 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.wizard-card:not(.wizard-card-disabled):not(.wizard-card-custom):hover::after {
    opacity: 1;
}

.wizard-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.6);
}
.wizard-card-disabled .wizard-icon {
    filter: grayscale(1) opacity(0.5);
}
.wizard-card-disabled .wizard-desc {
    font-style: italic;
}

/* Demnächst badge */
.wizard-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--fn-text-muted);
    color: var(--fn-surface);
    opacity: 0.7;
    line-height: 1.4;
}

/* ========== Energy Charts — Enterprise Grade ========== */
.fn-charts-wrap {
    padding: 6px 14px 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

/* KPI Bar — single row, premium */
.fn-kpis {
    display: flex;
    gap: 1px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--fn-border);
    background: var(--fn-border);
    flex-shrink: 0;
}
.fn-kpi {
    flex: 1;
    padding: 8px 8px 6px;
    background: var(--fn-surface);
    text-align: center;
    min-width: 0;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
    opacity: 0;
    animation: kpiFadeIn 0.4s var(--smooth) forwards;
}
@keyframes kpiFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fn-kpi:hover {
    background: var(--fn-glow);
}
.fn-kpi-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--se-life-green);
}
.fn-kpi-unit {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 2px;
}
.fn-kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fn-text-muted);
    margin-top: 3px;
}

/* Chart Legend — compact inline */
.fn-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
    padding: 2px 0;
    flex-shrink: 0;
}
.fn-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--fn-text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}
.fn-chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.fn-chart-legend-dash {
    width: 16px;
    height: 2px;
    border-top: 2px dashed;
    flex-shrink: 0;
    border-radius: 1px;
}

/* Chart Grid */
.fn-charts {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--fn-border);
    flex: 1;
    min-height: 0;
}
.fn-chart-row {
    border-bottom: 1px solid var(--fn-border);
    opacity: 0;
    animation: chartRowIn 0.45s var(--smooth) forwards;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@keyframes chartRowIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fn-chart-row:nth-child(even) {
    background: var(--fn-surface-alt);
}
.fn-chart-row:last-child {
    border-bottom: none;
}
.fn-chart-xaxis {
    flex-shrink: 0;
    height: 18px;
    border-top: 1px solid var(--fn-border);
}
.fn-chart-xaxis-svg {
    display: block;
    width: 100%;
    height: 18px;
}
.fn-chart-row svg {
    display: block;
    width: 100%;
    height: 100%;
}
.fn-chart-label {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--fn-text-muted);
    font-weight: 500;
}
.fn-chart-cursor {
    stroke: var(--se-life-green);
    opacity: 0.7;
    pointer-events: none;
    filter: drop-shadow(0 0 2px rgba(61, 205, 88, 0.4));
}
.fn-chart-dot {
    pointer-events: none;
    transition: cy 80ms ease;
}

/* Tooltip */
.fn-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--fn-surface);
    border: 1px solid var(--fn-border);
    border-radius: var(--radius);
    box-shadow: var(--fn-shadow-lg);
    padding: 8px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--fn-text);
    z-index: 10;
    white-space: nowrap;
}
.fn-tt-time {
    font-weight: 700;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--fn-border);
    font-size: 12px;
}
.fn-chart-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
    font-size: 10px;
}
.fn-chart-tooltip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Transitions */
.fn-charts-wrap,
.fn-chart-tooltip,
.fn-kpi {
    transition:
        background calc(var(--theme-speed) + 0.12s) var(--theme-ease),
        border-color var(--theme-speed) var(--theme-ease),
        color calc(var(--theme-speed) + 0.05s) var(--theme-ease);
}

/* Responsive */
@media (max-width: 700px) {
    .fn-charts-wrap {
        padding: 12px 12px;
    }
    .fn-chart-legend {
        gap: 8px;
    }
    .fn-chart-legend-item {
        font-size: 9px;
    }
    .fn-kpis {
        flex-wrap: wrap;
        gap: 1px;
    }
    .fn-kpi {
        flex: 1 1 calc(50% - 1px);
        min-width: 0;
        padding: 10px 8px;
    }
    .fn-kpi-value {
        font-size: 18px;
    }
    .fn-kpi-label {
        font-size: 9px;
    }
}
@media print {
    .fn-charts-wrap {
        padding: 8px 16px;
        page-break-inside: avoid;
    }
    .fn-chart-tooltip {
        display: none !important;
    }
    .fn-chart-cursor,
    .fn-chart-dot {
        display: none;
    }
    .fn-kpi-value {
        font-size: 14px;
    }
}

/* ========== Utilities ========== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Charts placeholder */
.fn-charts-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    min-height: 200px;
    border: 1px dashed var(--fn-border);
    border-radius: var(--radius);
    background: var(--fn-surface-alt);
    flex: 1;
}
.fn-charts-placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
    animation: placeholderPulse 3s ease-in-out infinite;
}
.fn-charts-placeholder-text {
    font-size: 12px;
    color: var(--fn-text-muted);
    max-width: 260px;
    line-height: 1.5;
}
@keyframes placeholderPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.05); }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- ComplianceCase: Status-Badges + Warum?-Karten (B6) --- */
.rechtsstand-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--fn-hint-text, #888);
    opacity: 0.75;
    margin-left: 8px;
}
.compliance-row {
    margin-bottom: 6px;
    border-radius: 8px;
    background: rgba(128, 128, 128, 0.05);
    overflow: hidden;
}
.compliance-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px; /* Mobile-Tap-Target-Ergonomie (≥ 44px) */
    padding: 11px 12px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.compliance-head:hover {
    background: rgba(128, 128, 128, 0.07);
}
.status-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.status-ok {
    background: rgba(61, 205, 88, 0.15);
    color: #2a9d4a;
}
.status-info {
    background: rgba(0, 135, 205, 0.13);
    color: var(--se-blue, #0087cd);
}
.status-warning {
    background: rgba(245, 166, 35, 0.16);
    color: #c47f0a;
}
.compliance-label {
    flex: 1;
    font-size: 12px;
    line-height: 1.4;
}
.compliance-why {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--se-blue, #0087cd);
    opacity: 0.8;
}
.compliance-card {
    padding: 8px 12px 11px 12px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--fn-hint-text, #666);
    border-top: 1px solid rgba(128, 128, 128, 0.12);
}
