/**
 * Water Security - Main Stylesheet
 * Copyright © 2025 Alex Leeor. All Rights Reserved.
 * 
 * This software and associated documentation files are the proprietary
 * property of Alex Leeor. Unauthorized copying, modification, distribution,
 * or use of this software, via any medium, is strictly prohibited.
 */

* {
    box-sizing: border-box;
    max-width: 100%;
}

html {
    height: 100vh;
    /* Fallback */
    height: calc(var(--vh, 1vh) * 100);
    /* Use the JS-calculated height */
}

body {

    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-wrap: break-word;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #140733;




    font-size: 15px;
    line-height: 1.5;
    padding: 0px;
    margin: 0;
    overflow-wrap: break-word;
    min-height: 100vh;
    /* Fallback */
    min-height: calc(var(--vh, 1vh) * 100);
    /* Use the JS-calculated height */
    /* iPhone notch & safe area support + fixed menu */
    padding-top: calc(max(env(safe-area-inset-top), 0px) + 56px);
    padding-bottom: max(env(safe-area-inset-bottom), 0px);
    padding-left: max(env(safe-area-inset-left), 0px);
    padding-right: max(env(safe-area-inset-right), 0px);
}

table {
border-radius: 22px;


}

canvas {
    border-radius: 42px;


}

input,
textarea {
    font-size: 16px !important;
    padding: 12px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 42px;
    font-family: inherit;
    margin-bottom: 12px;
    -webkit-appearance: none;
    appearance: none;
}

select {
    font-size: 18px;
    padding: 16px 20px;
    width: 100%;

    border-radius: 42px;
    font-family: inherit;
    margin-bottom: 12px;
    -webkit-appearance: none;
    appearance: none;

    cursor: pointer;
    font-weight: 600;
    color: #2d4e5a;

    transition: all 0.3s ease;
    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='%234682B4' stroke-width='3' 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 12px center;
    background-size: 24px;
    padding-right: 48px;
}

select:hover {
    border-color: #5A9BD4;
    box-shadow: 0 6px 16px rgba(70, 130, 180, 0.25);
    transform: translateY(-2px);
}

select:focus {
    outline: none;
    border-color: #5A9BD4;
    box-shadow: 0 0 0 4px rgba(70, 130, 180, 0.1);
}

button {
    min-height: 33px;
    padding: 12px 20px;
    font-size: 16px;
    font-family: inherit;
    border: none;
    border-radius: 42px;
    cursor: pointer;
    font-weight: 500;

    margin-bottom: 8px;
    transition: opacity 0.2s;
}

button:active {
    opacity: 0.7;
}

@media (min-width: 640px) {
    #annualSummary {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    #annualSummary {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) {
    .config-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Year Selector Responsive Styles */
.year-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    text-align: center;
}

@media (max-width: 640px) {
    .year-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #yearSelector {
        font-size: 16px !important;
        padding: 14px 18px !important;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-in {
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(70, 130, 180, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(70, 130, 180, 0);
    }
}

.needs-recalc {
    animation: pulse 2s infinite;
}

.phangan-notice {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    padding: 20px;
    border-radius: 42px;
    margin-bottom: 24px;
    color: white;
    border: 2px solid #FFE66D;
    animation: slideDown 0.6s ease;
}


.config-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;

}

.toggle-section {
    cursor: pointer;
    padding: 12px;
    background: #F0F8FF;
    border-radius: 42px;
    margin-bottom: 12px;
    border: 2px solid #4682B4;
    transition: background 0.2s;
}

.toggle-section:hover {
    background: #E6F3FF;
}

.collapsible-content {
    max-height: 2000px;
    overflow: visible;
    transition: max-height 0.3s ease;
}

.collapsible-content.closed {
    max-height: 0;
    overflow: hidden;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #F8F8F8;
    margin-bottom: 6px;
    border-radius: 4px;
}

.donation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 42px;
    padding: 28px;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    margin-bottom: 24px;
    animation: slideDown 0.6s ease;
}

.donation-button {

    cursor: pointer;
    height: 75px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    padding: 16px 32px;
    border: none;
    border-radius: 42px;
    font-size: 22px !important;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    width: 100%;
    margin-bottom: 30px;
}

.donation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.crypto-address {
    background: rgba(255, 255, 255, 0.15);
    padding: 14px;
    border-radius: 42px;
    font-family: 'Courier New', monospace;
    font-size: 15px !important;
    word-break: break-all;
    margin-top: 8px;
    border: 2px solid rgb(255 255 255 / 80%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.crypto-address:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.donation-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .donation-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.crypto-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 42px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.crypto-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.copy-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 22px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgb(255 255 255 / 80%);
}


   .daily-breakdown {
    padding: 32px;
    }


.donation-heart {
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1.05);
    }
}

/* Success popup notification */
@keyframes successPopupFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -30px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes successPopupFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -30px);
    }
}

.success-popup {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: 50%;
    transform: translate(-50%, 0);
    background: linear-gradient(135deg, #6B8E23 0%, #4ECDC4 100%);
    color: white;
    padding: 15px 15px;
    border-radius: 42px;
    box-shadow: 0 8px 32px rgba(107, 142, 35, 0.4);
    z-index: 10003;
    animation: successPopupFadeIn 0.5s ease-out;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: left;
    width: 95vw;
    border-width: 1px;
    border: #2a8b59;
    border-style: solid;
}

.success-popup.fade-out {
    animation: successPopupFadeOut 0.4s ease-out forwards;
}

.success-popup-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-popup-icon {
    font-size: 32px;
    animation: heartbeat 1s ease-in-out 2;
}

.success-popup-button {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 24px;
    border-radius: 42px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.success-popup-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.success-popup-button:active {
    transform: scale(0.95);
}

/* Rate Limit Popup - Centered on screen */
.rate-limit-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);
    color: white;
    padding: 32px 24px;
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(255, 107, 107, 0.5);
    z-index: 10004;
    animation: rateLimitPopIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90vw;
    width: 400px;
    text-align: center;
}

.rate-limit-popup.fade-out {
    animation: rateLimitFadeOut 0.3s ease-out forwards;
}

.rate-limit-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.rate-limit-popup-icon {
    font-size: 56px;
    animation: rateLimitPulse 2s ease-in-out infinite;
}

.rate-limit-popup-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rate-limit-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rate-limit-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0.95;
}

.rate-limit-reset {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.rate-limit-close-btn {
    background: white;
    color: #FF6B6B;
    border: none;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rate-limit-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.rate-limit-close-btn:active {
    transform: scale(0.95);
}

@keyframes rateLimitPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes rateLimitFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

@keyframes rateLimitPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes shimmer {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Feature cards responsive grid */
.feature-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .collapsible-content {
        max-height: 0 !important;
        overflow: hidden !important;
    }

    .collapsible-content.open {
        max-height: 2000px !important;
    }
}

/* Optimized table styles */
#monthlyTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

#monthlyTable th,
#monthlyTable td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

#monthlyTable th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 800;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#monthlyTable tbody tr:hover {
    background: #F8F8F8;
}

#monthlyTable th:first-child,
#monthlyTable td:first-child {
    text-align: left;
    padding-left: 8px;
    font-weight: 600;
}

@media (max-width: 768px) {
    #monthlyTable {
        font-size: 7px;
    }

    #monthlyTable th,
    #monthlyTable td {
        padding: 4px 2px;
        font-size: 7px;
        line-height: 1.3;
    }

    #monthlyTable th:first-child,
    #monthlyTable td:first-child {
        padding-left: 4px;
        font-size: 8px;
    }

    /* Reduce emoji and icon sizes */
    #monthlyTable td .emoji,
    #monthlyTable td span {
        font-size: 10px;
    }

    /* Make metric labels even smaller */
    #monthlyTable .metric-label {
        font-size: 6px !important;
    }

    /* Keep values slightly more readable */
    #monthlyTable .metric-value {
        font-size: 8px !important;
    }
}

/* LCARS-inspired Performance Dashboard Styles */
.lcars-container {
    background: #523474;
    border-radius: 42px;
    padding: 0;
    overflow: hidden;
    position: relative;
        border: solid;
    border-width: 1px;
    border-color: #673AB7;
}

