/* ===================================
   SolarVista — CSS Design System
   Modern Glassmorphism Dark Theme
   =================================== */

/* --- CSS Variables (Theming) --- */
:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Dark theme (default) */
    --bg-primary: #0a0e1a;
    --bg-gradient: linear-gradient(160deg, #080c18 0%, #130e38 35%, #0b1624 65%, #080c18 100%);
    --bg-card: rgba(255, 255, 255, 0.055);
    --bg-card-hover: rgba(255, 255, 255, 0.09);
    --border-card: rgba(255, 255, 255, 0.11);
    --text-primary: #f0f0f5;
    --text-secondary: #8892b0;
    --text-muted: #5a6380;
    --accent-solar: #ffb347;
    --accent-power: #64ffda;
    --accent-energy: #a78bfa;
    --accent-co2: #69f0ae;
    --accent-blue: #448aff;
    --error-bg: rgba(255, 82, 82, 0.15);
    --error-border: rgba(255, 82, 82, 0.4);
    --error-text: #ff8a80;
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: rgba(100, 255, 218, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --btn-gradient: linear-gradient(135deg, #ffb347 0%, #ff8c00 45%, #d97706 100%);
    --btn-hover: linear-gradient(135deg, #ffc473 0%, #ff9a2b 45%, #e0a04c 100%);
    --blur-amount: 24px;
    --slider-track: rgba(255, 255, 255, 0.1);
    --slider-thumb: #ffb347;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f7ff;
    --bg-gradient: linear-gradient(135deg, #f5f7ff 0%, #e8ecf8 40%, #f0f4ff 70%, #f5f7ff 100%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --border-card: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --accent-solar: #e6930e;
    --accent-power: #0d9b76;
    --accent-energy: #5e35b1;
    --accent-co2: #2e7d32;
    --accent-blue: #1565c0;
    --error-bg: rgba(255, 82, 82, 0.1);
    --error-border: rgba(255, 82, 82, 0.3);
    --error-text: #c62828;
    --input-bg: rgba(0, 0, 0, 0.04);
    --input-border: rgba(0, 0, 0, 0.12);
    --input-focus: rgba(13, 155, 118, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
    --btn-gradient: linear-gradient(135deg, #ffb347 0%, #ff8c00 45%, #b45309 100%);
    --btn-hover: linear-gradient(135deg, #ffc473 0%, #ff9a2b 45%, #e0a04c 100%);
    --blur-amount: 16px;
    --slider-track: rgba(0, 0, 0, 0.1);
    --slider-thumb: #e6930e;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.4s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Animated background orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.15;
}

body::before {
    width: 500px;
    height: 500px;
    background: var(--accent-solar);
    top: -100px;
    right: -100px;
    animation: float-orb 20s ease-in-out infinite;
}

body::after {
    width: 400px;
    height: 400px;
    background: var(--accent-energy);
    bottom: -50px;
    left: -50px;
    animation: float-orb 15s ease-in-out infinite reverse;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--border-card);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    position: relative;
    z-index: 1;
}

.glass-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Screen-reader only helper */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 10;
    position: relative;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.3)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 16px rgba(255, 179, 71, 0.6)); transform: scale(1.1); }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-solar), #ff6723);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 48px;
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: var(--bg-card-hover);
    transform: scale(1.1);
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
    position: relative;
    z-index: 1;
}

/* --- Input Panel --- */
.input-panel {
    padding: 36px;
    margin-bottom: 32px;
}

/* SaaS-style dashboard layout (Professional Mode) */
.pro-dashboard {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 20px;
    align-items: start;
}

.pro-map-col,
.pro-config-col {
    padding: 18px;
}

.pro-map-col .map-group {
    margin-bottom: 0;
}

.pro-map-col #map {
    height: 380px;
}

.pro-config-col {
    min-width: 0;
}

.map-wrapper {
    position: relative;
}

.map-search-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 700;
    width: min(360px, 56%);
}

.map-search-group {
    margin-bottom: 0;
}

/* Slider + number entry */
.slider-with-number {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-with-number input[type="range"] {
    flex: 1;
}

.slider-number {
    width: 120px;
    min-height: 44px;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: all 0.25s ease;
    appearance: none;
}

.slider-number:focus {
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Global Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-flex;
}

.lang-menu-btn {
    min-height: 44px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
    font-family: var(--font-family);
    font-weight: 600;
}

.lang-menu-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    transform: translateY(-1px);
}

.lang-menu-icon {
    font-size: 1.1rem;
}

.lang-menu-current {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 200px;
    padding: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    backdrop-filter: blur(20px);
    z-index: 1000;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.lang-menu-item {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 600;
}

.lang-menu-item:hover {
    background: rgba(255, 179, 71, 0.12);
}

/* Theme Switch (Sliding) */
.theme-switch {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 0 6px;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-card);
    position: relative;
    transition: background 0.25s ease;
}

.theme-thumb-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 179, 71, 0.18);
    border: 1px solid rgba(255, 179, 71, 0.35);
    transition: left 0.25s ease, background 0.25s ease;
    font-size: 0.95rem;
}

/* Checked = Light theme (Sun on the right) */
html[data-theme="light"] .theme-thumb-icon {
    left: 28px;
    background: rgba(255, 152, 0, 0.22);
    border-color: rgba(255, 152, 0, 0.5);
}

.theme-switch:focus-within .theme-track {
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Sun loaders */
.sun-spinner {
    font-size: 2.4rem;
    filter: drop-shadow(0 0 16px rgba(255, 179, 71, 0.35));
    animation: sun-spin 0.9s linear infinite;
}

.sun-spinner-inline {
    font-size: 1.1rem;
    display: inline-block;
    margin-right: 6px;
    animation: sun-spin 0.9s linear infinite;
}

@keyframes sun-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Map focus ripple */
#map {
    position: relative;
}

.map-focus-ripple {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 179, 71, 0.75);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 800;
    animation: map-ripple 700ms ease-out forwards;
}

@keyframes map-ripple {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.75); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

/* Model loading overlay */
.model-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.model-loading-card {
    padding: 28px 34px;
    text-align: center;
}

.model-loading-text {
    margin-top: 12px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1rem;
}

.section-title {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.4rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.slider-input-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 4px;
    transition: all 0.3s ease;
}

.slider-input-wrapper:hover {
    background: rgba(255, 255, 255, 0.06);
}

.slider-input-wrapper:focus-within {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.2);
}

.manual-slider-input {
    background: transparent;
    border: none;
    color: var(--accent-solar);
    font-weight: 700;
    font-size: 1.05rem;
    width: 42px;
    text-align: right;
    outline: none;
    font-family: var(--font-family);
    -moz-appearance: textfield; /* Hide arrows Firefox */
    appearance: textfield;
    padding: 0;
}

.manual-slider-input::-webkit-outer-spin-button,
.manual-slider-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.slider-unit {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 2px;
    padding-bottom: 2px;
}

/* Advanced Capacity Preview */
.advanced-capacity-preview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 179, 71, 0.2);
    border-radius: 12px;
    margin-top: 10px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.capacity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.capacity-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 16px;
}

.cap-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.cap-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cap-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64ffda;
    transition: color 0.3s ease;
}

.cap-value.updated {
    color: #ffb347;
    text-shadow: 0 0 8px rgba(255, 179, 71, 0.6);
}

.cap-value small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

#advanced-specs {
    grid-template-columns: 1fr;
}

.full-width-group {
    grid-column: 1 / -1;
}

.specs-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 10px;
    background: var(--input-bg);
    border-radius: 12px;
    border: 1px solid var(--input-border);
}

.toggle-label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.toggle-label input[type="radio"] {
    accent-color: var(--accent-solar);
    transform: scale(1.2);
}

.form-row.simplified-inputs {
    grid-template-columns: repeat(2, 1fr);
}

/* Smart Estimate Card (Quick Setup) */
.smart-estimation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 179, 71, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-theme="dark"] .smart-estimation-card {
    background: linear-gradient(135deg, rgba(20, 24, 39, 0.8) 0%, rgba(26, 31, 48, 0.9) 100%);
}

