@media (min-width: 769px) {
    .panel-toggle-btn {
        display: none !important;
    }
}

:root {
    /* Light Theme Colors (Default) */
    --bg-body: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.8);
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: rgba(0, 0, 0, 0.1);
    
    /* Accent Colors */
    --brand: #0284c7;
    --brand-light: rgba(2, 132, 199, 0.1);
    --brand-dark: #0369a1;
    --brand-glow: rgba(2, 132, 199, 0.2);
    
    --shadow-sm: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    
    --radius-md: 16px;
    --radius-lg: 24px; 
    --planner-tab-bg: var(--brand-light);
}

/* Dark Theme Colors */
.dark-theme {
    --bg-body: #0b1121; 
    --surface: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;         
    --text-muted: #94a3b8;         
    --border-light: rgba(255, 255, 255, 0.08);
    --planner-tab-bg: rgba(0, 0, 0, 0.2);
    
    --brand: #0ea5e9;
    --brand-light: rgba(14, 165, 233, 0.1);
    --brand-dark: #38bdf8;
    --brand-glow: rgba(14, 165, 233, 0.4);
    
    --shadow-sm: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Theme Toggle Button Styling */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}
.dark-theme .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.sun-icon { display: block; }
.moon-icon { display: none; }
.dark-theme .sun-icon { display: none; }
.dark-theme .moon-icon { display: block; }

/* Adjusted Ambient Background for Light Theme (Now default) */
.ambient-bg {
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.15), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 50%);
}
.dark-theme .ambient-bg {
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.08), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 50%);
}

.app-icon-img img {
    filter: none !important;
    opacity: 1;
    transition: all 0.2s ease;
}
.dark-theme .app-icon-img img {
    filter: brightness(0) invert(0.9) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8)) !important;
}

.appliance-btn.app-icon-only:hover .app-icon-img img,
.appliance-btn.app-icon-only.active .app-icon-img img {
    filter: none !important;
    transform: scale(1.05);
}
.dark-theme .appliance-btn.app-icon-only:hover .app-icon-img img,
.dark-theme .appliance-btn.app-icon-only.active .app-icon-img img {
    filter: brightness(0) invert(1) drop-shadow(0 0 12px var(--brand)) !important;
}

/* Adjust scrollbar for light theme (Now default) */
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
* {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}
.dark-theme * {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Toegankelijkheid: visueel verbergen maar in de DOM laten voor screenreaders */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body.tool-layout {
    background-color: var(--bg-body);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background */
#planner-view .chart-header-tool {
    display: none;
}

@media (max-width: 768px) {
    #planner-view .chart-header-tool {
        display: flex;
    }
}

.ambient-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.08), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 50%);
}

/* Applicatie Topbar (Opgeschaald) */
.app-topbar {
    height: 80px; background: var(--surface); border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 32px; flex-shrink: 0; z-index: 10;
}
.logo { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px; }
.logo svg { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.nav-links a { 
    color: var(--text-muted); 
    text-decoration: none; 
    padding: 28px 16px; 
    transition: all 0.2s; 
    position: relative;
}
.nav-links a:hover { color: var(--text-main); }
.nav-links a.active { color: var(--brand); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--brand);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--brand-glow);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    margin: 0 8px;
}

/* Underline Controls Styling */
.underline-control {
    display: flex;
    gap: 20px;
}
.underline-control .seg-label {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
}
.underline-control .seg-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 4px;
    transition: all 0.2s;
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    white-space: nowrap;
}
.underline-control .seg-label:hover .seg-text {
    color: var(--text-main);
}
.underline-control input:checked + .seg-text {
    color: var(--brand) !important;
}
.underline-control input:checked + .seg-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--brand-glow);
}

/* View Toggle Underline Style */
.view-toggle {
    display: flex;
    gap: 20px;
    background: transparent !important;
    border: none !important;
    height: auto !important;
    overflow: visible !important;
}
.underline-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    padding: 8px 4px !important;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-family: inherit;
    box-shadow: none !important;
    white-space: nowrap;
}
.underline-btn:hover {
    color: var(--text-main) !important;
}
.underline-btn.active {
    color: var(--brand) !important;
}
.underline-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--brand-glow);
}