.lcars-header {

    border-radius: 42px 42px 0 0;

    background: linear-gradient(90deg, #f6f6f6 0%, #e3e1ff 100%);
    padding: 16px 24px;
    padding-bottom: 10px;
    position: relative;
    overflow: hidden;

}



.lcars-header h3 {
    margin: 0;
    color: #4a3876;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.lcars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    padding: 20px;
    background: #523474;
    margin-bottom: 20px;
}

.lcars-panel {
    background: linear-gradient(135deg, #4a3876 0%, #8b44b2 100%);
    border-left: 6px solid;
    border-radius: 0 42px 42px 0;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #835bab;
    border-left: 6px solid;
    margin-right: 20px;
}



.lcars-panel:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 12px rgba(255, 153, 102, 0.3);
}

.lcars-panel.status-good {
    border-left-color: #99CC99;
}

.lcars-panel.status-warning {
    border-left-color: #FFCC99;
}

.lcars-panel.status-critical {
    border-left-color: #FF9999;
}

.lcars-panel.status-info {
    border-left-color: #9999FF;
}

.lcars-panel.status-special {
    border-left-color: #CC99CC;
}

.lcars-panel.status-cyan {
    border-left-color: #66CCCC;
}

.lcars-value {
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    margin: 12px 0 8px 0;

    text-shadow: 0 0 20px currentColor;
}

.lcars-panel.status-good .lcars-value {
    color: #99CC99;
}

.lcars-panel.status-warning .lcars-value {
    color: #FFCC99;
}

.lcars-panel.status-critical .lcars-value {
    color: #FF9999;
}

.lcars-panel.status-info .lcars-value {
    color: #9999FF;
}

.lcars-panel.status-special .lcars-value {
    color: #CC99CC;
}

.lcars-panel.status-cyan .lcars-value {
    color: #66CCCC;
}

.lcars-label {
    font-size: 16px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    line-height: 1.3;
}

.lcars-sublabel {
    font-size: 15px;
    color: #b9b9da;
    margin-top: 6px;
    line-height: 1.4;
    font-weight: 600;
    ;
}

.top-padding
{
padding-bottom: 10px;

}
.lcars-alert {
    background: rgba(255, 102, 102, 0.15);
    border: 1px solid #FF6666;
    border-radius: 45px;
    padding: 30px;
    margin-top: 8px;
    font-size: 15px;
    color: #ffdee5;
    font-weight: 500;
    margin-bottom: 20px;
    margin-top: 20px;
    text-shadow: 1px 1px #3e1145;
}

.lcars-note {
    background: rgba(153, 153, 255, 0.1);
    border-left: 3px solid #9999FF;
    border-right: 3px solid #9999FF;
    padding: 20px 20px;
    margin-top: 8px;
    font-size: 14px;
    color: #ffedff;
    line-height: 1.5;
    border-radius: 42px;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    text-shadow: 1px 1px #421649;
}

.lcars-bar {
    height: 12px;
    background: #1a1a2e;
    border-radius: 22px;
    overflow: hidden;
    margin: 12px 0 8px 0;
    border: 1px solid #333;
}

.lcars-bar-fill {
    height: 100%;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px currentColor;
}

.lcars-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.lcars-footer {
    border-top: 6px solid #ff9966;

    background: linear-gradient(90deg, #f6f6f6 0%, #e3e1ff 100%);
    padding: 12px 24px;
    border-top: 2px solid #ce7b0f;
    text-align: center;
    font-size: 14px;
    color: #411b1b;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Responsive adjustments */
/* Single column layout from 680px to 1200px */
@media (min-width: 680px) and (max-width: 1200px) {
    .lcars-grid {
        grid-template-columns: 1fr;
    }
}

/* Three column layout above 1200px */
@media (min-width: 1201px) {
    .lcars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .lcars-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .lcars-value {
        font-size: 44px;
    }

    .lcars-label {
        font-size: 15px;
    }

    .lcars-sublabel {
        font-size: 14px;
    }

    .lcars-alert {
        font-size: 13px;
    }

    .lcars-note {
        font-size: 13px;
    }

    .lcars-header h3 {
        font-size: 22px;
    }



}

/* Keep water usage breakdown in one row always */
.water-usage-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
}

/* Below 769px, use 2-2-1 layout */
@media (max-width: 768px) {
    .water-usage-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    /* Make the last item (Garden) center and take full width */
    .water-usage-grid>div:last-child {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
    .lcars-panel {
   margin-right: 0px;

    }
    .config-toggle-btn {
        width: 98%;
    }
}

/* Sticky Year Selector */
#yearSelector.sticky {
    position: fixed !important;
    top: calc(60px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    max-width: 500px;
    width: calc(100% - 40px);
    /* Keep all original styling */
    padding: 16px 20px !important;
    border: 2px solid #d5bf55 !important;
    border-radius: 42px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: #2d4e5a !important;
    /* Combined background with gradient AND dropdown arrow */
    background:
        url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%234682B4%27 stroke-width=%273%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3e%3cpolyline points=%276 9 12 15 18 9%27%3e%3c/polyline%3e%3c/svg%3e') right 12px center / 24px no-repeat,
        linear-gradient(135deg, #fffae2 0%, #ffffff 100%) !important;
    cursor: pointer !important;
    box-shadow: 0 8px 32px rgba(70, 130, 180, 0.5) !important;
    appearance: none !important;
    padding-right: 48px !important;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Mobile adjustments for sticky */
@media (max-width: 768px) {
    #yearSelector.sticky {
        position: fixed !important;
        top: calc(56px + env(safe-area-inset-top)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 32px) !important;
        max-width: 500px;
        font-size: 16px !important;
        padding: 14px 18px;
        padding-right: 44px !important;
        border: 2px solid #051d89;
        border-radius: 42px;
        color: #2d4e5a;
        background:
            url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%234682B4%27 stroke-width=%273%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3e%3cpolyline points=%276 9 12 15 18 9%27%3e%3c/polyline%3e%3c/svg%3e') right 12px center / 24px no-repeat,
            linear-gradient(135deg, #fffae2 0%, #ffffff 100%) !important;
        box-shadow: 0 8px 32px rgba(70, 130, 180, 0.5) !important;
        z-index: 999 !important;
        appearance: none !important;
        -webkit-appearance: none !important;
    }
}

@media (max-width: 480px) {
    #yearSelector.sticky {
        width: calc(100% - 24px) !important;
        font-size: 15px !important;
        padding: 12px 16px !important;
        padding-right: 42px !important;
    }
}

@keyframes bounceIn {
    0% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }

    60% {
        transform: translateX(-50%) translateY(15px);
        opacity: 1;
    }

    80% {
        transform: translateX(-50%) translateY(-5px);
    }

    100% {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bounceOut {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    100% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

#yearSelector.unsticking {
    animation: bounceOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Placeholder for sticky dropdown */
#yearSelectorPlaceholder {
    display: none;
    width: 100%;
}

#yearSelectorPlaceholder.active {
    display: block;
}

.scenarios-toggle-btn {
    width: 100%;
    padding: 0px 0px !important;
    background: linear-gradient(135deg, #e5985e, #dc6d41);
    color: #ffffff;
    border: #b7592b;
    border-color: #b75626;
    border-style: dotted;
    border-radius: 42px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(70, 130, 180, 0.2);
}

/* LCARS Toggle Button */
.lcars-toggle-btn {

    background: linear-gradient(90deg, #f6f6f6 0%, #e3e1ff 100%);
    border: none;
    border-radius: 42px;
    padding: 16px 24px;
    width: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 16px;
    margin-top: 16px;
        border: solid;
    border-width: 1px;
    border-color: #673AB7;
}

.lcars-toggle-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: #FF9966;
}



.lcars-toggle-btn:hover {
    background: linear-gradient(83deg, #fff9f6 0%, #ffe4d6 100%);
    box-shadow: 0 0 20px rgba(153, 153, 255, 0.5);
}

.lcars-toggle-btn:active {
    transform: scale(0.98);
}

.lcars-toggle-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 16px;
}

.lcars-toggle-label {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #4a3876;
    margin-left: 0px;
}

.lcars-toggle-summary {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a3876;
    opacity: 0.8;
    margin-left: 12px;
}

.lcars-toggle-icon {
    font-size: 24px;
    color: #ff9966;
    font-weight: 900;
    transition: transform 0.3s ease;
}

.lcars-toggle-icon.expanded {
    transform: rotate(180deg);
}

/* LCARS Info Banner */
.lcars-info-banner {
    background: linear-gradient(135deg, #7450a9 0%, #1a1d3c 100%);
    border-left: 6px solid #ff9966;
    border-right: 6px solid #ff9966;
    border-radius: 42px;
    padding: 30px;
    margin-bottom: 16px;
    margin-top: 16px;
    position: relative;
    text-align: center;
}

.lcars-info-title {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-bottom: 12px;
    margin-top: 22px;
}

.lcars-info-text {
    font-size: 18px;
    line-height: 1.7;
    color: #fff;
    margin-bottom: 20px;
}

.lcars-info-tip {
    background: rgba(153, 153, 255, 0.15);
    border-left: 3px solid #9999FF;
    border-right: 3px solid #9999FF;
    padding: 12px;
    border-radius: 22px;
    font-size: 13px;
    color: #fff;
    line-height: 1.6;
}

/* Collapsed summary styling */
.lcars-collapsed-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
}

.lcars-summary-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a3876;
    opacity: 0.7;
}

.lcars-summary-value {
    font-size: 13px;
    font-weight: 900;
    color: #4a3876;
    text-align: left;
}

/* Year Transition Overlay */
.year-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.95) 0%, rgba(90, 155, 212, 0.95) 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    ;
}

.year-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.year-transition-content {
    text-align: center;
    color: white;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.year-transition-overlay.active .year-transition-content {
    transform: scale(0.8);
}

.year-transition-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotateIn 0.6s ease;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }

    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

.year-transition-year {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 4px;
}

.year-transition-label {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.configToggleLabel {
    font-size: 25px;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);

}

.info-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #4682B4;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.info-icon:hover {
    background: #5A9BD4;
    transform: scale(1.1);
}

.month-row:hover {
    background: #F0F8FF !important;
}

.metric-cell {
    position: relative;
}

.metric-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 16px;
    font-weight: bold;
}

.sub-value {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Desktop view - increase font sizes for better readability */
@media (min-width: 769px) {
    .metric-cell .metric-text {
        font-size: 18px !important;
    }
    
    .metric-cell .metric-text-bold {
        font-size: 20px !important;
    }
    
    .metric-cell-status .status-emoji {
        font-size: 32px !important;
    }
    
    .metric-cell-status .status-content > div {
        font-size: 16px !important;
    }
    
    .metric-cell-status .status-content > div:first-child {
        font-size: 14px !important;
    }
    
    .metric-cell-status .status-content > div:nth-child(2) {
        font-size: 22px !important;
    }
    
    .metric-cell-status .status-content > div:nth-child(3),
    .metric-cell-status .status-content > div:nth-child(4) {
        font-size: 16px !important;
    }
}

/* Mobile-first optimizations - maximize screen usage */
@media (max-width: 768px) {

    html,
    body {
        height: 100%;
        height: -webkit-fill-available;
        overflow-x: hidden;
    }

    body {
        padding-top: max(env(safe-area-inset-top), 8px) !important;
        padding-bottom: max(env(safe-area-inset-bottom), 8px) !important;
        padding-left: 0px !important;
        padding-right: 0px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    /* Flatten outer containers to save space */
    .outer-wrapper {
        padding: 0px !important;
        /* Minimal padding on mobile */
        /* Keep the beautiful gradient background on mobile! */
        box-shadow: none !important;
        /* No shadows on mobile */
    }

    .inner-container {
        
        /* Minimal padding for mobile */
        border-radius: 21px !important;
        /* Small rounded corners for a polished look */
        box-shadow: none !important;
        margin: 0 !important;
        /* No margins – full-width */
        padding: 15px;
    }

    /* Flatten section cards and toggles */
    .section-card,
    .toggle-section,
    .donation-card,
    .phangan-notice,
    #reliabilitySection {


        padding: 12px !important;
        /* Halve your current 12-16px */
        margin-bottom: 8px !important;
        border: none;
        /* Remove borders to reduce visual clutter */
        box-shadow: none !important;
        /* No shadows */
        border-radius: 42px !important;
        /* Smaller radius */
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    /* Override ALL divs with inline padding in the results sections */
    #reliabilitySection~div[style*="padding"] {
        padding: 16px !important;
    }

    #reliabilitySection div[style*="padding"] {
        padding: 16px !important;
    }

    /* Grids: Force single-column stacking for most to save horizontal space */
    .config-grid,
    .year-info-grid,
    .feature-cards-grid,
    .donation-options {
        grid-template-columns: 1fr !important;
        /* Single column – stacks vertically, saves space */
        gap: 4px !important;
        /* Tighter gaps */
    }

    /* Inputs and selects: Make them compact but tappable */
    input,
    select:not(.sticky),
    textarea {
        padding: 8px !important;
        /* Smaller padding */
        margin-bottom: 4px;
        font-size: 14px;
        /* Readable but dense */
        min-height: 44px;
        /* Touch-friendly height */
        border-radius: 42px;
        /* Smaller radius */
        border-width: 1px;
        /* Thinner borders */
        padding-left: 20px;
        ;
    }

    button {
        padding: 8px 12px;
        /* Compact buttons */
        font-size: 14px;
        min-height: 12px;
        /* Touch-friendly */
        margin-bottom: 4px;
    }

    /* Tables: Even more compact */
    #monthlyTable {
        font-size: 12px !important;
        /* Smaller font but still readable */
    }

    #monthlyTable th,
    #monthlyTable td {
        padding: 8px 6px !important;
        /* Maintain padding for readability - table scrolls horizontally */
        font-size: 12px !important;
        white-space: nowrap !important;
        /* Prevent wrapping of labels like "Needed / Used" */
    }

    /* Keep labels and values on same line - table scrolls horizontally */
    #monthlyTable .metric-label {
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    #monthlyTable .metric-value {
        white-space: nowrap !important;
        font-size: 13px !important;
    }

    /* Keep the "Needed / Used" line intact */
    #monthlyTable td>div {
        white-space: nowrap !important;
    }

    .table-container {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: auto;
        /* Allow horizontal scroll if needed, but with single-column grids, less likely */
    }

    /* Hide non-essential elements to declutter */
    .landscape-hint {
        display: none !important;
        /* Optional: Hide if it's not critical – users can rotate intuitively */
    }

    .phangan-notice {
        padding: 20px !important;
        font-size: 12px !important;
        /* Smaller if shown */
        /* Or hide: display: none !important; */
    }

    /* Remove animations/shimmers for performance */
    [class*="animation"],
    .needs-recalc,
    .success-popup {
        animation: none !important;
        /* Disable animations on mobile */
    }

    /* Header: Compact */
    .header-section {
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
        font-size: 18px !important;
        /* Smaller h1 */
    }

    .header-section h1 {
        font-size: 20px !important;
    }

    .header-section p {
        font-size: 12px !important;
    }

    /* Collapsible content: Collapse by default on mobile for space */
    .collapsible-content {
        max-height: 0 !important;
        /* Start closed */
        overflow: hidden !important;
    }

    .collapsible-content.open {
        /* Add a class in JS to toggle */
        max-height: 2000px !important;
    }

    /* Crypto/options: Smaller */
    .crypto-option,
    .crypto-address {
        padding: 8px !important;
        font-size: 13px !important;
    }
}