[data-theme="light"] .smart-estimation-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, #f8f9fa 100%);
    border-color: rgba(230, 147, 14, 0.2);
}

.est-header {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.est-header h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 600;
}

.est-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.6));
}

.est-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-solar);
    border-radius: 50%;
    margin-left: auto;
    box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.7);
    animation: est-pulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes est-pulse {
    to { box-shadow: 0 0 0 10px rgba(255, 179, 71, 0); }
}

.est-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border-card);
}

.est-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.est-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.est-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-solar);
    transition: color 0.3s ease;
}
.est-value.updated {
    color: #64ffda;
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.4);
}

.est-divider {
    width: 1px;
    height: 35px;
    background: var(--border-card);
}

.est-disclaimer {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Custom Select & Number Input */
.custom-select, .custom-input {
    width: 100%;
    padding: 14px 18px;
    min-height: 44px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.custom-input {
    background-image: none;
}

.custom-select:focus, .custom-input:focus {
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.custom-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.custom-select:hover,
.custom-input:hover {
    border-color: rgba(255, 179, 71, 0.35);
}

/* Tooltip */
.tooltip-container label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.info-icon {
    font-size: 0.95rem;
    cursor: help;
    opacity: 1;
    transition: transform 0.15s ease;
    background: rgba(255, 179, 71, 0.12);
    border: 1px solid rgba(255, 179, 71, 0.35);
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}

.info-icon:hover {
    transform: translateY(-1px);
}

/* Text Input */
input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    min-height: 44px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 3px var(--input-focus);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

/* Range Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--slider-track);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--slider-thumb);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.4);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--slider-thumb);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.4);
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: 10px;
}

.day-btn {
    flex: 1;
    padding: 10px 16px;
    min-height: 44px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.day-btn.active {
    background: var(--btn-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 103, 35, 0.3);
}

.day-btn:hover:not(.active) {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    transform: translateY(-1px);
}

.day-btn.active:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 103, 35, 0.4);
}

.day-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    margin-top: 4px;
    list-style: none;
    overflow: hidden;
    display: none;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.suggestions-list.show {
    display: block;
}

.suggestions-list li {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-card);
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: rgba(255, 179, 71, 0.1);
}

/* Location Label */
.location-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--input-bg);
    border-radius: 12px;
    border-left: 3px solid var(--accent-solar);
    line-height: 1.5;
}

.location-label strong {
    color: var(--accent-solar);
    font-weight: 700;
}

/* Map Container */
.map-group {
    margin-bottom: 24px;
    position: relative;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#map {
    width: 100%;
    height: 320px;
    border-radius: 14px;
    border: 1px solid var(--border-card);
    overflow: hidden;
    z-index: 1;
    transition: box-shadow 0.3s ease;
}

#map:hover {
    box-shadow: 0 4px 20px rgba(255, 179, 71, 0.15);
}

/* Geolocation Button */
.geo-btn {
    padding: 10px 16px;
    min-height: 44px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.geo-btn:hover {
    background: rgba(255, 179, 71, 0.1);
    border-color: var(--accent-solar);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 179, 71, 0.15);
}

.geo-btn:active {
    transform: translateY(0);
}

.geo-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Map Coordinates Display */
.map-coords {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.3s ease;
}

.map-coords.active {
    color: var(--accent-power);
    font-weight: 500;
}

/* Predict Button */
.predict-btn {
    width: 100%;
    padding: 16px;
    min-height: 56px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 6px 24px rgba(255, 103, 35, 0.3);
    position: relative;
    overflow: hidden;
}

.predict-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 103, 35, 0.4);
}

.predict-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(circle at 50% 0%, rgba(255, 199, 122, 0.55) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.predict-btn:hover::after {
    opacity: 1;
    animation: predict-pulse 1.1s ease-out;
}

@keyframes predict-pulse {
    0% { opacity: 0; transform: scale(0.85); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.35); }
}

.predict-btn:active {
    transform: translateY(0);
}

.predict-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Box */
.error-box {
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 12px;
    color: var(--error-text);
    font-size: 0.9rem;
    font-weight: 500;
    animation: fade-in 0.3s ease;
}

/* --- Results Section --- */
.results-section {
    animation: fade-in-up 0.6s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Location Header */
.location-header {
    padding: 24px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-info h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.location-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.confidence-badge {
    margin-top: 10px;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

.confidence-badge strong {
    color: var(--text-primary);
}

.confidence-badge.high-confidence {
    border-color: var(--accent-power);
    background: rgba(100, 255, 218, 0.1);
}

.confidence-badge.high-confidence strong {
    color: var(--accent-power);
}

.confidence-badge.medium-confidence {
    border-color: var(--accent-solar);
    background: rgba(255, 179, 71, 0.1);
}

.confidence-badge.medium-confidence strong {
    color: var(--accent-solar);
}

.current-weather {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 12px;
}

.weather-icon-large {
    font-size: 2.4rem;
}

.weather-temp {
    font-size: 1.8rem;
    font-weight: 700;
}

.weather-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: capitalize;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 24px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
}

.solar-card::before { background: linear-gradient(90deg, var(--accent-solar), transparent); }
.power-card::before { background: linear-gradient(90deg, var(--accent-power), transparent); }
.energy-card::before { background: linear-gradient(90deg, var(--accent-energy), transparent); }
.co2-card::before { background: linear-gradient(90deg, var(--accent-co2), transparent); }

.metric-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.metric-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.solar-card .metric-value { color: var(--accent-solar); }
.power-card .metric-value { color: var(--accent-power); }
.energy-card .metric-value { color: var(--accent-energy); }
.co2-card .metric-value { color: var(--accent-co2); }

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Environmental Impact */
.env-impact {
    padding: 28px 32px;
    margin-bottom: 24px;
}

.env-impact h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.env-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.env-item {
    text-align: center;
    padding: 20px 16px;
    background: var(--input-bg);
    border-radius: 14px;
    border: 1px solid var(--border-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.env-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-co2);
}

.env-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.env-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent-co2);
    margin-bottom: 4px;
}

.env-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Peak Solar Hour */
.peak-hour {
    padding: 24px 32px;
    margin-bottom: 24px;
}

.peak-hour h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.peak-info {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
}

.peak-time {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent-solar);
}

.peak-radiation {
    font-size: 1rem;
    color: var(--text-secondary);
}

.peak-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.chart-container {
    padding: 28px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.chart-container canvas {
    max-height: 320px;
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* Daily Summary Table */
.daily-summary {
    padding: 28px 32px;
    margin-bottom: 24px;
}

.daily-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-card);
}

td {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-card);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--input-bg);
}

/* Download Button */
.download-section {
    text-align: center;
    margin-bottom: 32px;
}

.download-btn {
    padding: 14px 32px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.2);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .env-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 16px 20px;
    }
    .logo h1 {
        font-size: 1.4rem;
    }
    .tagline {
        display: none;
    }
    .container {
        padding: 0 16px 40px;
    }
    .input-panel {
        padding: 24px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .pro-dashboard {
        grid-template-columns: 1fr;
    }
    .pro-map-col #map {
        height: 280px;
    }
    .map-search-overlay {
        width: min(320px, 72%);
    }
    #map {
        height: 250px;
    }
    .map-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .env-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .location-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .current-weather {
        text-align: center;
    }
    .chart-container {
        padding: 20px 16px;
    }
    .chart-panel {
        padding: 20px 16px;
    }
    .chart-panel canvas,
    .chart-container canvas {
        max-height: 240px;
    }
    .chart-tabs {
        gap: 4px;
        padding: 4px;
    }
    .metric-value {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .env-grid {
        grid-template-columns: 1fr 1fr;
    }
    .day-selector {
        flex-direction: column;
    }
    .slider-with-number {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .slider-number {
        width: 100%;
    }

    .peak-info {
        flex-direction: column;
        gap: 4px;
    }
    .chart-panel,
    .chart-container {
        padding: 16px 12px;
    }
    .chart-panel canvas,
    .chart-container canvas {
        max-height: 200px;
    }
    .chart-tab {
        font-size: 0.75rem;
        padding: 8px 6px;
        gap: 4px;
    }
}

/* ===================================
   DUAL-INTERFACE: MODE OVERLAY
   =================================== */
.mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    animation: fade-in 0.6s ease;
}

