/* Dashboard Page Styles */

.dashboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Loading & Error States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #888;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    background: #2a1515;
    border: 1px solid #f87171;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #f87171;
}

.connect-tesla-prompt {
    margin-top: 1rem;
}

.connect-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 0.5rem;
}

.retry-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 0.9rem;
    min-width: 80px;
    transition: background 0.2s;
}

.retry-button:hover:not(:disabled) {
    background: #444;
    color: #fff;
}

.retry-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.retry-button .spinner-tiny {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #444;
    border-top: 2px solid #999;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Header */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

    .back-link:hover {
        color: #fff;
    }

.dashboard-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Update Pulse Indicator */
.update-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: none;
}

@keyframes quickPulse {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    25% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
        box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
    }

    100% {
        opacity: 0;
        transform: scale(0);
        box-shadow: none;
    }
}

.update-pulse.flash {
    animation: quickPulse 1s ease-out;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.forecast-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.85rem;
}

    .forecast-link:hover {
        color: #93c5fd;
    }

.weather-icon {
    font-size: 1.5rem;
}

.weather-desc {
    color: #888;
    font-size: 0.85rem;
}

.temperature {
    color: #888;
    font-size: 0.9rem;
}

/* Main Surplus Card */
.surplus-card {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

    .surplus-card.collapsed {
        padding: 1rem 1.5rem;
    }

.collapse-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

    .collapse-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

/* Pulse animation when collapsed */
.surplus-card.collapsed .collapse-btn {
    animation: pulse 4s infinite; /* Slower: from 2s to 4s */
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); /* Softer opacity */
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); /* Smaller radius, peak at 50% */
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.collapse-btn svg {
    transition: transform 0.3s ease;
}

.surplus-card .hidden {
    display: none;
}

.surplus-header {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Main Values - Two Column Layout */
.main-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.main-value-item {
    text-align: center;
    padding: 0.5rem;
}

.main-value-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.main-value-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    min-height: 2.75rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.15em;
}

.main-value-number.muted {
    color: #555;
}

.main-value-unit {
    font-size: 0.5em;
    font-weight: 400;
    opacity: 0.5;
    flex-shrink: 0;
}

/* Solar Surplus - green */
.main-value-item.solar-surplus .main-value-number {
    color: #4ade80;
}

/* Your Plan - blue */
.main-value-item.your-plan .main-value-number {
    color: #60a5fa;
}

.energy-status-hint {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    min-height: 1.4em;
    text-align: center;
}

.hint-export {
    color: #fbbf24;
}

.hint-pw {
    color: #f97316;
}

.hint-good {
    color: #4ade80;
}

.hint-none {
    visibility: hidden;
}

/* Slider Section */
.slider-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label {
    color: #aaa;
    font-size: 0.85rem;
}

.slider-value {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.extra-slider {
    flex: 1;
    height: 6px;
    appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
}

    .extra-slider::-webkit-slider-thumb {
        appearance: none;
        width: 28px;
        height: 28px;
        background: linear-gradient(145deg, #4a9eff, #3b82f6);
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

        .extra-slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
            box-shadow: 0 3px 12px rgba(59, 130, 246, 0.5);
        }

        .extra-slider::-webkit-slider-thumb:active {
            transform: scale(1.15);
        }

    .extra-slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
        background: linear-gradient(145deg, #4a9eff, #3b82f6);
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }

    /* Over limit - red slider */
    .extra-slider.over-limit::-webkit-slider-thumb {
        background: linear-gradient(145deg, #fca5a5, #f87171);
        box-shadow: 0 2px 8px rgba(248, 113, 113, 0.4);
    }

    .extra-slider.over-limit::-moz-range-thumb {
        background: linear-gradient(145deg, #fca5a5, #f87171);
        box-shadow: 0 2px 8px rgba(248, 113, 113, 0.4);
    }

.slider-value.text-danger {
    color: #f87171;
}

.slider-value {
    min-width: 70px;
    text-align: right;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.equivalent-display {
    margin-top: 1rem;
    text-align: center;
}

.ev-equiv {
    color: #4ade80;
    font-size: 1.1rem;
    font-weight: 600;
}

.ac-equiv {
    color: #60a5fa;
    font-size: 1.1rem;
    font-weight: 600;
}

.equiv-divider {
    color: #555;
    font-size: 1rem;
}

.equiv-placeholder {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* Result Section */
.result-section {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.help-icon.inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 0.35rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}

    .help-icon.inline:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.25);
    }

    .help-icon.inline .help-text {
        font-size: 10px;
        color: #999;
        font-weight: 600;
        line-height: 1;
    }

    .help-icon.inline:hover .help-text {
        color: #ccc;
    }

.help-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .help-icon:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        color: #fff;
    }

.tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.2s ease-out;
}

.tooltip-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    max-width: 320px;
    width: 90%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: popoverFadeIn 0.2s ease-out;
}

    .tooltip-popover p {
        margin: 0;
        color: #ccc;
        font-size: 0.9rem;
        line-height: 1.5;
    }

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #333;
}

    .tooltip-header h3 {
        margin: 0;
        font-size: 1rem;
        color: #fff;
        font-weight: 500;
    }