;

@media (max-width: 480px) {
    body {
        padding: 0 !important;
        /* Absolutely no padding on small screens */
        font-size: 12px !important;
        /* Even smaller base */
    }

    .outer-wrapper {
        padding: 0 !important;
    }

    .inner-container {
        padding: 2px !important;
        /* Absolute minimum padding */
    }

    input,
    select,
    button {
        font-size: 13px !important;
        padding: 6px !important;
        /* Super compact */
    }

    .section-card,
    .toggle-section,
    #reliabilitySection {
        padding: 4px !important;
        /* Minimal section padding */
    }

    /* Aggressively override inline padding on all result sections */
    #reliabilitySection~div[style*="padding"],
    #reliabilitySection div[style*="padding"] {
        padding: 4px !important;
    }

    #monthlyTable th,
    #monthlyTable td {
        padding: 6px 4px !important;
        /* Maintain spacing for horizontal scroll readability */
        font-size: 10px !important;
        white-space: nowrap !important;
        /* Keep content on same line */
    }

    /* Ensure metric labels and values stay on one line */
    #monthlyTable .metric-label {
        white-space: nowrap !important;
        display: block !important;
        font-size: 8px !important;
    }

    #monthlyTable .metric-value {
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    #monthlyTable td>div {
        white-space: nowrap !important;
    }

    /* Hide more if needed */
    #savedDataNotice,
    .sub-value {
        /* Hide minor UI elements */
        display: none !important;
    }
}

/* Extra small screens - absolute minimum spacing */
@media (max-width: 350px) {

    body,
    .outer-wrapper,
    .inner-container {
        padding: 0 !important;
        /* Zero padding on all containers */
        margin: 0 !important;
    }
}

/* Add small left/right padding for devices at 300px to prevent edge touching */
@media (max-width: 300px) {
    body {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .outer-wrapper,
    .inner-container {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }

    .section-card,
    .toggle-section,
    #reliabilitySection {
        padding: 2px !important;
        /* Bare minimum */
        margin-bottom: 4px !important;
    }

    /* Nuclear option - override ALL inline padding */
    #reliabilitySection~div[style*="padding"],
    #reliabilitySection div[style*="padding"],
    div[style*="padding: 20px"],
    div[style*="padding: 24px"],
    div[style*="padding: 28px"],
    div[style*="padding: 32px"],
    div[style*="padding: 36px"],
    div[style*="padding: 40px"] {
        padding: 2px !important;
    }

    /* Exception: Keep table readable with horizontal scroll */
    #monthlyTable th,
    #monthlyTable td {
        padding: 6px 4px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    #monthlyTable .metric-label {
        white-space: nowrap !important;
        font-size: 7px !important;
    }

    #monthlyTable .metric-value {
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    #monthlyTable td>div {
        white-space: nowrap !important;
    }
}


/* Hide landscape hint by default (desktop and landscape) */
.landscape-hint {
    display: none;

    color: white;
    padding: 12px 16px;
    border-radius: 42px;
    text-align: center;

    border: 2px solid #FFE66D;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    font-size: 14px;
    font-weight: 600;
    animation: gentlePulse 2s ease-in-out infinite;
    margin-bottom: 20px;
    margin-top: 20px;
}

.landscape-hint-icon {
    font-size: 24px;
    display: inline-block;
    animation: rotate-hint 2s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes gentlePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
    }
}

@keyframes rotate-hint {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* Hide hint in landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .landscape-hint {
        display: none !important;
    }
}