.mode-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,179,71,0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(124,77,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 24px;
    max-width: 700px;
    width: 100%;
}

.overlay-title {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-solar), #ff6723);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.2;
}

.overlay-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.mode-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 2px solid var(--border-card);
    border-radius: 24px;
    padding: 40px 28px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-family: var(--font-family);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.mode-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent-solar);
    box-shadow: 0 16px 48px rgba(255,179,71,0.15);
}

.mode-card:active {
    transform: translateY(-2px) scale(1.0);
}

.mode-card-icon {
    display: block;
    font-size: 3.5rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.mode-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.mode-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.mode-card-pro:hover {
    border-color: var(--accent-power);
    box-shadow: 0 16px 48px rgba(100,255,218,0.1);
}

.mode-card-easy:hover {
    border-color: var(--accent-solar);
    box-shadow: 0 16px 48px rgba(255,179,71,0.15);
}

/* ===================================
   HEADER: Language & Mode Switch
   =================================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-switch-btn {
    padding: 8px 16px;
    min-height: 44px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mode-switch-btn:hover {
    background: rgba(255,179,71,0.1);
    border-color: var(--accent-solar);
    transform: translateY(-1px);
}

.lang-select {
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px;
}

.lang-select:focus {
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.lang-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ===================================
   EASY HOME MODE — INPUT PANEL
   =================================== */
.village-input-panel {
    padding: 36px;
    margin-bottom: 32px;
}

.village-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

/* GPS Location Button */
.village-location-section {
    text-align: center;
    margin-bottom: 32px;
}

.village-geo-btn {
    width: 100%;
    max-width: 420px;
    min-height: 64px;
    padding: 16px 24px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 24px rgba(255,103,35,0.3);
}

.village-geo-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(255,103,35,0.4);
}

.village-geo-btn:active {
    transform: translateY(0);
}

.village-geo-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.village-geo-icon {
    font-size: 1.6rem;
}

/* Location Fixed Status */
.village-location-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 20px;
    background: rgba(100,255,218,0.08);
    border: 1px solid rgba(100,255,218,0.25);
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-power);
    animation: fade-in 0.4s ease;
}

.village-location-check {
    font-size: 1.4rem;
}

/* Panel Icon Picker */
.village-panel-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.village-panel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.35s ease;
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 160px;
}

.village-panel-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(255,179,71,0.12);
}

.village-panel-card.selected {
    background: rgba(255,179,71,0.12);
    border-color: var(--accent-solar);
    box-shadow: 0 0 0 3px rgba(255,179,71,0.2), 0 8px 28px rgba(255,179,71,0.15);
    transform: translateY(-2px);
}

.village-panel-icon {
    font-size: 2.4rem;
    margin-bottom: 4px;
}

.village-panel-name {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.village-panel-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Village Predict Button */
.village-predict-btn {
    width: 100%;
    min-height: 60px;
    padding: 16px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(255,103,35,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.village-predict-btn:hover:not(:disabled) {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255,103,35,0.4);
}

.village-predict-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.village-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.restart-action {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-bottom: 1rem;
}

.village-predict-again-btn {
    background: var(--input-bg);
    border: 2px solid var(--border-card);
    color: var(--text-primary);
    box-shadow: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.village-predict-again-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    box-shadow: 0 4px 16px rgba(255,179,71,0.15);
}

/* ===================================
   EASY HOME MODE — RESULTS
   =================================== */
.village-results-section {
    animation: fade-in-up 0.6s ease;
}

.village-energy-card {
    padding: 36px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.village-energy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-solar), var(--accent-power));
    border-radius: 20px 20px 0 0;
}

.village-energy-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.village-energy-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.village-energy-value span:first-child {
    font-size: 3.6rem;
    font-weight: 800;
    color: var(--accent-solar);
    line-height: 1;
}

.village-energy-unit {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.village-energy-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Energy Status Card */
.village-status-card {
    padding: 24px 28px;
    margin-bottom: 24px;
}

.village-status-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.village-status-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
}

.village-status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

.village-status-dot.status-good {
    background: #4caf50;
    box-shadow: 0 0 12px rgba(76,175,80,0.5);
}

.village-status-dot.status-ok {
    background: #ff9800;
    box-shadow: 0 0 12px rgba(255,152,0,0.5);
}

.village-status-dot.status-low {
    background: #f44336;
    box-shadow: 0 0 12px rgba(244,67,54,0.5);
}

.village-status-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
}

/* Color-coded text classes */
.color-good {
    color: #4caf50 !important;
}

.color-ok {
    color: #ff9800 !important;
}

.color-low {
    color: #f44336 !important;
}

[data-theme="light"] .color-good {
    color: #2e7d32 !important;
}

[data-theme="light"] .color-ok {
    color: #e65100 !important;
}

[data-theme="light"] .color-low {
    color: #c62828 !important;
}

/* Appliance Section */
.village-appliance-section {
    margin-bottom: 24px;
}

.village-appliance-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.village-appliance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.village-appliance-card {
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform 0.3s ease;
}

.village-appliance-card:hover {
    transform: translateY(-4px);
}

.appliance-icon {
    font-size: 2.4rem;
    margin-bottom: 4px;
}

.appliance-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.appliance-hours {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.appliance-advice {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

/* ===================================
   RESPONSIVE — MODE OVERLAY
   =================================== */
@media (max-width: 600px) {
    .mode-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .overlay-title {
        font-size: 1.8rem;
    }

    .overlay-subtitle {
        font-size: 0.95rem;
        margin-bottom: 28px;
    }

    .mode-card {
        padding: 28px 20px;
    }

    .mode-card-icon {
        font-size: 2.8rem;
    }

    .mode-card h2 {
        font-size: 1.2rem;
    }
}

/* Weather Cue Card (Village Mode) */
.village-weather-cue {
    padding: 24px 28px;
    margin-bottom: 20px;
    text-align: center;
}

.village-weather-cue h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.village-weather-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.village-weather-emoji {
    font-size: 4rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.village-weather-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.village-weather-temp {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.village-weather-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Safety Buffer Trust Note */
.village-safety-note {
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(100,255,218,0.06);
    border: 1px solid rgba(100,255,218,0.15);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    font-style: italic;
}

[data-theme="light"] .village-safety-note {
    background: rgba(13,155,118,0.06);
    border-color: rgba(13,155,118,0.15);
}

/* ===================================
   RESPONSIVE — EASY HOME MODE
   =================================== */
@media (max-width: 768px) {
    .village-panel-picker {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .village-panel-card {
        flex-direction: row;
        min-height: auto;
        padding: 18px 20px;
        gap: 14px;
        justify-content: flex-start;
    }

    .village-panel-icon {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .village-panel-name {
        font-size: 1rem;
    }

    .village-appliance-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .village-appliance-card {
        flex-direction: row;
        text-align: left;
        padding: 18px 20px;
        gap: 14px;
    }

    .appliance-icon {
        font-size: 2rem;
        margin-bottom: 0;
    }

    .appliance-hours {
        font-size: 1.4rem;
        margin-left: auto;
    }

    .appliance-advice {
        display: none;
    }

    .village-energy-value span:first-child {
        font-size: 2.8rem;
    }

    .header-right {
        gap: 6px;
    }

    .mode-switch-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .lang-select {
        font-size: 0.75rem;
        padding: 6px 24px 6px 8px;
    }
}

@media (max-width: 480px) {
    .village-geo-btn {
        font-size: 1.1rem;
        min-height: 56px;
        padding: 14px 20px;
    }

    .village-section-title {
        font-size: 1.3rem;
    }

    .village-input-panel {
        padding: 24px 16px;
    }

    .village-status-text {
        font-size: 0.95rem;
    }
}

/* ===================================
   NEW: ONBOARDING OVERLAY SUN ANIM
   =================================== */
.overlay-logo-anim {
    margin-bottom: 24px;
}

.overlay-sun {
    font-size: 4rem;
    display: inline-block;
    animation: sun-float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(255,179,71,0.5));
}

@keyframes sun-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.08); }
}

/* Mode card preview chips */
.mode-preview-features {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.preview-chip {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,179,71,0.1);
    border: 1px solid rgba(255,179,71,0.2);
    color: var(--text-secondary);
    font-weight: 600;
}

/* Recommended badge */
.mode-card-recommended {
    position: absolute;
    top: -1px;
    right: -1px;
    padding: 6px 14px;
    border-radius: 0 22px 0 14px;
    background: linear-gradient(135deg, #ffb347, #ff6723);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 2;
}

.mode-card { position: relative; }

/* ===================================
   NEW: ONBOARDING TOUR
   =================================== */
.onboarding-tour {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}

.onboarding-card {
    position: relative;
    z-index: 1;
    padding: 40px 36px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: fade-in-up 0.5s ease;
}

.onboarding-step-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.onboarding-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.onboarding-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 20px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--input-border);
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    background: var(--accent-solar);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255,179,71,0.4);
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.onboarding-skip-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.onboarding-skip-btn:hover {
    border-color: var(--accent-solar);
    color: var(--text-primary);
}

.onboarding-next-btn {
    padding: 10px 24px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(255,103,35,0.25);
}

.onboarding-next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,103,35,0.35);
}