.tooltip-body {
    padding: 1rem;
}

.tooltip-item {
    margin-bottom: 1rem;
}

    .tooltip-item:last-child {
        margin-bottom: 0;
    }

    .tooltip-item strong {
        display: block;
        color: #fff;
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .tooltip-item p {
        margin: 0;
        color: #999;
        font-size: 0.85rem;
        line-height: 1.4;
    }


.tooltip-popover .tooltip-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

    .tooltip-popover .tooltip-close:hover {
        color: #fff;
    }

.result-items {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.surplus-card.collapsed .result-section {
    border-top: none;
    padding-top: 0;
}

.result-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 3.5rem;
}

.result-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
}

    .result-value.warning {
        color: #fbbf24;
    }

    .result-value.danger {
        color: #f87171;
    }

    .result-value.grid-export {
        color: #10b981;
    }

    .result-value.text-info {
        color: #60a5fa;
    }

    .result-value.text-success {
        color: #4ade80;
    }

    .result-value.text-warning {
        color: #fbbf24;
    }

    .result-value.muted {
        color: #555;
    }

.result-unit {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.7;
}

/* Live Status Cards */
.live-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.live-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 140px; /* Ensure consistent card height */
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.live-card:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

    .card-value.muted {
        color: #555;
    }

.unit-small {
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0.7;
}

.card-unit {
    font-size: 0.75rem;
    color: #888;
}

.card-detail {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.2;
    min-height: 1rem; /* Ensure consistent height even when text wraps */
    white-space: nowrap; /* Prevent wrapping on larger screens */
}

    .card-detail.charging {
        color: #22c55e; /* Green for charging */
    }

    .card-detail.discharging {
        color: #f59e0b; /* Amber for discharging */
    }

.card-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.live-card.solar .card-value {
    color: #fbbf24;
}

.live-card.load .card-value {
    color: #818cf8;
}

.live-card.battery .card-value {
    color: #4ade80;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.info-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1rem;
}

.info-header {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .info-header .weather-icon {
        font-size: 1rem;
    }

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    color: #ccc;
    font-size: 0.85rem;
}

    .info-row.highlight {
        color: #4ade80;
        font-weight: 500;
    }

        .info-row.highlight.positive .info-value {
            color: #22c55e; /* Green for surplus */
        }

        .info-row.highlight.negative .info-value {
            color: #ef4444; /* Red for deficit */
        }

.info-label {
    color: #888;
}

.info-value {
    font-weight: 500;
}

/* Today Card Redesign */
.today-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.today-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.75rem;
    margin-bottom: 0.5rem;
}

.today-title {
    font-size: 0.85rem;
    color: #888;
}

.today-weather-icon {
    font-size: 1.5rem;
}

.today-main {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    min-height: 2.5rem;
}

.today-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #4ade80;
    line-height: 1;
}

.today-unit {
    font-size: 0.9rem;
    color: #4ade80;
    opacity: 0.7;
}

.today-main.positive .today-value,
.today-main.positive .today-unit {
    color: #22c55e;
}

.today-main.negative .today-value,
.today-main.negative .today-unit {
    color: #ef4444;
}

.today-weather-text {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.today-details {
    flex: 1;
}

.today-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
    padding: 0.15rem 0;
}

    .today-detail-row.highlight {
        color: #4ade80;
    }

        .today-detail-row.highlight .today-detail-value {
            color: #4ade80;
        }

    .today-detail-row.positive .today-detail-value {
        color: #22c55e;
    }

    .today-detail-row.negative .today-detail-value {
        color: #ef4444;
    }