/* Classes for mobile optimization */
.outer-wrapper {
    width: 100%;

    background: linear-gradient(135deg, #fff6ca 0%, #79ad6f 50%, #c48b69 100%);
    padding: 0px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.inner-container {

    margin: 0 auto;
    background: #F5F5DC;
    border-radius: 42px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    flex: 1;
    flex: 1;
    width: 1200px;
}

/* Desktop-only left/right spacing */
@media (min-width: 1199px) {
    .inner-container {
        max-width: 1400px;
        padding-left: 40px;
        padding-right: 40px;
    }
}


.section-card {
    border-radius: 42px;
    padding: 24px;
    margin-bottom: 24px;
}

.header-section {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 24px;
    padding-top: 24px;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(135deg, #04222c, #073a4b);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding-top: 10px;
    padding-bottom: 5px;

}

.hamburger-button {
    width: 100%;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    padding: 0px;
    transition: all 0.3s ease;

}

.hamburger-button:hover {
    background: #04222c
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-button span {
    display: block;
    width: 30px;
    height: 3px;
    background: white;

    transition: all 0.3s ease;
}

.hamburger-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-button.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.hamburger-text {
    color: white;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.hamburger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 1.6s ease;
}

.hamburger-overlay.active {
    display: block;
    opacity: 1;
}

.hamburger-nav {
    position: fixed;
    top: 0;
    left: -420px;
    width: 400px;
    height: 100vh;
    height: 100dvh;
    /* Use dynamic viewport height for mobile */
    background: linear-gradient(135deg, #F5F5DC 0%, #E8DCC4 100%);
    z-index: 10000;
    overflow-y: scroll;
    /* Changed from auto to scroll for better mobile behavior */
    -webkit-overflow-scrolling: touch;
    /* Enable momentum scrolling on iOS */
    overscroll-behavior: contain;
    /* Prevent main page scroll when nav is open */
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    padding-top: max(env(safe-area-inset-top), 1px);
    padding-bottom: max(env(safe-area-inset-bottom), 80px);
    /* Increased padding for bottom button visibility */
}

.hamburger-nav.active {
    left: 0;
}

/* Responsive width for mobile */
@media (max-width: 768px) {
    .hamburger-nav {
        left: -380px;
        width: 360px;
        padding-bottom: max(env(safe-area-inset-bottom), 100px);
        /* Extra padding on tablets */
    }
}

@media (max-width: 480px) {
    .hamburger-nav {
        left: -340px;
        width: 320px;
        padding-bottom: max(env(safe-area-inset-bottom), 120px);
        /* Even more padding on phones */
    }
}

.hamburger-nav-header {
    padding: 10px;
    text-align: center;
    border-bottom: 3px solid #FF9966;
    background: linear-gradient(135deg, #FF9966, #FFCC99);
    margin-top: 0px;
}

.hamburger-nav-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    color: #8f411b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hamburger-nav-section {
    padding: 16px;
    padding-bottom: 40px;
    /* Extra bottom padding for last section */
}

.hamburger-nav-label {
    font-size: 12px;
    font-weight: 900;
    color: #4a3876;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FF9966, #FFCC99);
    border-left: 4px solid #FF6633;
    border-radius: 0 8px 8px 0;
    margin: 12px 0 8px 0;
}

.hamburger-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    text-decoration: none;
    color: #24134e;
    border-radius: 42px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    background: white;
}

.hamburger-nav-link:hover {
    background: rgba(70, 130, 180, 0.1);
    transform: translateX(4px);
    border-left-color: #4682B4;
}

.hamburger-nav-link-icon {
    font-size: 22px;
    min-width: 22px;
}

.hamburger-nav-link-text {
    font-size: 14px;
    font-weight: 600;
}

.hamburger-nav-button {
    width: 90%;
    padding: 14px 16px;
    margin: 8px auto;
    background: #FF9966;
    color: white;
    border: none;
    border-radius: 42px;
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    height: 50px;
    ;
}

.hamburger-nav-button:hover {
    background: #ff742e;
    transform: translateY(-1px);
}

/* Mobile responsive header */
@media (max-width: 768px) {
    .header-section {
        padding-top: calc(55px + env(safe-area-inset-top)) !important;
        padding-bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding-top: calc(50px + env(safe-area-inset-top)) !important;
    }

    .header-section h1 {
        font-size: 20px !important;
        line-height: 1.3;
    }
}

/* Report Modal Styles */
.report-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.report-modal-content {
    max-width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 42px;
    padding: 0;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.report-header {
    background: linear-gradient(135deg, #4682B4 0%, #5A9BD4 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.report-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.report-close:hover {
    background: rgb(255 255 255 / 80%);
    transform: rotate(90deg);
}

.report-body {
    padding: 32px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.report-actions {
    padding: 20px 32px;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.report-actions button {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 42px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download {
    background: #4682B4;
    color: white;
}

.btn-download:hover {
    background: #5A9BD4;
    transform: translateY(-2px);
}

.btn-share {
    background: #28a745;
    color: white;
}

.btn-share:hover {
    background: #34ce57;
    transform: translateY(-2px);
}

.btn-print {
    background: #6c757d;
    color: white;
}

.btn-print:hover {
    background: #7d8592;
    transform: translateY(-2px);
}

/* Report Content Styling */
.report-content h1 {
    font-size: 28px;
    margin: 0 0 16px 0;
    color: #2d4e5a;
}

.report-content h2 {
    font-size: 22px;
    margin: 32px 0 16px 0;
    color: #4682B4;
    border-bottom: 2px solid #E6F3FF;
    padding-bottom: 8px;
}

.report-content h3 {
    font-size: 18px;
    margin: 24px 0 12px 0;
    color: #2d4e5a;
}

.report-content p {
    line-height: 1.7;
    margin: 12px 0;
}

.report-content ul,
.report-content ol {
    line-height: 1.8;
    margin: 16px 0;
    padding-left: 24px;
}

.report-content li {
    margin: 8px 0;
}

.report-content strong {
    color: #2d4e5a;
    font-weight: 600;
}

.report-content hr {
    border: none;
    border-top: 2px solid #E6F3FF;
    margin: 32px 0;
}

.report-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.report-content a {
    color: #4682B4;
    text-decoration: none;
}

.report-content a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .report-modal-content {
        margin: 10px;
        border-radius: 42px;
        margin-top: 50px;
        
    }

    .report-header {
        padding: 20px;
        border-radius: 42px 42px 0 0;
    }

    .report-body {
        padding: 20px;
        max-height: calc(100vh - 180px);
    }

    .report-actions {
        padding: 16px 20px;
        flex-direction: column;
    }

    .report-actions button {
        width: 100%;
        min-width: unset;
    }

    .report-content h1 {
        font-size: 24px;
    }

    .report-content h2 {
        font-size: 20px;
    }

    .report-content h3 {
        font-size: 16px;
    }

    .report-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}



@keyframes slideDown {
    0% {
        max-height: 0;
        transform: translateY(-20px) scaleY(0.8);
        transform-origin: top;
    }
    60% {
        max-height: 5000px;
        transform: translateY(5px) scaleY(1.02);
    }
    80% {
        transform: translateY(-2px) scaleY(0.99);
    }
    100% {
        max-height: none;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes slideUp {
    0% {
        max-height: 5000px;
        transform: translateY(0) scaleY(1);
        transform-origin: top;
    }
    40% {
        transform: translateY(3px) scaleY(0.98);
    }
    100% {
        max-height: 0;
        transform: translateY(-15px) scaleY(0.7);
    }
}

.config-content-expanded {
    animation: slideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: visible;
    max-height: none;
}

.config-content-collapsed {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    overflow: hidden;
    max-height: 0;
}

.config-toggle-btn {
    width: 99%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e5985e, #dc6d41);
    color: #ffffff;
    border: #b7592b;
    border-color: #b75626;
    border-style: solid;
    border-top-left-radius: 4px;
    border-top-right-radius: 42px;
    border-bottom-right-radius: 42px;
    border-bottom-left-radius: 4px;
    border-width: 1px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    

}

.config-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(70, 130, 180, 0.3);
}

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

.config-summary {
    font-size: 18px;
    font-weight: 400;
    color: #fff5f1;
    line-height: 1.5;
    display: block;
    text-align: center;
    width: 100%;
    text-shadow: 0 1px 1px rgba(48, 35, 5, 0.5);

}

.config-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 5px;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    margin-top: 20px;
    width: 100%;
}


.config-summary-total {
    display: block;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 251, 250, 0.3);
}

.config-summary .label {
    font-size: 16px;
    font-weight: 600;
    color: #fffbfa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.85;
}

.config-summary .value {
    font-size: 16px;
    font-weight: 800;
    color: #9c461c;
}

.water-summary .value {
    font-size: 18px;
    font-weight: 800;
    color: #055b65;

}

.config-summary .total-value {
    font-size: 28px;
    font-weight: 900;
    color: rgb(16, 94, 104);
    display: block;
    line-height: 1.2;
}

.water-summary {
    font-size: 28px;
    font-weight: 900;
    color: #004851;
    display: block;
    line-height: 1.2;
}

.config-summary .total-label {
    font-size: 16px;
    font-weight: 600;
    color: #fffbfa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.config-summary .separator {
    color: #fffbfa;
    opacity: 0.6;
    margin: 0 2px;
}

.toggle-icon {
    font-size: 32px;
    transition: transform 0.3s ease;
    color: #ffffff;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    animation: heartbeat 2s ease-in-out infinite;
    font-weight: bold;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
    animation: none;
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.9;
    }
}

/* Location and Data Section Styling */
.config-summary-location {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.location-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.location-details {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.location-rainfall {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    font-size: 14px;
    line-height: 1.4;
}

.rainfall-label,
.roof-label,
.material-label,
.storage-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.3px;
}

.rainfall-value,
.roof-value,
.material-value,
.storage-value {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: rgba(133, 64, 33, 0.4);
    padding: 2px 10px;
    border-radius: 20px;
}

.rainfall-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    margin: 0 4px;
}

/* Usage Section Styling */
.config-summary-usage {
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 33px;
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.usage-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    font-size: 16px;
    line-height: 1.6;
}

.usage-label,
.people-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-value,
.people-value {
    font-size: 20px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.usage-separator {
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    margin: 0 6px;
    font-weight: 300;
}

/* ============================================
   AUDIO GUIDE STYLES
   ============================================ */

/* Header Info Button - New Style */
.header-info-btn-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 32px !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    letter-spacing: 0.5px !important;
    /* Capacitor-specific fixes */
    -webkit-tap-highlight-color: transparent !important;
    text-decoration: none !important;
    min-height: 44px !important;
}

.header-info-btn-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.header-info-btn-new:hover::before {
    left: 100%;
}

.header-info-btn-new:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #7a8ef5 0%, #8659b8 100%);
}

.header-info-btn-new:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.info-btn-icon {
    font-size: 22px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.info-btn-text {
     font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.info-btn-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.header-info-btn-new:hover .info-btn-arrow {
    transform: translateX(4px);
    animation: arrowPulse 0.6s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: translateX(4px);
    }
    50% {
        transform: translateX(8px);
    }
}

/* Old header info button - keep for hamburger menu */
.header-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    border-radius: 42px;
    padding: 8px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.header-info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
    background: linear-gradient(135deg, #1976D2, #1565C0);
}

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

/* Audio Guide Modal */
.audio-guide-modal {
    display: none !important; /* Force hide initially for Capacitor */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

/* Show modal when active */
.audio-guide-modal[style*="display: flex"],
.audio-guide-modal[style*="display:flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.audio-guide-modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 42px;
    width: 90%;
    max-width: 1400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Unified header at top */
.audio-guide-unified-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 42px 24px 0 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.audio-guide-unified-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* Main container for side-by-side layout */
.audio-guide-main-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Slide in from right animation for player */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide out to right animation when hiding player */
@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Legacy header styles (kept for compatibility) */
.audio-guide-header {
    display: none; /* Hidden - using unified header instead */
}

.audio-guide-title {
    margin: 0;
    color: white;
    font-size: 24px;
    font-weight: 800;
    flex: 1;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3),
                 0 0 30px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.audio-guide-chevron {
    display: none; /* Hidden by default, shown on mobile when player active */
    margin-left: 8px;
    font-size: 16px;
    opacity: 0.7;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.audio-guide-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    user-select: none;
}

.audio-guide-close:hover {
    background: rgb(255 255 255 / 80%);
    transform: translateY(-50%) rotate(90deg);
}

.audio-guide-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    user-select: none;
}

.audio-guide-back:hover {
    background: rgb(255 255 255 / 80%);
    transform: translateY(-50%) translateX(-4px);
}

/* Selector View - Left side */
.audio-guide-selector {
    padding: 0;
    overflow: hidden;
    flex: 1 1 50%;
    min-width: 300px;
    max-width: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    --top-gradient-opacity: 1;
    --bottom-gradient-opacity: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-guide-selector-scroll {
    overflow-y: scroll;
    overflow-x: hidden;
    flex: 1;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    position: relative;
    cursor: grab;
}

.audio-guide-selector-scroll.dragging {
    cursor: grabbing;
    user-select: none;
}

/* Ensure buttons show pointer cursor */
.audio-guide-selector-scroll button,
.audio-guide-header button {
    cursor: pointer !important;
}

.audio-guide-selector-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Gradient Feathers */
.audio-guide-selector::before,
.audio-guide-selector::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.audio-guide-selector::before {
    top: 0;
    background: linear-gradient(to bottom, 
        rgba(26, 26, 26, 1) 0%, 
        rgba(26, 26, 26, 0.95) 20%,
        rgba(26, 26, 26, 0.7) 50%,
        transparent 100%);
    opacity: var(--top-gradient-opacity, 1);
}

.audio-guide-selector::after {
    bottom: 0;
    background: linear-gradient(to top, 
        rgba(26, 26, 26, 1) 0%, 
        rgba(26, 26, 26, 0.95) 20%,
        rgba(26, 26, 26, 0.7) 50%,
        transparent 100%);
    opacity: var(--bottom-gradient-opacity, 1);
}

.audio-guide-intro {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    text-align: center;
    padding: 0 8px;
}

/* Section Buttons - iPod Style */
.audio-guide-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Staggered entrance animation */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.audio-section-btn:nth-child(1) { animation: slideInFromRight 0.4s ease 0.1s backwards; }
.audio-section-btn:nth-child(2) { animation: slideInFromRight 0.4s ease 0.15s backwards; }
.audio-section-btn:nth-child(3) { animation: slideInFromRight 0.4s ease 0.2s backwards; }
.audio-section-btn:nth-child(4) { animation: slideInFromRight 0.4s ease 0.25s backwards; }
.audio-section-btn:nth-child(5) { animation: slideInFromRight 0.4s ease 0.3s backwards; }
.audio-section-btn:nth-child(6) { animation: slideInFromRight 0.4s ease 0.35s backwards; }
.audio-section-btn:nth-child(7) { animation: slideInFromRight 0.4s ease 0.4s backwards; }
.audio-section-btn:nth-child(8) { animation: slideInFromRight 0.4s ease 0.45s backwards; }
.audio-section-btn:nth-child(9) { animation: slideInFromRight 0.4s ease 0.5s backwards; }

.audio-section-btn {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 33px;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.audio-section-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.audio-section-btn:hover::before {
    left: 100%;
}

.audio-section-btn:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #5a5a5a 100%);
    transform: translateX(8px);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.audio-section-btn:active {
    transform: translateX(8px) scale(0.98);
    transition: all 0.1s ease;
}

/* Active/Playing section state */
.audio-section-btn.active {
    background: linear-gradient(135deg, #4a4a4a 0%, #5a5a5a 100%);
    border: 2px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5), 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: translateX(8px);
}

.audio-section-btn.active .section-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
    }
}

.section-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-radius: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.audio-section-btn:hover .section-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
    transform: scale(1.1);
}

.section-info {
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.section-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.section-duration {
    font-size: 12px;
    color: rgba(33, 150, 243, 0.9);
    font-weight: 600;
    display: inline-block;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
}

/* Player View - Right side */
.audio-guide-player-section {
    padding: 20px;
    display: flex !important; /* Force display for Capacitor */
    flex-direction: column;
    flex: 0 0 0% !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden; /* Additional hiding method for Capacitor */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    -webkit-overflow-scrolling: touch;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
}

/* Player visible state - slides in from right */
.audio-guide-player-section.visible {
    flex: 1 1 50% !important;
    min-width: 300px !important;
    max-width: 600px !important;
    opacity: 1 !important;
    visibility: visible !important; /* Show when visible */
    overflow-y: auto !important;
}

.audio-guide-player-section::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.audio-player-display {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border-radius: 33px;
    margin: 0 0 20px 0;
    flex-shrink: 0;
}

.player-section-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.player-section-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.player-section-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* Subtitle Display */
.audio-subtitle {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 20px;
    padding: 20px 16px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.7;
    margin: 0 0 20px 0;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(33, 150, 243, 0.2);
    flex-shrink: 0;
}

/* Audio Player Container */
.audio-player-container {
    margin: 0 0 16px 0;
    flex-shrink: 0;
}

.audio-player {
    width: 100%;
    height: 54px;
    border-radius: 33px;
    background: linear-gradient(135deg, #d37a0d 0%, #ee9931 100%);
    outline: none;
    border: 1px solid #ff9a3c;
    box-shadow: 0 4px 20px rgba(255, 154, 60, 0.3), inset 0 1px 0 rgba(255, 154, 60, 0.2);
}

/* Webkit Browsers (Chrome, Safari, Edge) - LCARS Style */
.audio-player::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #d37a0d 0%, #ee9931 100%);
    border-radius: 33px;
}

.audio-player::-webkit-media-controls-play-button,
.audio-player::-webkit-media-controls-pause-button {
    background-color: white;
    border-radius: 50%;
    border: 2px solid #cc6600;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.audio-player::-webkit-media-controls-current-time-display,
.audio-player::-webkit-media-controls-time-remaining-display {
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 1px 1px 2px #cc6600, -1px -1px 2px #cc6600, 1px -1px 2px #cc6600, -1px 1px 2px #cc6600;
}

.audio-player::-webkit-media-controls-timeline {
    background: rgba(255, 154, 60, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 154, 60, 0.3);
}

.audio-player::-webkit-media-controls-volume-slider {
    background: rgba(255, 154, 60, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 154, 60, 0.3);
}

.audio-player::-webkit-media-controls-timeline::-webkit-slider-thumb {
    background: #ff9a3c;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 154, 60, 0.8);
}

/* Volume button (mute/unmute icon) */
.audio-player::-webkit-media-controls-mute-button {
    filter: brightness(0) invert(1);
}

/* Overflow menu (three dots) */
.audio-player::-webkit-media-controls-toggle-closed-captions-button,
.audio-player::-webkit-media-controls-fullscreen-button,
.audio-player::-internal-media-controls-overflow-button {
    filter: brightness(0) invert(1);
}

.audio-player-note {
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #2196F3;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0;
    flex-shrink: 0;
}

/* Transcript Button Wrapper - Clean Design */
.audio-transcript-button-wrapper {
    margin: 20px 16px;
    display: flex;
    justify-content: center;
}

.audio-transcript-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.3px;
}

.audio-transcript-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

.audio-transcript-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.transcript-btn-icon {
    font-size: 18px;
    line-height: 1;
}

.transcript-btn-text {
    letter-spacing: 0.4px;
}

.transcript-text {
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.9;
}

.transcript-text p {
    margin: 0 0 20px 0;
    font-size: 17px;
    letter-spacing: 0.3px;
}

.transcript-text h4 {
   margin: 32px 0 16px 0;
    font-size: 22px;
    font-weight: 700;
    color: #ccceff;
    background: linear-gradient(135deg, rgb(102 126 234) 0%, rgb(118 75 162 / 41%) 100%);
    border-left: 4px solid #353666;
    padding: 12px 16px;
    
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-top-left-radius: 4px;
    border-top-right-radius: 44px;
    border-bottom-right-radius: 44px;
    border-bottom-left-radius: 4px;
}

.transcript-text h4:first-child {
    margin-top: 0;
}

.transcript-text ul {
    margin: 16px 0 20px 28px;
    padding: 0;
}

.transcript-text li {
    margin: 10px 0;
    font-size: 17px;
    line-height: 1.8;
}

/* Bold keywords in transcript */
.transcript-text strong,
.transcript-text b {
    
    font-weight: 700;
    
}

/* Scrollbar styling for transcript */
.transcript-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.transcript-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.transcript-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 4px;
}

.transcript-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* Playlist Toggle Button - Now inside the transcript scroll container */
.audio-playlist-toggle-btn {
    display: none; /* Hidden on desktop by default */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    padding: 14px 20px;
    margin: 24px 0 0 0;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.audio-playlist-toggle-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.toggle-icon {
    font-size: 18px;
}

.toggle-text {
    letter-spacing: 0.3px;
}

/* Fullscreen Transcript Modal - Redesigned */
.audio-transcript-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    animation: fadeIn 0.3s ease;
}

.audio-transcript-modal[style*="display: flex"],
.audio-transcript-modal[style*="display:flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.transcript-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.transcript-modal-container {
    position: relative;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transcript-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.transcript-modal-title {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.transcript-modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.transcript-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.transcript-modal-close-btn:active {
    transform: scale(0.95);
}

.transcript-modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.transcript-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2e 100%);
    -webkit-overflow-scrolling: touch;
}

.transcript-content {
    padding: 32px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.transcript-modal-body .transcript-text {
    max-width: 100%;
}

/* Scrollbar styling for transcript modal body */
.transcript-modal-body::-webkit-scrollbar {
    width: 12px;
}

.transcript-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.transcript-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.transcript-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
    background-clip: padding-box;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .daily-breakdown {
    padding: 10px;
    }

    .audio-guide-modal {
        padding: 10px;
    }

    .audio-guide-modal-content {
        width: 95%;
        max-height: 92vh;
        border-radius: 20px;
        max-width: 500px;
    }

    /* Stack vertically on mobile */
    .audio-guide-main-container {
        flex-direction: column;
        position: relative;
        min-height: 450px;
        flex: 1;
    }

    /* Selector takes full space initially on mobile */
    .audio-guide-selector {
        flex: 1 1 auto;
        max-height: none;
        max-width: none;
        border-right: none;
        border-bottom: none;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        position: relative;
        z-index: 1;
    }

    /* When player is active on mobile, selector slides down and fades out */
    .audio-guide-main-container.mobile-player-active .audio-guide-selector {
        transform: translateY(20px);
        opacity: 0;
        pointer-events: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        overflow: hidden;
    }

    /* Player slides up from bottom on mobile */
    .audio-guide-player-section {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: 100%;
        max-width: none;
        min-width: 0;
        padding: 20px;
        z-index: 2;
        transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .audio-guide-player-section.visible {
        top: 0;
    }

    /* Make header not clickable on mobile - use button instead */
    .audio-guide-unified-header {
        padding: 16px 20px;
        user-select: none;
    }

    /* Hide chevron on mobile - using button instead */
    .audio-guide-unified-header .audio-guide-chevron {
        display: none;
    }

    /* Hide toggle button by default on mobile */
    .audio-playlist-toggle-btn {
        display: none;
    }

    /* Show button only when player is active (to allow returning to playlist) */
    .audio-guide-main-container.mobile-player-active ~ .audio-playlist-toggle-btn {
        display: flex !important;
    }

    /* Hide button when playlist is visible (user is already viewing playlist) */
    .audio-guide-main-container.mobile-playlist-visible ~ .audio-playlist-toggle-btn {
        display: none !important;
    }

    /* Mobile responsive styles for transcript button */
    .audio-transcript-button-wrapper {
        margin: 16px 12px;
    }

    .audio-transcript-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 15px;
    }

    .transcript-btn-icon {
        font-size: 20px;
    }

    .transcript-text h4 {
        font-size: 19px;
        margin: 24px 0 12px 0;
        padding: 10px 14px;
    }

    /* When playlist is visible on mobile, player slides down and selector slides up */
    .mobile-playlist-visible .audio-guide-selector {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: relative !important;
        height: auto !important;
    }

    .mobile-playlist-visible .audio-guide-player-section {
        top: 100%;
    }

    /* Fix padding on mobile player */
    .audio-guide-player-section {
        padding: 16px;
    }

    .audio-guide-title {
        font-size: 20px;
    }

    .audio-guide-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .audio-guide-selector-scroll {
        padding: 16px;
    }

    .audio-guide-intro {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .audio-section-btn {
        padding: 12px 14px;
        gap: 10px;
    }

    .section-icon {
        font-size: 26px;
        width: 38px;
        height: 38px;
    }

    .section-title {
        font-size: 15px;
    }

    .section-desc {
        font-size: 12px;
    }

    .section-duration {
        font-size: 11px;
    }

    .audio-guide-player-section {
        padding: 0;
    }

    .audio-player-display {
        padding: 20px 12px;
        margin: 0 16px 16px 16px;
    }

    .player-section-icon {
        font-size: 48px;
    }

    .player-section-title {
        font-size: 18px;
    }

    .player-section-desc {
        font-size: 13px;
    }

    .audio-subtitle {
        font-size: 18px;
        padding: 18px 14px;
        min-height: 85px;
        margin: 0 16px 16px 16px;
    }

    .audio-player-container {
        margin: 0 16px 16px 16px;
    }
    
    .audio-player {
        height: 50px;
    }

    .audio-player-note {
        font-size: 11px;
        padding: 10px 12px;
        margin: 0 16px;
    }

    .header-info-btn {
        padding: 6px 12px;
        top: 8px;
        right: 8px;
        font-size: 11px;
    }

    .header-info-btn span:first-child {
        font-size: 18px;
    }

    /* Mobile styles for fullscreen transcript modal */
    .transcript-modal-container {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .transcript-modal-header {
        padding: 18px 20px;
    }

    .transcript-modal-title {
        font-size: 18px;
    }

    .transcript-modal-close-btn {
        width: 32px;
        height: 32px;
    }

    .transcript-modal-close-btn svg {
        width: 18px;
        height: 18px;
    }

    .transcript-content {
        padding: 24px 20px;
    }

    .transcript-text p,
    .transcript-text li {
        font-size: 15px;
    }

    .transcript-text h4 {
        font-size: 18px;
        margin: 20px 0 12px 0;
        padding: 10px 12px;
    }
}

@media (max-width: 400px) {
    .audio-guide-title {
        font-size: 17px;
    }

    .audio-section-btn {
        padding: 10px 12px;
    }

    .section-icon {
        font-size: 24px;
        width: 36px;
        height: 36px;
    }

    .section-title {
        font-size: 14px;
    }

    .audio-subtitle {
        font-size: 15px;
        min-height: 80px;
    }

    .player-section-icon {
        font-size: 40px;
    }
}

@media (min-width: 769px) {
    .audio-guide-modal-content {
        max-width: 1260px;
    }
}

/* ============================================
   MOBILE CHART & TABLE FIXES
   ============================================ */

/* Scroll container wrapper for charts and tables */
.mobile-scroll-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4682B4 rgba(70, 130, 180, 0.1);
}

.mobile-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.mobile-scroll-container::-webkit-scrollbar-track {
    background: rgba(70, 130, 180, 0.1);
    border-radius: 4px;
}

.mobile-scroll-container::-webkit-scrollbar-thumb {
    background: #4682B4;
    border-radius: 4px;
}

.mobile-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #5A9BD4;
}

/* Scroll hint indicator */
.scroll-hint {
    display: none;
    position: relative;
    text-align: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4682B4 0%, #5A9BD4 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    margin: 8px auto;
    box-shadow: 0 2px 8px rgba(70, 130, 180, 0.3);
    animation: pulse-hint 2s ease-in-out infinite;
    max-width: fit-content;
}

@keyframes pulse-hint {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

.scroll-hint::before {
    content: '';
    margin-right: 6px;
    font-size: 14px;
}

.scroll-hint::after {
    content: '';
    margin-left: 6px;
    font-size: 14px;
    animation: swipe-animation 1.5s ease-in-out infinite;
}

@keyframes swipe-animation {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

/* Mobile chart container fixes */
@media (max-width: 768px) {
    /* Show scroll hints on mobile */
    .scroll-hint {
        display: block;
    }

    /* Charts now fit to container width naturally */
    /* Removed fixed width - charts are fully responsive now */
    #performanceChart,
    #tankLevelChart,
    #monthlyChart {
        width: 100% !important;
    }

    /* Canvas containers need to allow horizontal scroll */
    canvas {
        max-width: none !important;
    }

    /* Chart wrapper divs */
    div[style*="canvas"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Performance Chart Container */
    #performanceChartContainer {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 20px !important;
    }

    #performanceChartContainer > div:last-child {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 12px !important;
    }

    /* Monthly Breakdown Table - ensure it can scroll horizontally */
    #monthlyTable {
        min-width: 700px !important;
        width: auto !important;
    }

    /* Table wrapper with visible scrollbars on iOS */
    div[style*="overflow-x: auto"] {
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        padding-bottom: 12px !important;
    }

    /* Year-by-Year Performance table */
    #yearByYearSection table {
        min-width: 900px !important;
        width: auto !important;
    }

    #yearByYearSection > div[style*="overflow-x"] {
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: auto !important;
        padding-bottom: 12px !important;
        margin-bottom: 8px !important;
    }
}

/* Extra small devices - fully responsive */
@media (max-width: 480px) {
    #performanceChart,
    #tankLevelChart,
    #monthlyChart {
        width: 100% !important;
        padding: 1rem;
    }

    /* Increase scroll hint visibility on very small screens */
    .scroll-hint {
        font-size: 13px;
        padding: 10px 16px;
        margin: 12px auto;
        font-weight: 700;
    }
}

/* Ultra tiny devices - fully responsive */
@media (max-width: 400px) {
    #performanceChart,
    #tankLevelChart,
    #monthlyChart {
        width: 100% !important;
        padding: 0.5rem;
    }

    .scroll-hint {
        font-size: 12px;
        padding: 8px 12px;
        margin: 10px auto;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS FOR STEP 2 & STEP 3
   (760px and below)
   ============================================ */
@media (max-width: 760px) {
    /* Step 2: Configure System - Header and Toggle Button */
    #configSection h2 {
        font-size: 18px !important;
    }
    
    #waterUsageUnitToggle {
        padding: 6px 12px !important;
        font-size: 14px !important;
        min-height: 32px !important;
    }
    
    /* Compact the header flex container */
    #configSection > div:first-of-type {
        gap: 8px !important;
    }
    
    /* Config Toggle Button - More compact */
    .config-toggle-btn {
        padding: 8px 12px !important;
        font-size: 16px !important;
    }

    /* Toggle button labels - bigger text */
    .configToggleLabel {
        font-size: 22px !important;
        font-weight: 700 !important;
    }
    
    .config-summary {
        font-size: 14px !important;
    }
    
    .config-summary .label {
        font-size: 14px !important;
    }
    
    .config-summary .value {
        font-size: 14px !important;
    }
    
    .config-summary .total-value {
        font-size: 18px !important;
    }
    
    .toggle-icon {
        font-size: 16px !important;
    }
    
    /* Config Grid Items - More compact */
    .config-grid > div {
        padding: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .config-grid label {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }
    
    .config-grid input {
        padding: 10px !important;
        font-size: 16px !important;
    }
    
    .config-grid > div > div:not(:first-child) {
        font-size: 11px !important;
    }
    
    /* Step 3: Water Use - Header */
    #waterOptionsSection h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    /* Water Options Toggle Button */
    #waterOptionsToggleBtn {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    /* Water options toggle label - bigger text */
    #waterOptionsToggleLabel {
        font-size: 22px !important;
        font-weight: 700 !important;

    }
    
    #waterOptionsSummary {
        font-size: 15px !important;
    }
    
    /* Water Usage Content - More compact */
    #waterUsageContent > div {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }
    
    #waterUsageContent label {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }
    
    /* Household Size Display - Smaller */
    #householdSizeDisplay {
        padding: 16px !important;
    }
    
    #householdSizeDisplay > div:first-child {
        font-size: 56px !important;
    }
    
    #householdSizeDisplay > div:nth-child(2) {
        font-size: 12px !important;
        margin-top: 6px !important;
    }
    
    #householdSizeDisplay > div:last-child {
        font-size: 11px !important;
        margin-top: 3px !important;
    }
    
    /* Water Usage Breakdown - More compact */
    .water-usage-grid > div {
        padding: 10px 6px !important;
    }
    
    .water-usage-grid span[style*="font-size: 24px"] {
        font-size: 20px !important;
    }
    
    .water-usage-grid span[style*="font-size: 16px"] {
        font-size: 14px !important;
    }
    
    .water-usage-grid button {
        padding: 6px !important;
        font-size: 20px !important;
        margin-bottom: 6px !important;
        margin-top: 6px !important;
    }
    
    .water-usage-grid input {
        padding: 6px 4px !important;
        font-size: 11px !important;
    }
    
    #usageUnitLabel {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    
    /* Water Usage Breakdown Title */
    #waterUsageContent div[style*="font-weight: bold"] {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    
    /* Total Usage Display */
    #totalUsageDisplay {
        padding: 12px !important;
    }
    
    .water-summary {
        font-size: 22px !important;
    }
    
    .water-summary .value {
        font-size: 16px !important;
    }
    
    /* Calculate/Show Results Button */
    #calculateButton {
        padding: 14px !important;
        font-size: 14px !important;
        min-height: 50px !important;
    }

    #recalcNotice {
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* ============================================
       COLLAPSED SUMMARY SECTIONS - MOBILE SPECIFIC
       Make the collapsed view super compact on mobile
       ============================================ */

    /* Step 2: Configure System - Collapsed Summary */
    #configSummary > div {
        padding: 16px 12px !important;
        margin: 8px 0 !important;
        border-radius: 16px !important;
    }

    /* Location text at top */
    #configSummary div[style*="font-size: 25px"] {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.5px !important;
    }

    /* Section headers like "Annual Rainfall:", "🏠 Roof:", "🪣 Storage:" */
    #configSummary div[style*="font-size: 20px"],
    #configSummary div[style*="font-size: 13px"][style*="font-weight: 600"] {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    /* Large value boxes (rainfall, roof area, storage) */
    #configSummary div[style*="font-size: 32px"],
    #configSummary div[style*="font-size: 28px"] {
        font-size: 16px !important;
        padding: 8px 16px !important;
        letter-spacing: -0.3px !important;
    }

    /* Gradient boxes containing the values */
    #configSummary div[style*="background: linear-gradient"][style*="padding: 12px"] {
        padding: 8px 16px !important;
        border-radius: 12px !important;
    }

    /* Roof material badge */
    #configSummary div[style*="background: rgba(209, 118, 73, 0.08)"] {
        padding: 4px 10px !important;
        border-radius: 12px !important;
    }

    #configSummary div[style*="background: rgba(209, 118, 73, 0.08)"] span[style*="font-size: 16px"] {
        font-size: 14px !important;
    }

    #configSummary div[style*="background: rgba(209, 118, 73, 0.08)"] span[style*="font-size: 12px"] {
        font-size: 10px !important;
    }

    /* Divider dots between values */
    #configSummary div[style*="font-size: 28px"][style*="font-weight: 300"],
    #configSummary span[style*="font-size: 20px"][style*="font-weight: 300"] {
        font-size: 14px !important;
    }

    /* Reduce gaps between sections */
    #configSummary div[style*="margin-bottom: 20px"] {
        margin-bottom: 12px !important;
        padding-bottom: 12px !important;
    }

    /* Step 3: Water Use - Collapsed Summary */
    #waterOptionsSummary > div {
        padding: 16px 12px !important;
        margin: 8px 0 !important;
        border-radius: 16px !important;
    }

    /* "Per Person Daily Usage" header */
    #waterOptionsSummary div[style*="font-size: 12px"][style*="text-transform: uppercase"] {
        font-size: 10px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.8px !important;
    }

    /* Large value boxes (usage numbers) */
    #waterOptionsSummary div[style*="font-size: 32px"],
    #waterOptionsSummary div[style*="font-size: 28px"],
    #waterOptionsSummary span[style*="font-size: 28px"] {
        font-size: 16px !important;
        padding: 8px 16px !important;
        letter-spacing: -0.3px !important;
    }

    /* Unit text (L • gal) */
    #waterOptionsSummary div[style*="font-size: 14px"][style*="font-weight: 500"],
    #waterOptionsSummary span[style*="font-size: 14px"][style*="color: rgba"] {
        font-size: 10px !important;
    }

    /* Gradient boxes containing the usage values */
    #waterOptionsSummary div[style*="background: linear-gradient"][style*="padding: 16px"] {
        padding: 8px 16px !important;
        border-radius: 12px !important;
    }

    /* "Total Household" header */
    #waterOptionsSummary div[style*="font-size: 13px"][style*="text-transform: uppercase"] {
        font-size: 10px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.8px !important;
    }

    /* Divider dots */
    #waterOptionsSummary span[style*="font-size: 20px"][style*="font-weight: 300"] {
        font-size: 14px !important;
    }

    /* Reduce gaps between sections */
    #waterOptionsSummary div[style*="margin-bottom: 20px"] {
        margin-bottom: 12px !important;
        padding-bottom: 12px !important;
    }

    /* "SHOW RESULTS" button in collapsed summary */
    #waterOptionsSummary button {
        padding: 12px 18px !important;
        font-size: 14px !important;
        border-radius: 32px !important;
    }

    #waterOptionsSummary button span[style*="font-size: 24px"] {
        font-size: 18px !important;
        margin-right: 8px !important;
    }
}