/* ===================================
   NEW: FORM STEP INDICATORS
   =================================== */
.form-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 16px 0;
}

.form-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.form-step.active {
    opacity: 1;
}

.form-step.completed {
    opacity: 0.8;
}

.form-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.form-step.active .form-step-num {
    background: var(--btn-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(255,179,71,0.3);
}

.form-step.completed .form-step-num {
    background: var(--accent-power);
    border-color: transparent;
    color: #0a0e1a;
}

.form-step-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-step.active .form-step-label {
    color: var(--text-primary);
}

.form-step-line {
    width: 40px;
    height: 2px;
    background: var(--input-border);
    margin: 0 8px;
    border-radius: 2px;
}

/* ===================================
   NEW: PREDICTION PROGRESS STEPPER
   =================================== */
.prediction-progress {
    margin-top: 20px;
    padding: 20px 24px;
    background: var(--input-bg);
    border-radius: 14px;
    border: 1px solid var(--border-card);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.done {
    opacity: 0.7;
}

.progress-icon {
    font-size: 1.2rem;
}

.progress-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-step.active .progress-label {
    color: var(--text-primary);
}

.progress-check {
    font-size: 1rem;
    color: var(--accent-power);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-step.done .progress-check {
    opacity: 1;
}

.progress-step.active .progress-icon {
    animation: sun-spin 0.9s linear infinite;
}

.progress-estimate {
    text-align: center;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===================================
   NEW: ERROR BOX WITH RETRY
   =================================== */
.error-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-text-content {
    flex: 1;
    min-width: 200px;
}

.error-retry-btn {
    padding: 8px 16px;
    background: rgba(255,82,82,0.15);
    border: 1px solid rgba(255,82,82,0.35);
    border-radius: 8px;
    color: var(--error-text);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.error-retry-btn:hover {
    background: rgba(255,82,82,0.25);
    transform: translateY(-1px);
}

/* ===================================
   NEW: SKELETON LOADER
   =================================== */
.skeleton-location {
    padding: 28px 32px;
    margin-bottom: 24px;
}

.skeleton-card {
    padding: 28px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.skeleton-line {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--input-bg) 25%, rgba(255,255,255,0.08) 50%, var(--input-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    width: 80%;
}

.skeleton-line.short { width: 50%; }
.skeleton-line.skeleton-title { height: 22px; width: 40%; margin-bottom: 8px; }
.skeleton-line.skeleton-subtitle { height: 12px; width: 60%; }

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--input-bg) 25%, rgba(255,255,255,0.08) 50%, var(--input-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-chart {
    padding: 28px;
    margin-bottom: 24px;
}

.skeleton-chart-area {
    height: 200px !important;
    width: 100% !important;
}

[data-theme="light"] .skeleton-line,
[data-theme="light"] .skeleton-circle {
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.06) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===================================
   NEW: STAGGER ENTRANCE ANIMATIONS
   =================================== */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   NEW: INSIGHT BANNER
   =================================== */
.insight-banner {
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(255,179,71,0.08), rgba(100,255,218,0.06));
    border-left: 4px solid var(--accent-solar);
    animation: fade-in-up 0.6s ease;
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===================================
   NEW: CHART TABS
   =================================== */
.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--input-bg);
    border-radius: 14px;
    border: 1px solid var(--border-card);
}

.chart-tab {
    flex: 1;
    padding: 10px 16px;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chart-tab.active {
    background: var(--btn-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,103,35,0.25);
}

.chart-tab:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.chart-panel {
    padding: 28px;
    animation: fade-in 0.3s ease;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-panel canvas {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: 320px;
    display: block;
}

/* ===================================
   NEW: SHARE BUTTON
   =================================== */
.download-section {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 14px 32px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-power);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100,255,218,0.15);
}

/* ===================================
   NEW: COST SAVINGS CARD (Village)
   =================================== */
.village-savings-card {
    padding: 28px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.village-savings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #69f0ae);
    border-radius: 20px 20px 0 0;
}

.village-savings-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.savings-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.savings-currency {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-co2);
}

.savings-value #village-savings-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-co2);
    line-height: 1;
}

.savings-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.savings-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===================================
   NEW: MAP TOOLTIP
   =================================== */
.map-tooltip {
    margin-top: 8px;
    padding: 12px 16px;
    background: rgba(255,179,71,0.08);
    border: 1px solid rgba(255,179,71,0.2);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fade-in 0.3s ease;
}

.map-tooltip-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.map-tooltip-close:hover {
    color: var(--text-primary);
}

/* ===================================
   NEW: MOBILE STICKY ACTION BAR
   =================================== */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-card);
    backdrop-filter: blur(20px);
    z-index: 100;
}

.mobile-predict-btn {
    width: 100%;
    padding: 14px;
    min-height: 52px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,103,35,0.3);
    transition: all 0.25s ease;
}

.mobile-predict-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255,103,35,0.4);
}

@media (min-width: 769px) {
    .mobile-sticky-bar { display: none !important; }
}

@media (max-width: 768px) {
    .predict-btn { display: none; }
    body { padding-bottom: 76px; }
}

/* ===================================
   NEW: ENHANCED FOOTER
   =================================== */
.app-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-card);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-solar);
}

.footer-powered {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-powered > span:first-child {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.powered-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.powered-badge {
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===================================
   NEW: THEME SWITCH (Sliding) FIX
   =================================== */
.theme-switch {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 0 6px;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-card);
    position: relative;
    transition: background 0.25s ease;
}

.theme-thumb-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,179,71,0.18);
    border: 1px solid rgba(255,179,71,0.35);
    transition: left 0.25s ease, background 0.25s ease;
    font-size: 0.95rem;
}

html[data-theme="light"] .theme-thumb-icon {
    left: 28px;
    background: rgba(255,152,0,0.22);
    border-color: rgba(255,152,0,0.5);
}

.theme-switch:focus-within .theme-track {
    box-shadow: 0 0 0 3px var(--input-focus);
}

@media (max-width: 600px) {
    .onboarding-card { padding: 28px 20px 20px; }
    .onboarding-step-icon { font-size: 2.4rem; }
    .onboarding-card h3 { font-size: 1.1rem; }
    .form-steps { gap: 0; flex-wrap: nowrap; }
    .form-step-label { font-size: 0.72rem; }
    .form-step-line { width: 24px; }
    .chart-tab { font-size: 0.78rem; padding: 8px 10px; }
    .footer-links { gap: 16px; }
}