.btn-login {
    background: transparent; border: 1px solid var(--border-light);
    padding: 10px 24px; border-radius: 99px; font-weight: 600; font-size: 1.05rem;
    color: var(--text-main); cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.btn-login:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* Applicatie Layout Kern */
.app-core {
    display: flex; flex: 1; overflow: hidden;
}

/* Linker Zijbalk (Breder gemaakt voor 120% effect) */
.app-sidebar {
    width: 420px; background: var(--surface); border-right: 1px solid var(--border-light);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; flex-direction: column; overflow-y: auto; z-index: 5; flex-shrink: 0;
}
.sidebar-header { padding: 32px 32px 24px; border-bottom: 1px solid var(--border-light); }
.page-title { font-size: 2.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.page-title span { background: -webkit-linear-gradient(45deg, var(--brand), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-header p { font-size: 1.05rem; color: var(--text-muted); margin-top: 4px; font-weight: 500;}

.planner-section { padding: 24px 32px; }
.section-label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; }

/* Apparaten Grid Opgeschaald */
.appliances-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.appliance-btn {
    position: relative;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer;
    transition: all 0.2s; box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    min-height: 140px;
    justify-content: center;
}
.appliance-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--brand); transform: translateY(-2px); }
.appliance-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-action-tile {
    background: var(--brand);
    color: white;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.plan-action-tile:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.plan-action-tile:active {
    transform: translateY(0);
}

.appliance-btn.active { background: var(--brand-light); border-color: var(--brand); box-shadow: 0 0 20px var(--brand-glow); }

.appliance-btn.active::after {
    content: '×';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 2px solid var(--surface);
    transition: all 0.2s;
}

.appliance-btn.active:hover::after {
    background: var(--brand-dark);
    transform: scale(1.15);
}

@media (max-width: 768px) {
    .appliance-btn.is-custom.active::after {
        display: none !important;
    }
}

.appliance-btn.app-icon-only {
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.appliance-btn.app-icon-only:hover {
    background: transparent;
    transform: none;
}

.app-icon-img {
    width: 160px;
    height: 115px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: none;
    padding: 10px;
}

.appliance-btn.app-icon-only:hover .app-icon-img,
.appliance-btn.app-icon-only.active .app-icon-img {
    border: none;
    background: transparent;
    box-shadow: none;
}

.app-icon-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Large, intense drop-shadow for maximum pop from background */
    filter: brightness(0) invert(0.9) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
    opacity: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specifically thin the lines of the e-bike icon */
.appliance-btn[href="/elektrische-fiets"] .app-icon-img img {
    filter: brightness(0) invert(0.9) contrast(1.4) brightness(0.85) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
}

.appliance-btn.app-icon-only:hover .app-icon-img img,
.appliance-btn.app-icon-only.active .app-icon-img img {
    /* Pure white with vibrant glow for active/hover state */
    filter: brightness(0) invert(1) drop-shadow(0 0 12px var(--brand));
    transform: scale(1.05);
}

.appliance-btn.app-icon-only:hover .app-icon-img img {
    animation: wiggle 0.3s ease-in-out infinite;
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes hand-click-anim {
    0% { transform: scale(1.1); opacity: 0; }
    15% { transform: scale(1); opacity: 1; }
    25% { transform: scale(0.85); } /* The "Click" */
    35% { transform: scale(1); }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0; }
}

@keyframes tap-ripple {
    0%, 20% { transform: scale(0); opacity: 0; }
    25% { transform: scale(0); opacity: 0.8; }
    45% { transform: scale(1.5); opacity: 0; }
    100% { opacity: 0; }
}

.onboarding-hand {
    position: absolute;
    bottom: 35px; /* Positioned towards the bottom-right of the icon */
    right: 15px;
    width: 35px;
    height: 42px;
    color: #fff;
    pointer-events: none;
    z-index: 100;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    animation: hand-click-anim 2s ease-in-out infinite;
    transform-origin: center center;
}

.onboarding-hand svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.onboarding-hand::before {
    content: '';
    position: absolute;
    top: 10%; /* Moved higher */
    left: 40%; /* Moved more to the right */
    width: 18px;
    height: 18px;
    background: var(--brand);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: tap-ripple 2s ease-out infinite;
    z-index: -1;
}

.appliance-btn.app-icon-only .app-text {
    margin-top: 8px;
}

.appliance-btn.app-icon-only.active .app-name {
    color: var(--brand);
}

.delete-custom-app {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border: 2px solid var(--bg-body);
    opacity: 0;
    transition: 0.2s;
    z-index: 10;
    font-weight: bold;
}
.appliance-wrapper:hover .delete-custom-app {
    opacity: 1;
}
@media (max-width: 768px) {
    .delete-custom-app {
        opacity: 1;
        top: -4px;
        right: -4px;
    }
}
.delete-custom-app:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.app-icon { width: 48px; height: 48px; background: rgba(0,0,0,0.2); border-radius: 12px; display: flex; justify-content: center; align-items: center; color: var(--brand); transition: 0.2s; }
.appliance-btn.active .app-icon { background: var(--brand); color: #ffffff; }
.app-text { display: flex; flex-direction: column; text-align: center; }
.app-name { font-weight: 700; font-size: 1.05rem; color: var(--text-main); }
.app-time { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-top: 2px;}
.app-cost { font-size: 1rem; font-weight: 800; color: var(--brand-dark); margin-top: 4px; }

/* Geavanceerde instellingen */
.advanced-planner { margin-top: 24px; }
.advanced-planner details { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); backdrop-filter: blur(10px); }
.advanced-planner summary { padding: 16px 20px; font-weight: 600; font-size: 1.05rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.advanced-planner summary::-webkit-details-marker { display: none; }
.advanced-planner summary::after { content: '+'; font-size: 1.5rem; color: var(--text-muted); font-weight: 400; }
.advanced-planner details[open] summary::after { content: '-'; }
.custom-controls { padding: 0 20px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.control-group label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; display: block; }
.control-input { display: flex; align-items: center; background: rgba(0,0,0,0.2); border: 1px solid var(--border-light); border-radius: 8px; padding: 10px 14px; }
.control-input input, .control-input select { border: none; background: transparent; font-weight: 600; color: var(--text-main); outline: none; width: 100%; font-size: 1.05rem; font-family: inherit;}

/* Nieuwe instellingen paneel */
.device-settings-panel {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.settings-row {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-control {
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    height: 40px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.dark-theme .setting-control {
    background: rgba(0,0,0,0.2);
}

.segment-control.setting-control {
    display: flex;
}

.seg-label {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    cursor: pointer;
    border-right: 1px solid var(--border-light);
    padding: 0;
    min-width: 0;
}
.seg-label:last-child {
    border-right: none;
}

.seg-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: 0.2s;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    white-space: nowrap;
}

/* Active states for all segment controls */
.segment-control input:checked + .seg-text {
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--brand-glow);
}

/* Ensure underline controls are just text with underline */
.underline-control input:checked + .seg-text {
    background: transparent !important;
    color: var(--brand) !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

@media (min-width: 769px) {
    .segment-control input:checked + .seg-text {
        background: var(--brand-light);
        color: var(--text-main);
        font-weight: 700;
        box-shadow: inset 0 0 0 2px var(--brand);
    }
    
    /* Reset underline controls on desktop too */
    .underline-control input:checked + .seg-text {
        background: transparent !important;
        color: var(--brand) !important;
        box-shadow: none !important;
    }
}

/* Fix border-radius clipping for box-shadow in setting-control (10px container -> 9px inner) */
.setting-control.segment-control label:first-child .seg-text {
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
}
.setting-control.segment-control label:last-child .seg-text {
    border-top-right-radius: 9px;
    border-bottom-right-radius: 9px;
}

/* Fix border-radius clipping for day-selector (12px container -> 11px inner) */
.day-selector .segment-control label:first-child .seg-text {
    border-top-left-radius: 11px;
    border-bottom-left-radius: 11px;
}
.day-selector .segment-control label:last-child .seg-text {
    border-top-right-radius: 11px;
    border-bottom-right-radius: 11px;
}

.control-input.setting-control {
    align-items: center;
    padding: 0 14px;
}

.setting-input {
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
    -moz-appearance: textfield;
}

.setting-input::-webkit-inner-spin-button, 
.setting-input::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

.mobile-only {
    display: none;
}

/* Rechter Werkruimte */
.app-workspace {
    flex: 1; display: flex; flex-direction: column; background: transparent; overflow-y: auto;
    padding: 32px 40px; gap: 32px;
}

.stats-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toolbar met Huidige Prijzen (Extra Groot) */
.toolbar {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border-light);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 24px 32px; box-shadow: var(--shadow-sm); flex-shrink: 0; display: inline-flex; width: max-content; max-width: 100%;
}
.stats-row { display: flex; align-items: center; gap: 48px; flex-wrap: wrap; }
.stat-box { display: flex; flex-direction: column; gap: 6px; }
.stat-divider { width: 1px; height: 48px; background: var(--border-light); }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 2.2rem; font-weight: 900; line-height: 1; letter-spacing: -1px; }

.stat-box-highlight {
    background: rgba(16, 185, 129, 0.08);
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    vertical-align: top;
}
@media (min-width: 769px) {
    .stats-container {
        flex-direction: row;
    }
}
.stat-box-highlight .stat-label { color: #10b981; }

/* Knipperend status icoon */
.live-indicator { width: 10px; height: 10px; background: var(--brand); border-radius: 50%; display: inline-block; position: relative; }
.live-indicator::after { content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; border: 2px solid var(--brand); border-radius: 50%; animation: pulse-ring 2s infinite; opacity: 0; }
@keyframes pulse-ring { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* Grafiek Paneel */
.chart-area {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border-light);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 32px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; flex-shrink: 0; height: auto; min-height: 430px;
}

#chart-title, #planner-chart-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.chart-title-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.chart-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.chart-header-tool {
    margin-bottom: 0;
    padding: 0 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (min-width: 769px) {
    .app-workspace {
        gap: 12px !important;
    }
    #chart-title, #planner-chart-title {
        width: 100% !important;
        margin-bottom: 32px !important;
    }
    .chart-header-tool, #device-settings-panel {
        margin-bottom: 0 !important;
    }
    .toolbar {
        margin-bottom: -12px !important;
        width: 100% !important;
        border-bottom: none !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        box-shadow: none !important;
        padding-left: 32px !important;
        padding-right: 32px !important;
        position: relative;
        z-index: 10;
    }
    .chart-area {
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
    #device-settings-panel {
        width: fit-content;
        max-width: 100%;
    }
    .chart-header-tool .view-toggle {
        margin-left: 48px !important;
    }
    .settings-row {
        gap: 40px !important;
    }
}

.chart-header-tool h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; color: var(--text-main); }

.svg-container { flex: 1; width: 100%; position: relative; min-height: 300px; height: auto; }

/* Graph Hint Tooltip */
.graph-hint {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-size: 0.85rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    white-space: nowrap;
}

.dark-theme .graph-hint {
    background: rgba(30, 41, 59, 0.8);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes hintPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.graph-hint {
    animation: hintPulse 2.5s infinite ease-in-out;
}

/* Hide hint on mobile or when dragging */
@media (max-width: 768px) {
    .graph-hint { display: none !important; }
}

body.grabbing .graph-hint {
    opacity: 0;
}

/* Chart SVG Classes uit Dark Copy (Bar Chart / Hover) */
.svg-grid-minor { stroke: rgba(255,255,255,0.02); stroke-width: 1; }
.svg-grid-major { stroke: var(--border-light); stroke-width: 1; stroke-dasharray: 4 4;}
.svg-zero-line { stroke: var(--text-muted); opacity: 0.3; stroke-width: 1.5; }
.svg-axis-text { font-family: 'JetBrains Mono', monospace; font-size: 12px; fill: var(--text-muted); }
.svg-axis-label { font-family: 'Outfit', sans-serif; font-size: 10px; font-weight: 800; fill: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.bar-label { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; transition: opacity 0.3s ease; pointer-events: none;}

.svg-bar { 
    transition: opacity 0.3s ease, filter 0.2s ease; 
    cursor: grab; shape-rendering: crispEdges; 
}

body.grabbing, body.grabbing * {
    cursor: grabbing !important;
}
.svg-bar:hover { filter: brightness(1.3); stroke: #fff; stroke-width: 1px;}

@keyframes pulse-horizontal {
    0% { transform: translateX(0); opacity: 0.8; }
    50% { transform: translateX(-3px); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.8; }
}

@keyframes pulse-horizontal-right {
    0% { transform: translateX(0); opacity: 0.8; }
    50% { transform: translateX(3px); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.8; }
}

#selection-handle-left path {
    animation: pulse-horizontal 1.5s ease-in-out infinite;
}

#selection-handle-right path {
    animation: pulse-horizontal-right 1.5s ease-in-out infinite;
}

.crosshair { stroke: rgba(255,255,255,0.4); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; pointer-events: none; transition: opacity 0.1s; }

/* Planner Resultaat Bericht */
.planner-summary {
    background: transparent; border: none; border-radius: 0;
    padding: 0 0 12px 0; margin-top: 0; display: none; align-items: center;
    width: 100%; box-sizing: border-box;
}
.planner-summary.active { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.summary-content { flex: 1; text-align: center; }
.summary-title { display: none; }
.summary-text { font-size: 1.15rem; font-weight: 600; color: var(--brand); line-height: 1.4; }.summary-text b { font-weight: 800; color: var(--brand-dark); }
.dark-theme .summary-text b { color: #fff; }

/* Planner Specific Styling */
#planner-items-container .appliance-btn.active::after {
    display: none !important;
}

.summary-actions {
    margin-left: auto;
    flex-shrink: 0;
}

#add-to-planner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#add-to-planner-btn:active {
    transform: scale(0.95);
}

.planner-item-label {
    animation: labelPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes labelPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

[data-view] {
    cursor: pointer;
}

/* Subtiele Besparing Styling */
.spectacular-savings {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #10b981;
}

.savings-amount {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

.savings-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Integraties onderkant paneel */
.integrations-panel {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border-light);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 24px 32px; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.affiliate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.affiliate-card {
    border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 16px;
    display: flex; align-items: center; gap: 16px; text-decoration: none; 
    color: var(--text-main); transition: all 0.2s; background: rgba(255,255,255,0.02);
}
.affiliate-card:hover { border-color: var(--brand); background: rgba(255,255,255,0.06); transform: translateY(-2px); }
.aff-icon { width: 40px; height: 40px; background: rgba(0,0,0,0.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0; }
.aff-text h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.aff-text p { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

/* Desktop Only Sidebar Settings */
.desktop-only-sidebar-settings {
    display: flex;
    flex-direction: column;
    padding: 24px 32px 32px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-settings-header {
    margin-bottom: 24px;
}

.sidebar-settings-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.2;
}

.subtle-divider {
    height: 1px;
    background: var(--border-light);
    width: 100%;
    opacity: 0.5;
}

.sidebar-settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-setting-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown Styling */
.sidebar-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-dropdown {
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0 40px 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.dark-theme .sidebar-dropdown {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-dropdown:hover {
    border-color: var(--brand);
}

.sidebar-dropdown:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.dropdown-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Number Input Styling */
.sidebar-number-input {
    height: 44px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
}

.dark-theme .sidebar-number-input {
    background: rgba(255, 255, 255, 0.05);
}

/* Stepper Input Styling */
.stepper-input {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    height: 44px;
    overflow: hidden;
}

.dark-theme .stepper-input {
    background: rgba(255, 255, 255, 0.05);
}

.stepper-btn {
    width: 44px;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.stepper-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--brand);
}

.stepper-value {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    outline: none;
    -moz-appearance: textfield;
}

.stepper-value::-webkit-inner-spin-button,
.stepper-value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Modern Toggle Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.modern-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.dark-theme .toggle-slider {
    background-color: rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--brand);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--brand);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Buttons */
.sidebar-spacer {
    flex: 1;
    min-height: 20px;
}

.sidebar-secondary-btn {
    background: rgba(2, 132, 199, 0.08);
    color: var(--brand);
    border: 1px solid var(--brand-light);
    border-radius: 12px;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.sidebar-secondary-btn:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.sidebar-secondary-btn:active {
    transform: translateY(0);
}

.sidebar-back-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    transition: all 0.2s;
}

.sidebar-back-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Hide original settings on desktop */
@media (min-width: 769px) {
    #device-settings-panel {
        display: none !important;
    }
}

/* Mobiele layout optimalisaties */
@media (max-width: 1200px) {
    .app-sidebar { width: 360px; }
}
@media (max-width: 1024px) {
    .app-core { flex-direction: column; overflow-y: auto; }
    .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-light); overflow-y: visible; }
    .app-workspace { overflow-y: visible; padding: 20px; }
    body.tool-layout { overflow: auto; height: auto; min-height: 100vh; }
    .toolbar { width: 100%; }
}
.mobile-header, .mobile-bottom-nav {
    display: none;
}

.chart-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0;
    display: inline;
}

.chart-unit {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
    .mobile-header, .mobile-bottom-nav {
        display: flex;
    }
    
    .chart-unit {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 500;
        margin-left: 2px;
    }

    /* Mobile Planner Toggle Improvement - Light Theme Only */
    body:not(.dark-theme) .day-selector.mobile-only .segment-control {
        background: #ffffff !important;
        border-color: #bae6fd !important;
    }
    body:not(.dark-theme) .day-selector.mobile-only .seg-text {
        color: #0369a1 !important;
        font-weight: 600 !important;
    }
    body:not(.dark-theme) .day-selector.mobile-only input:checked + .seg-text {
        color: #fff !important;
        background: var(--brand) !important;
    }
}

/* Scroll Indicators */
.scroll-container {
    position: relative;
    width: 100%;
    overflow: visible;
}

.scroll-indicator {
    position: absolute;
    top: 58px; /* Centered against the icon container height (115px / 2) */
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: #334155;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.scroll-indicator.left {
    left: 4px;
}

.scroll-indicator.right {
    right: 4px;
}

@keyframes pulseArrow {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

@media (max-width: 768px) {
    .scroll-indicator.visible {
        display: flex;
    }
    .scroll-indicator.visible svg {
        animation: pulseArrow 2s infinite;
    }
    /* 1. Single Viewport Focus */
    body.tool-layout {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-top: 0 !important;
        padding-bottom: 50px !important;
    }

    .chart-header-tool {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    #chart-title {
        width: 100% !important;
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
        line-height: 1.2;
        order: 1;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    .chart-title-main {
        font-size: 1.8rem !important;
        font-weight: 800 !important;
        color: var(--text-main) !important;
    }
    .chart-subtitle {
        font-size: 0.9rem !important;
        color: var(--text-muted) !important;
        font-weight: 600 !important;
        margin: 0 !important;
        display: block !important;
    }    .view-toggle, .day-selector .segment-control.underline-control {
        background: transparent !important;
        border: none !important;
        height: auto !important;
    }
    .view-toggle {
        flex: 0 0 100% !important;
        order: 3 !important;
        margin-top: 12px !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        gap: 24px !important;
    }
    .chart-header-tool .day-selector {
        flex: 0 0 100% !important;
        order: 2 !important;
        margin-top: 8px !important;
    }
    .day-selector .segment-control.underline-control {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 24px !important;
    }
    .view-toggle .toggle-btn, .day-selector .underline-control .seg-text {
        padding: 8px 0 !important;
        font-size: 1rem !important;
        white-space: nowrap;
        text-overflow: clip;
        overflow: visible;
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .view-toggle .toggle-btn.active, .day-selector .underline-control input:checked + .seg-text {
        color: var(--brand) !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .view-toggle .toggle-btn.active::after, .day-selector .underline-control input:checked + .seg-text::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--brand);
        border-radius: 3px;
        box-shadow: 0 0 10px var(--brand-glow);
    }
    .view-toggle .toggle-btn {
        flex: 1;
    }

    .app-core {
        height: auto !important;
        overflow: visible !important;
        flex-direction: column;
        display: flex;
    }

    .app-workspace {
        padding: 12px;
        gap: 16px;
        overflow: visible;
        flex: none;
        display: flex;
        flex-direction: column;
    }

    /* Hide desktop headers and non-essential tools */
    .app-topbar { display: none; }
    .integrations-panel { display: none; }
    .sidebar-header { 
        display: block; 
        padding: 24px 20px 16px; 
        border-bottom: 1px solid var(--border-light);
    }
    .page-title {
        font-size: 2.2rem;
    }

    .stats-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    /* Make toolbar adapt to mobile instead of hiding */
    .toolbar {
        display: block;
        width: 100%;
        padding: 20px;
        background: var(--surface);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }
    .stats-row {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    .stat-box {
        background: transparent;
        border: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .stat-divider { 
        display: block;
        width: 100%;
        height: 1px;
        background: var(--border-light);
    }
    .stat-label {
        font-size: 0.8rem;
        gap: 6px;
        letter-spacing: 0.5px;
        color: var(--text-muted);
    }
    .stat-value {
        font-size: 2.2rem;
        font-weight: 900;
        line-height: 1;
        letter-spacing: -1px;
    }

    #savings-stat-box {
        display: flex; /* Shown via JS by removing inline display:none */
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.4);
        box-shadow: var(--shadow-sm);
        padding: 20px;
        border-radius: var(--radius-md);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 4px;
        margin-left: 0; /* Reset desktop margin to prevent overflow */
        margin-bottom: 20px;
        width: 100%;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    #savings-stat-box .stat-label { 
        font-size: 0.8rem; 
        color: #10b981; 
        font-weight: 800;
        margin: 0;
        letter-spacing: 0.5px;
    }
    #savings-stat-box .stat-value { 
        font-size: 2.2rem; 
        color: #10b981;
        font-weight: 900;
        line-height: 1;
        letter-spacing: -1px;
    }

    /* 4. Simplified Header - Losgemaakt (niet meer fixed) */
    .mobile-header {
        display: flex;
        position: relative !important;
        top: 0; left: 0; right: 0;
        height: 64px;
        background: var(--surface);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-light);
        z-index: 100;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
    }

    .mobile-header .logo { font-size: 1.2rem; }

    .mobile-price-badge {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(0,0,0,0.3);
        border: 1px solid var(--border-light);
        padding: 6px 12px;
        border-radius: 99px;
        font-weight: 800;
        font-size: 1.1rem;
    }

    .mobile-price-badge {
        display: none !important;
    }

    /* 3. Mobile Navigation - Kleiner en met transitie */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 50px;
        background: var(--bg-body);
        border-top: 1px solid var(--border-light);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mobile-bottom-nav.nav-hidden {
        transform: translateY(100%);
    }
    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 600;
    }
    .mobile-bottom-nav .nav-item svg {
        width: 20px;
        height: 20px;
    }
    .mobile-bottom-nav .nav-item.active { color: var(--brand); }

    /* 2. Horizontal Scrolling for Appliance Grid */
    .app-sidebar {
        border-bottom: 1px solid var(--border-light);
        padding: 0;
        flex-shrink: 0;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        height: auto;
        min-height: 0;
    }

    .huidig-text {
        display: none;
    }

    .planner-section { padding: 8px 12px 4px; }
    .section-label { display: none; } /* Hide label to save significant vertical space */

    .appliances-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding: 4px 0 8px;
        margin: 0;
        scrollbar-width: none;
    }

    .appliance-wrapper {
        flex: 0 0 115px;
        scroll-snap-align: start;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .app-icon-img {
        width: 115px;
        height: 115px;
        flex-shrink: 0;
    }

    .app-icon-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .appliance-btn {
        width: 100%;
        padding: 10px 8px;
        gap: 8px;
        border-radius: var(--radius-md);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .app-icon { width: 38px; height: 38px; }
    .app-icon svg { width: 22px; height: 22px; }
    .app-name { font-size: 0.85rem; font-weight: 700; text-align: center; }    .plan-action-tile {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 10px;
        gap: 6px;
    }

    /* Planner mobile reordering */
    #planner-view {
        display: flex;
        flex-direction: column;
    }
    
    #planner-view .app-workspace {
        display: none; /* Hide graph on mobile as requested */
    }
    
    #planner-view .app-sidebar {
        background: transparent;
        border: none;
    }
    
    #planner-view .planner-section {
        display: flex;
        flex-direction: column;
        padding-top: 0;
    }
    
    #planner-totals {
        /* Totals below the devices list on mobile */
        margin-top: 20px !important;
        margin-bottom: 20px;
    }

    /* 5. Adaptive UI for Chart */
    .chart-area {
        padding: 16px;
        min-height: 250px;
        flex: none;
        height: auto;
        margin-bottom: 0;
        border-radius: var(--radius-md);
    }
    .chart-header-tool h2 { font-size: 1.1rem; margin-bottom: 12px; }
    
    .svg-container { 
        min-height: 300px; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        width: 100%;
        display: block;
    }
    
    .planner-summary {
        margin-top: 12px;
        padding: 12px;
        gap: 12px;
    }
    .summary-icon { width: 36px; height: 36px; }
    .summary-icon svg { width: 18px; height: 18px; }
    .summary-title { font-size: 1rem; }
    .summary-text { font-size: 1rem; }

    /* Mobile Side Panel - Left Side */
    .device-settings-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 280px;
        height: 100%;
        margin-bottom: 0;
        border-radius: 0 24px 24px 0;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px; /* Reduced padding slightly */
        background: var(--bg-body); /* Solid bg */
        border: 1px solid var(--border-light);
        border-left: none;
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
        display: flex;
        flex-direction: column;
        overflow-y: auto; /* Allow vertical scroll if content too tall */
        box-sizing: border-box;
    }
    
    .device-settings-panel.sheet-open {
        transform: translateX(0);
        display: flex !important;
        transition: transform 0.1s ease-out;
    }

    .device-settings-panel .settings-row {
        width: 100%;
        gap: 16px;
        box-sizing: border-box;
    }

    .device-settings-panel .setting-control {
        width: 100% !important;
        box-sizing: border-box;
    }

    .device-settings-panel .segment-control {
        display: flex;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .device-settings-panel .seg-label {
        flex: 1;
        min-width: 0;
    }

    .device-settings-panel .seg-text {
        padding: 0 4px !important;
        font-size: 0.7rem !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Side Toggle Button - Subdued */
    .panel-toggle-btn {
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 60px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(8px);
        color: var(--text-muted);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        border-radius: 0 10px 10px 0;
        display: none; /* Only show when appliance selected on mobile */
        align-items: center;
        justify-content: center;
        z-index: 1002;
        cursor: pointer;
        box-shadow: 2px 0 8px rgba(0,0,0,0.2);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
    }

    .panel-toggle-btn svg {
        width: 18px;
        height: 18px;
        opacity: 0.7;
    }

    .panel-toggle-btn.panel-open {
        left: 280px;
        background: var(--brand);
        color: white;
        transition: left 0.1s ease-out;
    }
    
    .panel-toggle-btn.panel-open svg {
        opacity: 1;
    }

    .panel-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000;
        display: none;
        opacity: 0;
        transition: none !important; /* Instant hide/show */
    }

    .panel-backdrop.active {
        display: block;
        opacity: 1;
    }

    .settings-row {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .mobile-only {
        display: flex;
    }

    /* Mobile selection slider */
    #mobile-time-slider-container {
        padding: 18px 0;
        margin-top: 12px;
    }

    #mobile-time-slider {
        width: 100%;
        height: 10px;
        border-radius: 5px;
        background: rgba(0, 0, 0, 0.1);
        outline: none;
        -webkit-appearance: none;
        cursor: pointer;
        margin-top: 12px;
        margin-bottom: 4px;
    }

    .dark-theme #mobile-time-slider {
        background: rgba(255, 255, 255, 0.15);
    }

    #mobile-time-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--brand);
        cursor: pointer;
        box-shadow: 0 4px 12px var(--brand-glow);
        border: 3px solid #fff;
    }

    #mobile-time-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--brand);
        cursor: pointer;
        border: 3px solid #fff;
        box-shadow: 0 4px 12px var(--brand-glow);
    }

    .panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .panel-header h3 {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .close-btn {
        background: rgba(255,255,255,0.1);
        border: none;
        color: var(--text-main);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .panel-footer {
        margin-top: 24px;
    }

    .btn-calc {
        width: 100%;
        background: var(--brand);
        color: white;
        border: none;
        padding: 16px;
        border-radius: 12px;
        font-size: 1.1rem;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 4px 12px var(--brand-glow);
    }
}

/* Content Accordion Styles */
.info-section { 
    margin: 60px auto 40px; 
    max-width: 1200px; 
    padding: 0 20px; 
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.info-details { 
    background: rgba(255, 255, 255, 0.02); 
    border: 1px solid var(--border-light); 
    border-radius: var(--radius-lg); 
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-details[open] {
    background: rgba(255, 255, 255, 0.04);
}

.info-summary { 
    padding: 24px; 
    font-weight: 700; 
    font-size: 1.1rem; 
    cursor: pointer; 
    list-style: none; 
    display: flex; 
    align-items: center; 
    color: var(--text-main);
    gap: 12px;
}

.info-summary::-webkit-details-marker { display: none; }

.info-summary::after { 
    content: ''; 
    width: 20px; 
    height: 20px; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    opacity: 0.6;
    margin-left: auto;
}

.info-details[open] .info-summary::after { 
    transform: rotate(180deg); 
}

.info-content-inner { 
    padding: 0 24px 32px; 
    color: var(--text-muted); 
    line-height: 1.8;
    font-size: 1rem;
}

.info-content-inner h2, .info-content-inner h3 { 
    color: var(--text-main); 
    margin-top: 24px; 
    margin-bottom: 12px;
}

.info-content-inner p { 
    margin-bottom: 16px; 
}

.info-content-inner ul {
    margin-top: 16px;
    padding-left: 0;
    list-style: none;
}

.info-content-inner li {
    margin-bottom: 8px;
}

.info-content-inner li a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s;
}

.info-content-inner li a:hover {
    color: var(--brand-glow);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .info-section { margin-top: 40px; margin-bottom: 80px; }
    .info-summary { padding: 18px; font-size: 1rem; }
    .info-content-inner { padding: 0 18px 24px; font-size: 0.95rem; }
}