/* ============================================
   OPTIMIZATION OPPORTUNITIES MOBILE RESPONSIVE
   ============================================ */

/* Tablet and Mobile - 768px and below */
@media (max-width: 768px) {
    /* Optimization container */
    #reliabilitySection ~ div[style*="margin-top: 28px"] {
        margin-top: 16px !important;
    }

    /* Main optimization box with gradient background */
    #reliabilitySection ~ div div[style*="border-radius: 20px"][style*="padding: 32px"] {
        padding: 20px !important;
        border-radius: 16px !important;
    }

    /* Optimization Header container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"] {
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding-bottom: 16px !important;
    }

    /* Optimization Header emoji */
    #reliabilitySection ~ div div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 32px !important;
    }

    /* Optimization Header title (h3) */
    #reliabilitySection ~ div h3[style*="font-size: 28px"] {
        font-size: 20px !important;
        letter-spacing: -0.3px !important;
    }

    /* Optimization Header subtitle (p) */
    #reliabilitySection ~ div div[style*="gap: 16px"] + div p[style*="font-size: 16px"] {
        font-size: 13px !important;
        margin: 3px 0 0 0 !important;
    }

    /* Optimization Cards container */
    #reliabilitySection ~ div div[style*="display: grid"][style*="gap: 24px"] {
        gap: 16px !important;
    }

    /* Individual optimization card */
    #reliabilitySection ~ div div[style*="border-radius: 16px"][style*="padding: 28px"][style*="border-left: 6px solid"] {
        padding: 18px !important;
        border-radius: 12px !important;
        border-left-width: 4px !important;
    }

    /* Severity badge */
    #reliabilitySection ~ div div[style*="padding: 6px 14px"][style*="border-radius: 20px"][style*="font-size: 13px"] {
        padding: 5px 12px !important;
        font-size: 11px !important;
        margin-bottom: 12px !important;
    }

    /* Category icon + text container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 16px"] {
        gap: 12px !important;
        margin-bottom: 12px !important;
    }

    /* Category emoji */
    #reliabilitySection ~ div div[style*="font-size: 56px"] {
        font-size: 36px !important;
    }

    /* Category title (h4) */
    #reliabilitySection ~ div h4[style*="font-size: 24px"] {
        font-size: 18px !important;
    }

    /* Savings display */
    #reliabilitySection ~ div div[style*="margin-top: 6px"] div[style*="font-size: 28px"] {
        font-size: 20px !important;
    }

    #reliabilitySection ~ div div[style*="margin-top: 6px"] span[style*="font-size: 16px"] {
        font-size: 13px !important;
    }

    /* Issue description */
    #reliabilitySection ~ div div[style*="font-size: 16px"][style*="line-height: 1.6"][style*="margin-bottom: 20px"] {
        font-size: 14px !important;
        margin-bottom: 14px !important;
        line-height: 1.5 !important;
    }

    /* Recommendation text */
    #reliabilitySection ~ div div[style*="font-size: 15px"][style*="line-height: 1.7"] {
        font-size: 13px !important;
        line-height: 1.6 !important;
    }

    /* Impact label */
    #reliabilitySection ~ div div[style*="font-size: 13px"][style*="text-transform: uppercase"][style*="margin-bottom: 8px"] {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
}