/* ===================================
   EASY HOME MODE: PREMIUM UI REVAMP
   =================================== */

/* Ambient Mesh Background */
.easy-mode-container {
    position: relative;
    z-index: 1;
    min-height: 80vh;
}

.easy-bg-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(255, 179, 71, 0.12), transparent 40%),
                radial-gradient(circle at 85% 30%, rgba(255, 103, 35, 0.08), transparent 40%);
    pointer-events: none;
    animation: mesh-breathe 8s ease-in-out infinite alternate;
}

@keyframes mesh-breathe {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* Wizard Steps */
.village-wizard-step {
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.wizard-header {
    margin-bottom: 24px;
}

.wizard-step-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255,179,71,0.15);
    color: var(--accent-solar);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Radar Animation (Step 1) */
.radar-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-solar);
    opacity: 0;
    animation: radar-ping 3s cubic-bezier(0.21, 0.53, 0.56, 0.8) infinite;
}

.radar-ring.delay-1 { animation-delay: 1s; }
.radar-ring.delay-2 { animation-delay: 2s; }

@keyframes radar-ping {
    0% { transform: scale(0.2); opacity: 0.8; }
    80% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
}

.radar-btn {
    position: relative;
    z-index: 2;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--btn-gradient);
    border: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 103, 35, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radar-btn:hover {
    transform: scale(1.05) translateY(-5px);
}

.radar-btn.pulse {
    animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 103, 35, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 103, 35, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 103, 35, 0); }
}

.village-geo-icon { font-size: 2rem; }
.btn-text-geo { font-weight: 700; font-size: 0.85rem; }

.location-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(100,255,218,0.1);
    border: 1px solid rgba(100,255,218,0.3);
    border-radius: 30px;
    color: var(--accent-power);
    font-weight: 600;
    margin-top: 16px;
}

/* SVG House Illustration (Step 2) */
.home-illustration-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 32px;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.3));
}

.house-svg { width: 100%; height: auto; }

.house-svg polygon, .house-svg rect {
    transition: all 0.5s ease;
}

.svg-panel-item {
    animation: drop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center;
}

