#pvcalc-total-chart,
#pvcalc-total-chart * {
    box-sizing: border-box;
}

.pvcalc-shell {
    --pv-text: #0f172a;
    --pv-muted: #64748b;
    --pv-border: #e2e8f0;
    --pv-soft: #f8fafc;
    --pv-green: #16a34a;
    --pv-green-dark: #15803d;
    --pv-green-soft: #ecfdf5;
    --pv-blue-soft: #eff6ff;
    width: 100%;
    max-width: 1050px;
    margin: 28px auto;
    color: var(--pv-text);
    font-family: inherit;
}

.pvcalc-heading-row,
.pvcalc-installation-head,
.pvcalc-section-head,
.pvcalc-history-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.pvcalc-title {
    margin: 0 0 7px;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.15;
    color: var(--pv-text);
}

.pvcalc-subtitle {
    margin: 0;
    color: var(--pv-muted);
    font-size: 15px;
}

.pvcalc-source-badge {
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: var(--pv-green-soft);
    color: var(--pv-green-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.pvcalc-selector-wrap {
    margin: 27px 0;
    padding: 20px;
    border: 1px solid var(--pv-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.pvcalc-selector-wrap label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
}

.pvcalc-select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--pv-text);
    font-size: 16px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.pvcalc-select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.pvcalc-empty,
.pvcalc-loading,
.pvcalc-error {
    min-height: 220px;
    padding: 36px;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    background: var(--pv-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: var(--pv-muted);
}

.pvcalc-empty strong,
.pvcalc-loading strong,
.pvcalc-error strong {
    color: var(--pv-text);
    font-size: 18px;
}

.pvcalc-empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fef9c3;
    font-size: 27px;
    margin-bottom: 6px;
}

.pvcalc-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dcfce7;
    border-top-color: var(--pv-green);
    border-radius: 50%;
    animation: pvcalc-spin .8s linear infinite;
    margin-bottom: 8px;
}

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

.pvcalc-error {
    border-color: #fecaca;
    background: #fef2f2;
}

.pvcalc-result {
    display: grid;
    gap: 22px;
}

.pvcalc-installation-head {
    padding: 22px 24px;
    border: 1px solid var(--pv-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.pvcalc-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--pv-green-dark);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.pvcalc-installation-head h3,
.pvcalc-section-head h3 {
    margin: 0;
    color: var(--pv-text);
}

.pvcalc-installation-head h3 { font-size: 24px; }
.pvcalc-section-head h3 { font-size: 22px; }

.pvcalc-update {
    color: var(--pv-muted);
    font-size: 12px;
    white-space: nowrap;
}

.pvcalc-current-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pvcalc-metric-card {
    min-height: 122px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--pv-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05);
}

.pvcalc-metric-card--accent {
    border-color: #bbf7d0;
    background: linear-gradient(135deg, #fff 20%, #f0fdf4 100%);
}

.pvcalc-metric-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--pv-blue-soft);
    font-size: 23px;
}

.pvcalc-metric-card--accent .pvcalc-metric-icon {
    background: #dcfce7;
}

.pvcalc-metric-label,
.pvcalc-metric-card small {
    display: block;
    color: var(--pv-muted);
}

.pvcalc-metric-label {
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 700;
}

.pvcalc-metric-card strong {
    display: block;
    margin-bottom: 2px;
    color: var(--pv-text);
    font-size: clamp(22px, 3vw, 30px);
}

.pvcalc-metric-card small { font-size: 12px; }

.pvcalc-history-section {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--pv-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

.pvcalc-total-pill {
    min-width: 170px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--pv-green-soft);
    text-align: right;
}

.pvcalc-total-pill span {
    display: block;
    color: var(--pv-green-dark);
    font-size: 11px;
    font-weight: 700;
}

.pvcalc-total-pill strong {
    display: block;
    color: #166534;
    font-size: 22px;
}

.pvcalc-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 16px;
}

.pvcalc-month-card {
    padding: 15px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}

.pvcalc-month-card span {
    display: block;
    margin-bottom: 4px;
    color: var(--pv-muted);
    font-size: 12px;
}

.pvcalc-month-card strong {
    color: var(--pv-text);
    font-size: 18px;
}

.pvcalc-chart-wrap {
    width: 100%;
    margin-top: 10px;
    padding: 14px 6px 0;
    overflow-x: auto;
}

.pvcalc-chart {
    display: block;
    width: 100%;
    min-width: 610px;
    height: auto;
    overflow: visible;
}

.pvcalc-grid-line {
    stroke: #e5e7eb;
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

.pvcalc-axis-label,
.pvcalc-unit-label {
    fill: #94a3b8;
    font-size: 11px;
}

.pvcalc-bar {
    fill: url(#pvcalcBarGradient);
    filter: url(#pvcalcShadow);
    transition: opacity .2s ease;
}

.pvcalc-bar-group:hover .pvcalc-bar { opacity: .82; }

.pvcalc-value-label {
    fill: #166534;
    font-size: 14px;
    font-weight: 800;
}

.pvcalc-month-label {
    fill: #475569;
    font-size: 12px;
    font-weight: 700;
}

.pvcalc-history-footer {
    margin-top: 2px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
    align-items: flex-start;
}

.pvcalc-history-footer > div {
    flex: 0 0 auto;
    min-width: 145px;
}

.pvcalc-history-footer span {
    display: block;
    color: var(--pv-muted);
    font-size: 12px;
}

.pvcalc-history-footer strong {
    display: block;
    margin-top: 2px;
    color: var(--pv-text);
    font-size: 18px;
}

.pvcalc-history-footer p {
    max-width: 650px;
    margin: 0;
    color: var(--pv-muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 720px) {
    .pvcalc-shell { margin: 18px auto; }

    .pvcalc-heading-row,
    .pvcalc-installation-head,
    .pvcalc-section-head,
    .pvcalc-history-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .pvcalc-source-badge { align-self: flex-start; }

    .pvcalc-current-grid,
    .pvcalc-month-grid {
        grid-template-columns: 1fr;
    }

    .pvcalc-total-pill {
        width: 100%;
        text-align: left;
    }

    .pvcalc-update { white-space: normal; }

    .pvcalc-selector-wrap,
    .pvcalc-history-section,
    .pvcalc-installation-head,
    .pvcalc-metric-card {
        border-radius: 16px;
    }
}

.pvcalc-site-code{
    display:block;
    margin-top:4px;
    color:#64748b;
    font-size:12px;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
}