/* Small Mobile - 450px and below */
@media (max-width: 450px) {
    /* Main optimization box */
    #reliabilitySection ~ div div[style*="border-radius: 20px"][style*="padding: 32px"] {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    /* Optimization Header container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"] {
        gap: 10px !important;
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
    }

    /* Optimization Header emoji */
    #reliabilitySection ~ div div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 28px !important;
    }

    /* Optimization Header title (h3) */
    #reliabilitySection ~ div h3[style*="font-size: 28px"] {
        font-size: 17px !important;
        letter-spacing: -0.2px !important;
    }

    /* Optimization Header subtitle (p) */
    #reliabilitySection ~ div div[style*="gap: 16px"] + div p[style*="font-size: 16px"] {
        font-size: 12px !important;
    }

    /* Optimization Cards container */
    #reliabilitySection ~ div div[style*="display: grid"][style*="gap: 24px"] {
        gap: 12px !important;
    }

    /* Individual optimization card */
    #reliabilitySection ~ div div[style*="border-radius: 16px"][style*="padding: 28px"][style*="border-left: 6px solid"] {
        padding: 14px !important;
        border-radius: 10px !important;
        border-left-width: 3px !important;
    }

    /* Severity badge */
    #reliabilitySection ~ div div[style*="padding: 6px 14px"][style*="border-radius: 20px"][style*="font-size: 13px"] {
        padding: 4px 10px !important;
        font-size: 10px !important;
        margin-bottom: 10px !important;
    }

    /* Category icon + text container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 16px"] {
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    /* Category emoji */
    #reliabilitySection ~ div div[style*="font-size: 56px"] {
        font-size: 30px !important;
    }

    /* Category title (h4) */
    #reliabilitySection ~ div h4[style*="font-size: 24px"] {
        font-size: 16px !important;
    }

    /* Savings display */
    #reliabilitySection ~ div div[style*="margin-top: 6px"] div[style*="font-size: 28px"] {
        font-size: 18px !important;
    }

    #reliabilitySection ~ div div[style*="margin-top: 6px"] span[style*="font-size: 16px"] {
        font-size: 12px !important;
    }

    /* Issue description */
    #reliabilitySection ~ div div[style*="font-size: 16px"][style*="line-height: 1.6"][style*="margin-bottom: 20px"] {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    /* Recommendation text */
    #reliabilitySection ~ div div[style*="font-size: 15px"][style*="line-height: 1.7"] {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    /* Impact label */
    #reliabilitySection ~ div div[style*="font-size: 13px"][style*="text-transform: uppercase"][style*="margin-bottom: 8px"] {
        font-size: 10px !important;
        margin-bottom: 5px !important;
    }
}