@keyframes drop-in {
    0% { transform: translateY(-20px) scale(0.8); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Predict Action Area */
.predict-action-area {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.glow-effect:not([disabled]) {
    animation: predict-glow 2s infinite alternate;
}

@keyframes predict-glow {
    0% { box-shadow: 0 5px 15px rgba(255,179,71,0.2); }
    100% { box-shadow: 0 5px 30px rgba(255,179,71,0.6); }
}

/* Sliding Animations */
.slide-up {
    animation: slide-up-fade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-up-fade {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Premium Widgets Row */
.premium-widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Apple Weather Style Widget */
.apple-weather-widget {
    position: relative;
    overflow: hidden;
    padding: 24px;
    color: white;
    border: none;
}

.weather-bg-gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #4A90E2, #50E3C2);
    opacity: 0.8;
    transition: background 1s ease;
}

/* Weather Themes */
.weather-bg-gradient.clear { background: linear-gradient(to bottom, #57c1eb 0%, #246bfd 100%); }
.weather-bg-gradient.clouds { background: linear-gradient(to bottom, #8ca8bf 0%, #4a637d 100%); }
.weather-bg-gradient.rain { background: linear-gradient(to bottom, #2b4162 0%, #12100e 100%); }

.weather-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.weather-content h3 { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 12px; }
.weather-main-row { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.weather-big-emoji { font-size: 3.5rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2)); }
.weather-big-temp { font-size: 2.8rem; font-weight: 300; letter-spacing: -1px; }
.weather-desc { font-size: 1.1rem; font-weight: 500; text-transform: capitalize; }

/* Fintech Savings Card */
.fintech-savings-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 10px 30px rgba(0,0,0,0.5);
}

.hologram-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, transparent 20%, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 60%, transparent 80%);
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fintech-savings-card:hover .hologram-overlay {
    opacity: 1;
    animation: holo-sweep 2s infinite linear;
}

@keyframes holo-sweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fintech-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.fintech-value {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.fintech-value .currency { font-size: 1.5rem; color: #4ade80; margin-top: 6px; margin-right: 4px; }
.fintech-value .counter { font-size: 3.5rem; font-weight: 800; line-height: 1; color: white; letter-spacing: -1px; }

.fintech-label { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 4px; }
.fintech-rate { font-size: 0.75rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }

/* Interactive Battery Section */
.interactive-battery-section {
    padding: 32px;
    margin-bottom: 24px;
}

.battery-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.battery-layout-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: stretch;
}

/* Battery Tank */
.battery-tank-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.battery-tank {
    width: 140px;
    height: 300px;
    border: 4px solid var(--border-card);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 30px rgba(100,255,218,0.1);
}

.battery-tank::before {
    content: '';
    position: absolute;
    top: -10px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 10px;
    background: var(--border-card);
    border-radius: 6px 6px 0 0;
}

.battery-liquid {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100%; /* controlled by JS */
    background: linear-gradient(to top, #00b09b, #96c93d);
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s ease;
}

.battery-liquid.warning { background: linear-gradient(to top, #ffb347, #ff9200); }
.battery-liquid.danger { background: linear-gradient(to top, #cb2d3e, #ef473a); }

.waves {
    position: absolute;
    top: -15px; left: 0; right: 0;
    width: 200%;
    animation: wave-slide 3s infinite linear;
}

@keyframes wave-slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.battery-value-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    color: white;
}

#battery-percent-text { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.pct { font-size: 1.2rem; font-weight: 700; }
.battery-kwh-text { font-size: 0.85rem; font-weight: 600; opacity: 0.95; margin-top: 4px; text-align: center; padding: 0 8px; }

.battery-tip { font-size: 0.85rem; color: var(--text-secondary); text-align: center; }

/* Interactive Appliance grid */
.battery-controls-col h3 { font-size: 1.1rem; margin-bottom: 20px; color: var(--text-primary); }

.appliance-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.appliance-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.appliance-pill:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.appliance-pill.active {
    background: rgba(100,255,218,0.1);
    border-color: var(--accent-power);
    box-shadow: 0 4px 15px rgba(100,255,218,0.15);
    transform: translateY(-2px);
}

.app-icon { font-size: 2rem; filter: grayscale(1); transition: filter 0.2s ease; }
.appliance-pill.active .app-icon { filter: grayscale(0); }

.app-name { font-size: 0.85rem; font-weight: 600; text-align: center; }
.app-drain { font-size: 0.75rem; color: var(--text-muted); }
.appliance-pill.active .app-drain { color: var(--accent-power); }

/* Confetti overlay */
.confetti {
    position: fixed;
    width: 10px; height: 10px;
    background-color: #f2d74e;
    z-index: 1000;
    animation: fall 3s linear forwards;
}
@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 768px) {
    .premium-widgets-row { grid-template-columns: 1fr; }
    .battery-layout-grid { grid-template-columns: 1fr; gap: 24px; }
    .battery-tank-wrapper { flex-direction: column; align-items: center; justify-content: center; }
    .battery-tank { width: 130px; height: 260px; }
    .battery-tank::before { width: 56px; height: 8px; }
    #battery-percent-text { font-size: 2.6rem; line-height: 1; }
    .pct { font-size: 1.2rem; }
    .battery-value-overlay { padding: 0 10px; }
    .battery-kwh-text { font-size: 0.9rem; text-align: center; }
}

/* ===================================
   RESPONSIVE LAYOUT OVERRIDES (Global)
   =================================== */

@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .env-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .pro-dashboard {
        grid-template-columns: 1fr !important;
    }
    #advanced-specs {
        grid-template-columns: 1fr;
    }
    .form-row.simplified-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    .mobile-menu-btn {
        display: block !important;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.8rem;
        cursor: pointer;
        padding: 0 10px;
    }
    .header-right {
        display: none !important;
        width: 100%;
        flex-direction: column;
        align-items: center;
        margin-top: 16px;
        gap: 16px;
    }
    .header-right.active {
        display: flex !important;
    }
    .logo h1 {
        font-size: 1.4rem;
    }
    .tagline {
        display: none;
    }
    .container {
        padding: 0 16px 40px;
    }
    .input-panel {
        padding: 24px;
    }
    .form-row, .pro-dashboard {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
    }
    .pro-map-col #map {
        height: 280px;
    }
    #map {
        height: 250px;
    }
    .map-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .metrics-grid, .env-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .location-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .current-weather {
        text-align: center;
        justify-content: center;
    }
    /* Easy Mode Panel Adjustments */
    .village-panel-picker, .village-appliance-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .village-panel-card, .village-appliance-card {
        flex-direction: row !important;
        min-height: auto;
        padding: 18px 20px;
        gap: 14px;
        justify-content: flex-start;
    }
    .appliance-icon, .village-panel-icon {
        font-size: 2rem;
        margin-bottom: 0;
    }
    .village-energy-value span:first-child {
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
    .env-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .day-selector {
        flex-direction: column;
    }
    .slider-with-number {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .slider-number {
        width: 100%;
    }
    .peak-info {
        flex-direction: column;
        gap: 4px;
    }
    .village-geo-btn {
        font-size: 1.1rem;
        min-height: 56px;
        padding: 14px 20px;
    }
    .village-section-title {
        font-size: 1.3rem;
    }
    .village-input-panel {
        padding: 24px 16px;
    }
    .village-status-text {
        font-size: 0.95rem;
    }
}

    /* ===================================
   BILL CALCULATOR
   All selectors scoped to .bill-* and
   #bill-* — zero collision with existing rules.
   =================================== */

    /* Outer section card — padding overrides glass-card via higher specificity */
    section.bill-calc-section {
        margin: 2rem 0 1rem;
        padding: 2rem 2.2rem 2rem;
        box-sizing: border-box;
    }

    /* Orange heading with gradient rule line */
    .bill-calc-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent-solar);
        margin-bottom: 1.35rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        letter-spacing: 0.02em;
    }
    .bill-calc-title::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, rgba(255,179,71,0.3), transparent);
        margin-left: 0.4rem;
    }

    /* Four-column input grid */
    .bill-inputs-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
        gap: 1rem;
        margin-bottom: 1.1rem;
    }

    .bill-input-group {
        display: flex;
        flex-direction: column;
        gap: 0.38rem;
    }

    .bill-input-group label {
        font-size: 0.71rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    /* Unified field style — select and number input are pixel-identical.
    appearance:none kills browser-native styling on select (solid grey box).
    Explicit height:46px ensures both render the same across browsers.        */
    .bill-input-group select,
    .bill-input-group input[type="number"] {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background: var(--input-bg);
        border: 1px solid var(--input-border);
        border-radius: 10px;
        color: var(--text-primary);
        height: 46px;
        padding: 0 0.88rem;
        font-size: 0.875rem;
        font-family: var(--font-family);
        font-weight: 400;
        line-height: 1;
        outline: none;
        transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
        width: 100%;
        box-sizing: border-box;
    }

    /* Custom chevron arrow on select — replaces browser-native arrow */
    .bill-input-group select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.85rem center;
        padding-right: 2.2rem;
        cursor: pointer;
    }

    /* Light theme chevron (dark stroke) & fix input visibility */
    [data-theme="light"] .bill-input-group select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(0,0,0,0.6)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.85rem center;
        background-color: rgba(0, 0, 0, 0.03);
    }
    
    [data-theme="light"] .bill-input-group input[type="number"] {
        background-color: rgba(0, 0, 0, 0.03);
    }
    
    [data-theme="light"] .bill-input-group select,
    [data-theme="light"] .bill-input-group input[type="number"] {
        color: #1a1a2e;
    }
    
    [data-theme="light"] .bill-input-group select option {
        background-color: #ffffff;
        color: #1a1a2e;
    }
    
    [data-theme="light"] .bill-input-group input::placeholder {
        color: #a0aec0;
    }

    [data-theme="light"] .bill-input-group label {
        color: #4a5568;
        font-weight: 700;
    }

    [data-theme="light"] .bill-type-toggle button:not(.active) {
        color: #4a5568;
    }
    
    [data-theme="light"] .bill-input-optional-note {
        color: #718096;
    }

    /* Remove number spinner arrows — they break visual parity with select */
    .bill-input-group input[type="number"]::-webkit-inner-spin-button,
    .bill-input-group input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    .bill-input-group input[type="number"] {
        -moz-appearance: textfield;
    }

    .bill-input-group input::placeholder {
        color: var(--text-muted);
    }

    /* Focus state — identical glow on both field types */
    .bill-input-group select:focus,
    .bill-input-group input[type="number"]:focus {
        border-color: var(--accent-solar);
        background: rgba(255,179,71,0.05);
        box-shadow: 0 0 0 3px var(--input-focus);
    }

    .bill-input-group select option {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    /* Optional helper text below installation cost input */
    .bill-input-optional-note {
        font-size: 0.66rem;
        color: var(--text-muted);
        margin-top: 0.1rem;
    }

    /* Connection type label row */
    .bill-type-label-row {
        margin-bottom: 1.05rem;
    }

    /* Green prefill badge — uses visibility (not display) so it always
    occupies space and never shifts other columns' height */
    .bill-prefill-badge {
        font-size: 0.66rem;
        color: var(--accent-co2);
        display: flex;
        visibility: hidden;
        align-items: center;
        gap: 0.22rem;
        margin-top: 0.12rem;
        min-height: 1em;
    }
    .bill-prefill-badge.visible {
        visibility: visible;
    }

    /* Domestic / Commercial toggle — mirrors .day-selector pattern */
    .bill-type-toggle {
        display: flex;
        border: 1px solid var(--input-border);
        border-radius: 10px;
        overflow: hidden;
        max-width: 255px;
        margin-bottom: 1.1rem;
    }
    .bill-type-toggle button {
        flex: 1;
        padding: 0.58rem 0;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 0.82rem;
        font-weight: 600;
        font-family: var(--font-family);
        cursor: pointer;
        transition: all 0.16s;
    }
    .bill-type-toggle button.active {
        background: var(--btn-gradient);
        color: #fff;
    }
    .bill-type-toggle button:hover:not(.active) {
        background: var(--bg-card-hover);
        color: var(--text-primary);
    }

    /* Calculate button — mirrors .predict-btn */
    .bill-calc-btn {
        background: var(--btn-gradient);
        color: #fff;
        border: none;
        border-radius: 12px;
        padding: 0.8rem 1.6rem;
        font-size: 0.92rem;
        font-weight: 700;
        font-family: var(--font-family);
        cursor: pointer;
        width: 100%;
        transition: transform 0.14s, box-shadow 0.14s;
        letter-spacing: 0.02em;
        margin-bottom: 1.5rem;
        box-shadow: 0 6px 20px rgba(255,103,35,0.25);
    }
    .bill-calc-btn:hover:not(:disabled) {
        background: var(--btn-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 28px rgba(255,103,35,0.35);
    }
    .bill-calc-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* Loading spinner */
    .bill-loading {
        display: none;
        text-align: center;
        padding: 1.6rem;
        color: var(--text-muted);
        font-size: 0.86rem;
    }
    .bill-loading.visible { display: block; }

    .bill-spinner {
        width: 28px;
        height: 28px;
        border: 3px solid rgba(255,179,71,0.18);
        border-top-color: var(--accent-solar);
        border-radius: 50%;
        animation: bill-spin 0.72s linear infinite;
        margin: 0 auto 0.65rem;
    }
    @keyframes bill-spin { to { transform: rotate(360deg); } }

    /* Error box — mirrors .error-box */
    .bill-error-box {
        display: none;
        background: var(--error-bg);
        border: 1px solid var(--error-border);
        border-radius: 10px;
        padding: 0.8rem 0.95rem;
        color: var(--error-text);
        font-size: 0.82rem;
        margin-bottom: 0.9rem;
    }
    .bill-error-box.visible { display: block; }

    /* Results container — top border separates results from the button */
    #bill-results {
        display: none;
        animation: bill-fadein 0.36s ease;
        margin-top: 1.6rem;
        padding-top: 1.6rem;
        border-top: 1px solid var(--border-card);
    }
    #bill-results.visible { display: block; }

    @keyframes bill-fadein {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Before / After bill comparison cards */
    .bill-comparison-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
        align-items: center;
        margin-bottom: 1.4rem;
    }
    .bill-compare-card {
        border-radius: 14px;
        padding: 1.6rem 1.2rem 1.4rem;
        text-align: center;
    }
    .bill-compare-card.before {
        background: rgba(239,68,68,0.07);
        border: 1px solid rgba(239,68,68,0.22);
    }
    .bill-compare-card.after {
        background: rgba(74,222,128,0.07);
        border: 1px solid rgba(74,222,128,0.22);
    }
    .bill-compare-label {
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--text-muted);
        margin-bottom: 0.55rem;
    }
    .bill-compare-amount {
        font-size: 2.6rem;
        font-weight: 800;
        line-height: 1;
        margin-bottom: 0.4rem;
        letter-spacing: -0.01em;
    }
    .bill-compare-card.before .bill-compare-amount { color: #f87171; }
    .bill-compare-card.after  .bill-compare-amount { color: #4ade80; }
    .bill-compare-sub {
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-top: 0.1rem;
    }
    .bill-arrow-sep {
        font-size: 1.6rem;
        color: var(--accent-solar);
        text-align: center;
        user-select: none;
        flex-shrink: 0;
    }

    /* Net metering export banner */
    .bill-netmeter-banner {
        display: none;
        background: rgba(105,240,174,0.07);
        border: 1px solid rgba(105,240,174,0.25);
        border-radius: 10px;
        padding: 0.8rem 0.95rem;
        color: var(--accent-co2);
        font-size: 0.82rem;
        margin-bottom: 1.3rem;
        align-items: flex-start;
        gap: 0.45rem;
        line-height: 1.5;
    }
    .bill-netmeter-banner.visible { display: flex; }

    /* Four savings summary cards */
    .bill-savings-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    .bill-saving-card {
        background: var(--bg-card);
        border: 1px solid var(--border-card);
        border-radius: 13px;
        padding: 1.3rem 1rem 1.2rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.28rem;
    }
    .bill-saving-icon { font-size: 1.35rem; }
    .bill-saving-value {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--accent-solar);
    }
    .bill-saving-label {
        font-size: 0.64rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
    }

    /* Slab-by-slab breakdown table */
    .bill-slab-wrapper {
        background: var(--bg-card);
        border: 1px solid var(--border-card);
        border-radius: 13px;
        overflow: hidden;
        margin-bottom: 1.4rem;
    }
    .bill-slab-title {
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.09em;
        color: var(--text-muted);
        padding: 0.9rem 1.1rem 0.55rem;
    }
    .bill-slab-head,
    .bill-slab-row {
        display: grid;
        grid-template-columns: 1.2fr 0.85fr 1fr 1fr 1fr;
        padding: 0.72rem 1.1rem;
        font-size: 0.79rem;
        gap: 0.3rem;
    }
    .bill-slab-head {
        background: var(--bg-card-hover);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.67rem;
        letter-spacing: 0.07em;
        border-bottom: 1px solid var(--border-card);
    }
    .bill-slab-row {
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-card);
        transition: background 0.11s;
    }
    .bill-slab-row:last-child { border-bottom: none; }
    .bill-slab-row:hover { background: var(--bg-card-hover); }
    .bill-slab-row .col-before { color: #f87171; }
    .bill-slab-row .col-after  { color: #4ade80; }
    .bill-slab-row .col-saved  { color: var(--accent-co2); font-weight: 700; }

    /* Payback period card */
    .bill-payback-card {
        background: var(--bg-card);
        border: 1px solid var(--border-card);
        border-radius: 13px;
        padding: 1.3rem 1.4rem 1.2rem;
        display: none;
    }
    .bill-payback-card.visible { display: block; }
    .bill-payback-label {
        font-size: 0.69rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-muted);
        margin-bottom: 0.65rem;
    }
    .bill-payback-bar-bg {
        background: var(--slider-track);
        border-radius: 5px;
        height: 6px;
        overflow: hidden;
        margin-bottom: 0.48rem;
    }
    .bill-payback-bar-fill {
        height: 100%;
        background: linear-gradient(to right, var(--accent-co2), var(--accent-solar));
        border-radius: 5px;
        width: 0%;
        transition: width 0.85s ease;
    }
    .bill-payback-text {
        font-size: 0.81rem;
        color: var(--text-secondary);
        line-height: 1.5;
    }
    .bill-payback-text strong {
        color: var(--accent-solar);
        font-size: 0.97rem;
    }

    /* Battery overlay flex row (Easy Mode) */
    .battery-percent-row {
        display: flex;
        align-items: baseline;
        justify-content: center;
        gap: 2px;
    }

    /* ── Responsive ── */
    @media (max-width: 560px) {
        section.bill-calc-section {
            padding: 1.25rem 1.1rem 1.1rem;
        }
        .bill-comparison-row {
            grid-template-columns: 1fr;
        }
        .bill-arrow-sep {
            display: none;
        }
        .bill-slab-head,
        .bill-slab-row {
            grid-template-columns: 1.1fr 0.75fr 0.9fr;
            font-size: 0.71rem;
        }
        /* Keep Range | Rate | Saved; hide Before/After columns */
        .bill-slab-head span:nth-child(3),
        .bill-slab-head span:nth-child(4),
        .bill-slab-row  span:nth-child(3),
        .bill-slab-row  span:nth-child(4) {
            display: none;
        }
    }

/* ===================================
   PREDICTION HISTORY PANEL
   Slide-out drawer from the right side
   =================================== */

.history-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    position: relative;
}
.history-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-solar);
    transform: translateY(-1px);
}
[data-theme="light"] .history-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .history-btn:hover {
    background: rgba(0,0,0,0.08);
}

.history-badge {
    background: var(--accent-solar);
    color: #1a1a2e;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.history-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.history-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.history-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 92vw;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-card);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
}
.history-panel.active {
    transform: translateX(0);
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
    flex-shrink: 0;
}
.history-panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-close-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s ease;
}
.history-close-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}
[data-theme="light"] .history-close-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