.today-label-inline {
    font-size: 0.75rem;
    color: #666;
    margin-left: 0.5rem;
}

/* Tomorrow Card */
.tomorrow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-summary {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #aaa;
}

    .weather-summary .weather-icon {
        font-size: 1rem;
    }

    .weather-summary .weather-text {
        font-size: 0.8rem;
    }

.tomorrow-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fbbf24;
    text-align: center;
}

.tomorrow-label {
    text-align: center;
    color: #666;
    font-size: 0.75rem;
}

/* Tomorrow Card as Forecast Link */
.forecast-link-card {
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

    .forecast-link-card:hover {
        border-color: #fbbf24;
        transform: translateY(-2px);
    }

/* Tomorrow Card Redesign */
.tomorrow-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.tomorrow-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.75rem;
    margin-bottom: 0.5rem;
}

.tomorrow-title {
    font-size: 0.85rem;
    color: #888;
}

.tomorrow-weather-icon {
    font-size: 1.5rem;
}

.tomorrow-main {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    min-height: 2.5rem;
}

.tomorrow-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1;
}

.tomorrow-unit {
    font-size: 0.9rem;
    color: #fbbf24;
    opacity: 0.7;
}

.tomorrow-label-inline {
    font-size: 0.75rem;
    color: #666;
    margin-left: 0.5rem;
}

.tomorrow-weather-text {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
    flex: 1;
}

.forecast-link-arrow {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    color: #60a5fa;
    font-size: 1.25rem;
    opacity: 0.4;
    transition: all 0.2s ease;
}

.forecast-link-card:hover .forecast-link-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Extended Forecast Card */
.extended-forecast-card {
    margin-top: 0.75rem;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1rem;
    min-height: 2rem;
}

.extended-forecast-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Compact forecast vertical */
.forecast-days-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forecast-day-compact {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s;
}

    .forecast-day-compact:hover {
        background: rgba(255, 255, 255, 0.03);
    }

.fdc-date {
    font-size: 0.9rem;
    color: #999;
}

.fdc-weather {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.fdc-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
}

.fdc-desc {
    font-size: 0.9rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fdc-kwh {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fbbf24;
    text-align: right;
    white-space: nowrap;
}

    .fdc-kwh::after {
        content: ' kWh';
        font-size: 0.7rem;
        font-weight: 400;
        opacity: 0.6;
    }

/* Responsive */
@media (max-width: 480px) {
    .surplus-value .big-number {
        font-size: 3rem;
    }

    .live-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .live-card {
        padding: 0.75rem;
        min-height: 120px;
    }

    .card-value {
        font-size: 1.25rem;
    }

    .card-detail {
        font-size: 0.65rem;
        white-space: normal; /* Allow wrapping on mobile */
        word-break: keep-all; /* Keep words together */
    }

    .info-cards {
        grid-template-columns: 1fr 1fr;
    }

    /* Fix collapse button position on mobile */
    .collapse-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 28px;
        height: 28px;
    }

    .surplus-card.collapsed .result-section {
        padding-right: 2rem; /* Space for collapse button when collapsed */
    }

    /* Ensure consistent result item height */
    .result-item {
        min-height: 3rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .result-label {
        font-size: 0.75rem;
        gap: 0.15rem; /* Reduce gap between text and help icon on mobile */
    }

    .help-icon.inline {
        width: 14px;
        height: 14px;
        margin-left: 0.2rem;
    }

        .help-icon.inline .help-text {
            font-size: 9px;
        }

    /* Larger touch target on mobile */
    .extra-slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }

    .extra-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }
}

/* iPhone Pro Max specific (430px wide) */
@media (max-width: 430px) {
    .card-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .card-detail {
        font-size: 0.6rem;
    }

    .card-label {
        font-size: 0.65rem;
        margin-top: 0.15rem;
    }

    /* Optimize Powerwall card for discharge/charging text */
    .live-card.battery .card-detail {
        font-size: 0.55rem;
        letter-spacing: -0.3px;
    }

    .today-value {
        font-size: 1.5rem;
    }

    /* Tomorrow card mobile optimization */
    .tomorrow-value {
        font-size: 1.5rem;
    }

    .tomorrow-unit {
        font-size: 0.85rem;
    }

    .tomorrow-weather-icon {
        font-size: 1.25rem;
    }
}