/* Very Small Mobile - 300px and below */
@media (max-width: 300px) {
    /* Main optimization box - minimal padding */
    #reliabilitySection ~ div div[style*="border-radius: 20px"][style*="padding: 32px"] {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    /* Optimization Header container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"] {
        gap: 8px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    /* Optimization Header emoji */
    #reliabilitySection ~ div div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 24px !important;
    }

    /* Optimization Header title (h3) */
    #reliabilitySection ~ div h3[style*="font-size: 28px"] {
        font-size: 15px !important;
        letter-spacing: -0.1px !important;
        line-height: 1.3 !important;
    }

    /* Optimization Header subtitle (p) */
    #reliabilitySection ~ div div[style*="gap: 16px"] + div p[style*="font-size: 16px"] {
        font-size: 11px !important;
    }

    /* Optimization Cards container */
    #reliabilitySection ~ div div[style*="display: grid"][style*="gap: 24px"] {
        gap: 10px !important;
    }

    /* Individual optimization card */
    #reliabilitySection ~ div div[style*="border-radius: 16px"][style*="padding: 28px"][style*="border-left: 6px solid"] {
        padding: 10px !important;
        border-radius: 8px !important;
        border-left-width: 3px !important;
    }

    /* Severity badge */
    #reliabilitySection ~ div div[style*="padding: 6px 14px"][style*="border-radius: 20px"][style*="font-size: 13px"] {
        padding: 3px 8px !important;
        font-size: 9px !important;
        margin-bottom: 8px !important;
    }

    /* Category icon + text container */
    #reliabilitySection ~ div div[style*="gap: 16px"][style*="margin-bottom: 16px"] {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Category emoji */
    #reliabilitySection ~ div div[style*="font-size: 56px"] {
        font-size: 26px !important;
    }

    /* Category title (h4) */
    #reliabilitySection ~ div h4[style*="font-size: 24px"] {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    /* Savings display */
    #reliabilitySection ~ div div[style*="margin-top: 6px"] div[style*="font-size: 28px"] {
        font-size: 16px !important;
    }

    #reliabilitySection ~ div div[style*="margin-top: 6px"] span[style*="font-size: 16px"] {
        font-size: 11px !important;
    }

    /* Issue description */
    #reliabilitySection ~ div div[style*="font-size: 16px"][style*="line-height: 1.6"][style*="margin-bottom: 20px"] {
        font-size: 12px !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
    }

    /* Recommendation text */
    #reliabilitySection ~ div div[style*="font-size: 15px"][style*="line-height: 1.7"] {
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    /* Impact label */
    #reliabilitySection ~ div div[style*="font-size: 13px"][style*="text-transform: uppercase"][style*="margin-bottom: 8px"] {
        font-size: 9px !important;
        margin-bottom: 4px !important;
    }
}

/* ============================================
   COMPONENT ANALYSIS MOBILE RESPONSIVE
   ============================================ */

/* Tablet and Mobile - 768px and below */
@media (max-width: 768px) {
    /* Component Analysis container */
    div[style*="margin-top: 28px"][style*="padding: 0"] {
        margin-top: 16px !important;
    }

    /* Main component analysis box with gradient background */
    div[style*="border-radius: 20px"][style*="padding: 32px"][style*="box-shadow: 0 8px 32px"] {
        padding: 20px !important;
        border-radius: 16px !important;
    }

    /* Component Analysis Header container */
    div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"][style*="border-bottom: 2px solid"] {
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding-bottom: 16px !important;
    }

    /* Component Analysis Header emoji (📋) */
    div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 32px !important;
    }

    /* Component Analysis Header title (h3) */
    h3[style*="font-size: 28px"][style*="font-weight: 800"] {
        font-size: 20px !important;
        letter-spacing: -0.3px !important;
    }

    /* Component Analysis Header subtitle (p) */
    div[style*="gap: 16px"] p[style*="font-size: 16px"] {
        font-size: 13px !important;
        margin: 3px 0 0 0 !important;
    }

    /* Component Cards Grid */
    div[style*="display: grid"][style*="gap: 24px"] {
        gap: 16px !important;
    }

    /* Individual component card (Roof, Tank, Usage) */
    div[style*="border-radius: 16px"][style*="padding: 24px"][style*="border-left: 6px solid"] {
        padding: 16px !important;
        border-radius: 12px !important;
        border-left-width: 4px !important;
    }

    /* Card content container with icon */
    div[style*="display: flex"][style*="align-items: flex-start"][style*="gap: 20px"] {
        gap: 14px !important;
    }

    /* Component card emoji (🏠, 🪣, 💧) */
    div[style*="font-size: 56px"][style*="line-height: 1"][style*="flex-shrink: 0"] {
        font-size: 40px !important;
    }

    /* Component card title (ROOF COLLECTION, etc.) */
    div[style*="font-size: 18px"][style*="font-weight: 700"][style*="text-transform: uppercase"] {
        font-size: 15px !important;
        margin-bottom: 10px !important;
        letter-spacing: 0.8px !important;
    }

    /* Component card description text */
    div[style*="font-size: 20px"][style*="line-height: 1.6"] {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
}

/* Small Mobile - 450px and below */
@media (max-width: 450px) {
    /* Main component analysis box */
    div[style*="border-radius: 20px"][style*="padding: 32px"][style*="box-shadow: 0 8px 32px"] {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    /* Component Analysis Header container */
    div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"][style*="border-bottom: 2px solid"] {
        gap: 10px !important;
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
    }

    /* Component Analysis Header emoji */
    div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 28px !important;
    }

    /* Component Analysis Header title (h3) */
    h3[style*="font-size: 28px"][style*="font-weight: 800"] {
        font-size: 17px !important;
        letter-spacing: -0.2px !important;
    }

    /* Component Analysis Header subtitle (p) */
    div[style*="gap: 16px"] p[style*="font-size: 16px"] {
        font-size: 12px !important;
    }

    /* Component Cards Grid */
    div[style*="display: grid"][style*="gap: 24px"] {
        gap: 12px !important;
    }

    /* Individual component card */
    div[style*="border-radius: 16px"][style*="padding: 24px"][style*="border-left: 6px solid"] {
        padding: 12px !important;
        border-radius: 10px !important;
        border-left-width: 3px !important;
    }

    /* Card content container with icon */
    div[style*="display: flex"][style*="align-items: flex-start"][style*="gap: 20px"] {
        gap: 12px !important;
    }

    /* Component card emoji */
    div[style*="font-size: 56px"][style*="line-height: 1"][style*="flex-shrink: 0"] {
        font-size: 34px !important;
    }

    /* Component card title */
    div[style*="font-size: 18px"][style*="font-weight: 700"][style*="text-transform: uppercase"] {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        letter-spacing: 0.6px !important;
    }

    /* Component card description text */
    div[style*="font-size: 20px"][style*="line-height: 1.6"] {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
}