.history-compare-bar {
    display: none;
    padding: 12px 24px;
    background: rgba(255,179,71,0.08);
    border-bottom: 1px solid rgba(255,179,71,0.2);
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.history-compare-bar.active { display: flex; }

.compare-info {
    font-size: 0.8rem;
    color: var(--accent-solar);
    font-weight: 600;
    flex: 1;
}
.compare-run-btn {
    background: var(--btn-gradient);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.compare-run-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.compare-cancel-btn {
    background: transparent;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
}
.compare-cancel-btn:hover { border-color: rgba(239,68,68,0.4); color: #f87171; }

.history-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-card);
    flex-shrink: 0;
}
.history-search {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
}
.history-search:focus { border-color: var(--accent-solar); }
.history-search::placeholder { color: var(--text-muted); }

.history-compare-toggle {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: var(--text-secondary);
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.history-compare-toggle:hover { border-color: var(--accent-solar); color: var(--accent-solar); }
.history-compare-toggle.active {
    background: rgba(255,179,71,0.12);
    border-color: var(--accent-solar);
    color: var(--accent-solar);
}
[data-theme="light"] .history-compare-toggle {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}
.history-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.history-empty p { font-size: 1.05rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.history-empty span { font-size: 0.82rem; }

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    animation: hist-card-in 0.3s ease backwards;
}
@keyframes hist-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.history-card:hover {
    border-color: rgba(255,179,71,0.35);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.history-card.selected {
    border-color: var(--accent-solar);
    background: rgba(255,179,71,0.06);
    box-shadow: 0 0 0 2px rgba(255,179,71,0.2);
}

.history-card-check {
    display: none;
    position: absolute;
    top: 12px;
    right: 14px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-card);
    border-radius: 6px;
    background: var(--input-bg);
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.compare-mode .history-card-check { display: flex; }
.history-card.selected .history-card-check {
    background: var(--accent-solar);
    border-color: var(--accent-solar);
    color: #1a1a2e;
}

.history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.history-card-city {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.history-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.history-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.history-metric {
    text-align: center;
    padding: 8px 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
[data-theme="light"] .history-metric { background: rgba(0,0,0,0.03); }

.history-metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-solar);
    line-height: 1.2;
}
.history-metric-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}

.history-compare-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.compare-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.compare-back-btn {
    background: transparent;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.15s;
}
.compare-back-btn:hover { border-color: var(--accent-solar); color: var(--accent-solar); }

.compare-city-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.compare-city-card {
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
}
.compare-city-card.older {
    background: rgba(99,179,237,0.08);
    border: 1px solid rgba(99,179,237,0.2);
}
.compare-city-card.newer {
    background: rgba(255,179,71,0.08);
    border: 1px solid rgba(255,179,71,0.2);
}
.compare-city-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.compare-city-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.compare-metric-row {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 10px;
    align-items: center;
}
.compare-metric-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    grid-column: 1 / -1;
    margin-bottom: -2px;
}
.compare-value {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.compare-vs {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.compare-delta {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
}
.compare-delta.positive { color: #4ade80; background: rgba(74,222,128,0.1); }
.compare-delta.negative { color: #f87171; background: rgba(239,68,68,0.1); }
.compare-delta.neutral  { color: var(--text-muted); background: rgba(255,255,255,0.05); }

@media (max-width: 480px) {
    .history-panel { width: 100vw; max-width: 100vw; }
    .history-card-metrics { gap: 6px; }
    .compare-metric-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .compare-vs { display: none; }
}

/* Bill info row on history cards */
.history-card-bill {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}
[data-theme="light"] .history-card-bill {
    border-top-color: rgba(0,0,0,0.06);
}
.history-bill-badge {
    font-size: 0.76rem;
    font-weight: 700;
    color: #4ade80;
    background: rgba(74,222,128,0.1);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.history-bill-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Compare section divider */
.compare-section-divider {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-solar);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 0 8px;
    margin-top: 6px;
    border-top: 1px solid var(--border-card);
}

/* Note when only one prediction has bill data */
.compare-section-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,179,71,0.06);
    border: 1px solid rgba(255,179,71,0.15);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    line-height: 1.5;
}

/* ===================================
   TIER 1: TOAST NOTIFICATION SYSTEM
   =================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 48px);
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    animation: toast-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.toast.removing {
    animation: toast-slide-out 0.35s ease forwards;
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.toast-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

/* Toast progress bar (auto-dismiss timer) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    animation: toast-progress-shrink linear forwards;
}

/* Toast variants */
.toast.toast-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}
.toast.toast-success .toast-progress { background: #10b981; }

.toast.toast-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}
.toast.toast-error .toast-progress { background: #ef4444; }

.toast.toast-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
.toast.toast-warning .toast-progress { background: #f59e0b; }

.toast.toast-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}
.toast.toast-info .toast-progress { background: #3b82f6; }

[data-theme="light"] .toast {
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .toast.toast-success { background: rgba(16, 185, 129, 0.08); }
[data-theme="light"] .toast.toast-error   { background: rgba(239, 68, 68, 0.08); }
[data-theme="light"] .toast.toast-warning { background: rgba(245, 158, 11, 0.08); }
[data-theme="light"] .toast.toast-info    { background: rgba(59, 130, 246, 0.08); }

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(80px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-slide-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(80px) scale(0.9); }
}
@keyframes toast-progress-shrink {
    from { width: 100%; }
    to   { width: 0%; }
}

@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

/* ===================================
   TIER 1: SCROLL-TO-TOP FAB
   =================================== */
.scroll-top-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9990;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-top-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-solar);
    box-shadow: 0 8px 32px rgba(255,179,71,0.2);
    transform: translateY(-3px) scale(1.05);
}

.scroll-top-btn:active {
    transform: translateY(0) scale(0.95);
}

[data-theme="light"] .scroll-top-btn {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

@media (max-width: 480px) {
    .scroll-top-btn {
        bottom: 20px;
        left: 16px;
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* ===================================
   TIER 1: FOOTER REDESIGN
   =================================== */
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-brand p {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.footer-logo-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 6px rgba(255,179,71,0.3));
}

.footer-version-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,179,71,0.1);
    border: 1px solid rgba(255,179,71,0.2);
    color: var(--accent-solar);
    letter-spacing: 0.3px;
}

.footer-link-dot {
    color: var(--text-muted);
    font-size: 1.1rem;
    user-select: none;
}

.footer-links a#footer-github {
    color: var(--accent-solar);
}
.footer-links a#footer-github:hover {
    color: #ff6723;
}

/* ===================================
   TIER 1: SLIDER TRACK FILL COLOR
   =================================== */
/* The fill is applied via JS (inline background),
   but these base styles ensure the right visual: */
input[type="range"] {
    background: var(--slider-track);
    border-radius: 3px;
    transition: background 0.1s ease;
}

/* ===================================
   TIER 1: METRIC CARD VALUE ENTRANCE
   =================================== */
.metric-value {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.metric-value.counting {
    animation: metric-pop 0.3s ease;
}

@keyframes metric-pop {
    0%   { transform: scale(0.6); opacity: 0.3; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Environmental impact value counter entrance */
.env-value.counting {
    animation: metric-pop 0.3s ease;
}

/* ===================================
   COLLAPSIBLE ACCORDION SECTIONS
   Wrap non-essential results blocks.
   Expanded on desktop, collapsed on mobile.
   =================================== */

/* Toggle button — full-width clickable header bar */
.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 0 0;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
    transition: background 0.25s ease;
}

/* Keep the h3 styling untouched */
.accordion-toggle h3 {
    pointer-events: none;
    margin-bottom: 0;
}

.accordion-toggle:hover {
    background: rgba(255, 179, 71, 0.04);
}

.accordion-toggle:focus-visible {
    box-shadow: 0 0 0 2px var(--accent-solar);
    border-radius: 8px;
}

/* Chevron indicator — pure CSS triangle */
.accordion-chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 179, 71, 0.08);
    border: 1px solid rgba(255, 179, 71, 0.15);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease;
    position: relative;
}

.accordion-chevron::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent-solar);
    border-bottom: 2px solid var(--accent-solar);
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover the pill */
.accordion-toggle:hover .accordion-chevron {
    background: rgba(255, 179, 71, 0.14);
}

/* Collapsed state — chevron rotates to point right */
.accordion-toggle[aria-expanded="false"] .accordion-chevron {
    transform: rotate(-90deg);
}

/* Accordion body — animate via max-height + opacity */
.accordion-body {
    overflow: hidden;
    max-height: 2000px;     /* large enough for any content */
    opacity: 1;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease,
                padding 0.35s ease;
    padding-top: 16px;
}

/* Collapsed body */
.accordion-body.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    pointer-events: none;
}

/* When inside a bill-calc-section, the toggle title shouldn't have the ::after line grow oddly */
.accordion-section .bill-calc-title {
    margin-bottom: 0;
}

/* Light theme adjustments */
[data-theme="light"] .accordion-chevron {
    background: rgba(230, 147, 14, 0.08);
    border-color: rgba(230, 147, 14, 0.18);
}

[data-theme="light"] .accordion-toggle:hover {
    background: rgba(230, 147, 14, 0.04);
}

[data-theme="light"] .accordion-toggle:hover .accordion-chevron {
    background: rgba(230, 147, 14, 0.14);
}

/* ─── Responsive: auto-collapse on mobile ─── */
@media (max-width: 768px) {
    .accordion-body.mobile-auto-collapsed {
        max-height: 0 !important;
        opacity: 0;
        padding-top: 0;
        pointer-events: none;
    }
}