/* Very Small Mobile - 300px and below */
@media (max-width: 300px) {
    /* Main component analysis box - minimal padding */
    div[style*="border-radius: 20px"][style*="padding: 32px"][style*="box-shadow: 0 8px 32px"] {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    /* Component Analysis Header container */
    div[style*="gap: 16px"][style*="margin-bottom: 32px"][style*="padding-bottom: 24px"][style*="border-bottom: 2px solid"] {
        gap: 8px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    /* Component Analysis Header emoji */
    div[style*="font-size: 48px"][style*="line-height: 1"] {
        font-size: 24px !important;
    }

    /* Component Analysis Header title (h3) */
    h3[style*="font-size: 28px"][style*="font-weight: 800"] {
        font-size: 15px !important;
        letter-spacing: -0.1px !important;
        line-height: 1.3 !important;
    }

    /* Component Analysis Header subtitle (p) */
    div[style*="gap: 16px"] p[style*="font-size: 16px"] {
        font-size: 11px !important;
    }

    /* Component Cards Grid */
    div[style*="display: grid"][style*="gap: 24px"] {
        gap: 10px !important;
    }

    /* Individual component card */
    div[style*="border-radius: 16px"][style*="padding: 24px"][style*="border-left: 6px solid"] {
        padding: 10px !important;
        border-radius: 8px !important;
        border-left-width: 3px !important;
    }

    /* Card content container with icon */
    div[style*="display: flex"][style*="align-items: flex-start"][style*="gap: 20px"] {
        gap: 10px !important;
    }

    /* Component card emoji */
    div[style*="font-size: 56px"][style*="line-height: 1"][style*="flex-shrink: 0"] {
        font-size: 28px !important;
    }

    /* Component card title */
    div[style*="font-size: 18px"][style*="font-weight: 700"][style*="text-transform: uppercase"] {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        letter-spacing: 0.5px !important;
    }

    /* Component card description text */
    div[style*="font-size: 20px"][style*="line-height: 1.6"] {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
}

/* ====================================
   RESPONSIVE STYLES FOR SMALL SCREENS
   ==================================== */

/* Tablets and below - 769px and under */
@media (max-width: 769px) {
    /* System Analysis Section - Reduce all text sizes */

    /* System Analysis header title */
    h3[style*="font-size: 24px"][style*="System Analysis"] {
        font-size: 18px !important;
        letter-spacing: 1px !important;
    }

    /* Component panel emojis (roof, tank, material) */
    div[style*="font-size: 32px"][style*="margin-bottom: 8px"] {
        font-size: 24px !important;
    }

    /* Component panel values (roof area, tank months, efficiency %) */
    div[style*="font-size: 36px"][style*="font-weight: 900"][style*="line-height: 1"] {
        font-size: 28px !important;
    }

    /* Component panel sub-labels */
    div[style*="font-size: 11px"].lcars-sublabel,
    div[style*="font-size: 9px"].lcars-sublabel {
        font-size: 10px !important;
    }

    /* Overall assessment padding */
    div[style*="padding: 32px"][style*="border-radius: 20px"] {
        padding: 20px !important;
    }

    /* Section headers with icons */
    div[style*="font-size: 40px"][style*="animation: gearSpin"] {
        font-size: 32px !important;
    }

    /* Priority Optimizations / Urgent Actions - Section Headers */
    h3[style*="font-size: 28px"][style*="font-weight: 800"] {
        font-size: 20px !important;
    }

    /* Priority Optimizations / Urgent Actions - Subtitle */
    p[style*="font-size: 16px"][style*="color: rgba(255, 255, 255, 0.7)"] {
        font-size: 13px !important;
    }

    /* Category/Title headings (Kitchen, etc.) */
    h4[style*="font-size: 24px"][style*="font-weight: 800"] {
        font-size: 18px !important;
    }

    /* Issue message and recommendation paragraphs */
    p[style*="font-size: 19px"][style*="line-height: 1.6"] {
        font-size: 15px !important;
    }

    /* Action Required text */
    div[style*="font-size: 18px"][style*="text-transform: uppercase"] {
        font-size: 14px !important;
    }

    /* Action item text */
    div[style*="font-size: 18px"][style*="line-height: 1.6"][style*="color: rgba(255, 255, 255, 0.85)"] {
        font-size: 14px !important;
    }

    /* Emoji icons in priority cards */
    div[style*="font-size: 56px"][style*="line-height: 1"] {
        font-size: 40px !important;
    }

    /* Light bulb emoji in action section */
    div[style*="font-size: 28px"][style*="line-height: 1"] {
        font-size: 22px !important;
    }

    /* Savings badges */
    div[style*="font-size: 14px"][style*="💰 Save"] {
        font-size: 12px !important;
        padding: 3px 10px !important;
    }

    /* Severity/Urgency badges */
    div[style*="font-size: 13px"][style*="font-weight: 700"][style*="letter-spacing: 0.5px"] {
        font-size: 11px !important;
        padding: 5px 12px !important;
    }

    /* Card padding */
    div[style*="padding: 28px"][style*="border-radius: 33px"] {
        padding: 20px !important;
        border-radius: 25px !important;
    }

    /* Action section padding */
    div[style*="padding: 20px"][style*="border-radius: 20px"][style*="border-left: 4px solid"] {
        padding: 15px !important;
        border-radius: 15px !important;
    }
}

/* Mobile landscape and below - 450px and under */
@media (max-width: 450px) {
    /* Collection vs Demand Section - Make it fit tiny screens */

    /* Main Collection/Demand value numbers */
    .lcars-value[style*="font-size: 36px"] {
        font-size: 24px !important;
    }

    /* Collection vs Demand labels */
    .lcars-sublabel[style*="font-size: 11px"],
    .lcars-sublabel[style*="font-size: 10px"] {
        font-size: 9px !important;
    }

    /* Percentage metric (the big % number) */
    .lcars-value[style*="font-size: 48px"] {
        font-size: 32px !important;
    }

    /* Grid gap for collection vs demand */
    div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"][style*="gap: 16px"] {
        gap: 8px !important;
    }

    /* Reduce padding in Collection vs Demand cards */
    div[style*="padding: 12px"][style*="background: rgba(0,0,0,0.05)"] {
        padding: 8px !important;
    }

    /* Priority Optimizations / Urgent Actions - Further reductions */

    /* Section headers */
    h3[style*="font-size: 28px"][style*="font-weight: 800"],
    h3[style*="font-size: 20px"][style*="font-weight: 800"] {
        font-size: 16px !important;
        letter-spacing: -0.3px !important;
    }

    /* Section subtitles */
    p[style*="font-size: 16px"][style*="color: rgba(255, 255, 255, 0.7)"],
    p[style*="font-size: 13px"][style*="color: rgba(255, 255, 255, 0.7)"] {
        font-size: 11px !important;
    }

    /* Category/Title headings */
    h4[style*="font-size: 24px"][style*="font-weight: 800"],
    h4[style*="font-size: 18px"][style*="font-weight: 800"] {
        font-size: 14px !important;
    }

    /* Issue messages and paragraphs */
    p[style*="font-size: 19px"][style*="line-height: 1.6"],
    p[style*="font-size: 15px"][style*="line-height: 1.6"] {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    /* Action Required label */
    div[style*="font-size: 18px"][style*="text-transform: uppercase"],
    div[style*="font-size: 14px"][style*="text-transform: uppercase"] {
        font-size: 11px !important;
    }

    /* Action item text */
    div[style*="font-size: 18px"][style*="line-height: 1.6"][style*="color: rgba(255, 255, 255, 0.85)"],
    div[style*="font-size: 14px"][style*="line-height: 1.6"][style*="color: rgba(255, 255, 255, 0.85)"] {
        font-size: 11px !important;
        line-height: 1.5 !important;
    }

    /* Large emoji icons */
    div[style*="font-size: 56px"][style*="line-height: 1"],
    div[style*="font-size: 40px"][style*="line-height: 1"] {
        font-size: 28px !important;
    }

    /* Medium emoji icons (light bulb, etc.) */
    div[style*="font-size: 28px"][style*="line-height: 1"],
    div[style*="font-size: 22px"][style*="line-height: 1"] {
        font-size: 18px !important;
    }

    /* Savings badges */
    div[style*="font-size: 14px"][style*="💰 Save"],
    div[style*="font-size: 12px"][style*="💰 Save"] {
        font-size: 10px !important;
        padding: 2px 8px !important;
    }

    /* Severity/Urgency badges */
    div[style*="font-size: 13px"][style*="font-weight: 700"][style*="letter-spacing: 0.5px"],
    div[style*="font-size: 11px"][style*="font-weight: 700"][style*="letter-spacing: 0.5px"] {
        font-size: 9px !important;
        padding: 4px 10px !important;
        letter-spacing: 0.3px !important;
    }

    /* Card padding - more aggressive */
    div[style*="padding: 28px"][style*="border-radius: 33px"],
    div[style*="padding: 20px"][style*="border-radius: 33px"],
    div[style*="padding: 20px"][style*="border-radius: 25px"] {
        padding: 12px !important;
        border-radius: 18px !important;
    }

    /* Action section padding */
    div[style*="padding: 20px"][style*="border-radius: 20px"][style*="border-left: 4px solid"],
    div[style*="padding: 15px"][style*="border-radius: 20px"][style*="border-left: 4px solid"],
    div[style*="padding: 15px"][style*="border-radius: 15px"][style*="border-left: 4px solid"] {
        padding: 10px !important;
        border-radius: 12px !important;
    }

    /* Action item numbered badges */
    div[style*="width: 28px"][style*="height: 28px"][style*="border-radius: 50%"] {
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
    }

    /* Gap between action items and cards */
    div[style*="display: grid"][style*="gap: 24px"] {
        gap: 12px !important;
    }

    div[style*="display: grid"][style*="gap: 12px"] {
        gap: 8px !important;
    }

    /* System Analysis - Further reductions for tiny screens */

    /* System Analysis header */
    h3[style*="font-size: 24px"][style*="System Analysis"] {
        font-size: 16px !important;
        letter-spacing: 0.5px !important;
    }

    /* Component panel emojis */
    div[style*="font-size: 32px"][style*="margin-bottom: 8px"],
    div[style*="font-size: 24px"][style*="margin-bottom: 8px"] {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }

    /* Component panel values */
    div[style*="font-size: 36px"][style*="font-weight: 900"][style*="line-height: 1"],
    div[style*="font-size: 28px"][style*="font-weight: 900"][style*="line-height: 1"] {
        font-size: 22px !important;
    }

    /* Component panel labels */
    div[style*="font-size: 11px"].lcars-sublabel {
        font-size: 9px !important;
    }

    div[style*="font-size: 9px"].lcars-sublabel,
    div[style*="font-size: 10px"].lcars-sublabel {
        font-size: 8px !important;
    }

    /* Component panel padding */
    div[style*="padding: 12px"][style*="border-radius: 20px"][style*="border: 2px solid"] {
        padding: 8px !important;
        border-radius: 12px !important;
    }

    /* Overall assessment padding */
    div[style*="padding: 32px"][style*="border-radius: 20px"],
    div[style*="padding: 20px"][style*="border-radius: 20px"] {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    /* Section header icon */
    div[style*="font-size: 40px"][style*="animation: gearSpin"],
    div[style*="font-size: 32px"][style*="animation: gearSpin"] {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }

    /* Grid template for component panels */
    div[style*="display: grid"][style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }

    /* Action items and detailed text */
    div[style*="font-size: 20px"][style*="line-height: 1.6"],
    div[style*="font-size: 18px"][style*="line-height: 1.6"] {
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    div[style*="font-size: 16px"][style*="line-height: 1.6"] {
        font-size: 10px !important;
        line-height: 1.4 !important;
    }

    /* Reduce header section padding */
    div[style*="padding: 24px 16px"][style*="margin: 0 0 24px 0"] {
        padding: 16px 12px !important;
        margin: 0 0 16px 0 !important;
    }
}

/* Badge Details Popup Styles */
.badge-details-popup {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Badge hover effect - entire badge is clickable */
div[onclick^="showBadgePopup"]:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    opacity: 0.95 !important;
}

/* Active state for badges */
div[onclick^="showBadgePopup"]:active {
    transform: scale(0.98) !important;
}

/* Mobile-specific adjustments for badge popup */
@media (max-width: 768px) {
    .badge-details-popup {
        width: 85vw !important;
        max-width: 350px !important;
        padding: 16px !important;
    }

    .badge-details-popup div[style*="font-size: 16px"] {
        font-size: 14px !important;
    }

    .badge-details-popup div[style*="font-size: 14px"] {
        font-size: 12px !important;
    }
}
