:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #222;
    --muted: #5f6b7a;
    --border: #dfe3e8;
    --primary: #2e7d32;
    --primary-hover: #256428;
    --warn-bg: #fff3cd;
    --warn-text: #856404;
    --ok-bg: #e8f7e8;
    --ok-text: #155724;
    --err-bg: #ffe8e8;
    --err-text: #8b1d1d;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
.container { max-width: 1000px; margin: auto; padding: 20px; }

.beta-banner {
    background: #fff7db;
    border-bottom: 1px solid #f0c36d;
    color: #6b4a00;
}
.beta-banner-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.78rem;
    line-height: 1.2;
}
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-beta { border-bottom-color: #f0c36d; }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-title { margin: 0; font-size: 1.15rem; }
.site-title a { color: inherit; text-decoration: none; }
.site-environment-label { margin: 4px 0 0; font-size: 0.8rem; color: #8a5a00; }
.site-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }
.nav-project-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.nav-project-label { font-weight: 600; color: var(--text); }
.nav-language { display: inline-flex; gap: 6px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-language form { display: inline; margin: 0; }
.nav-language .link-button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
/* Language flags (#405). The current language is shown at full strength
   with an underline; the other is a button, dimmed until hovered. */
.nav-language { align-items: center; }
.lang-flag { display: inline-flex; padding: 2px; border: 0; background: none; border-radius: 3px; cursor: pointer; line-height: 0; }
.lang-flag img { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
button.lang-flag img { opacity: 0.55; transition: opacity 0.15s; }
button.lang-flag:hover img, button.lang-flag:focus-visible img { opacity: 1; }
button.lang-flag:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.lang-flag-current { cursor: default; box-shadow: inset 0 -2px 0 var(--primary); padding-bottom: 4px; }
.site-brand { display: inline-flex; align-items: center; gap: 8px; }
.site-brand img { display: block; }

/* Header dropdown (#405). The list is positioned under the button and kept
   inside the viewport on narrow screens. */
.site-nav { align-items: center; }
.nav-menu { position: relative; }
.nav-menu-toggle { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-menu-toggle:hover { color: var(--primary-hover); text-decoration: underline; }
.nav-menu-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.nav-menu-toggle[aria-expanded="true"] .nav-menu-caret { transform: rotate(180deg); }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 100; list-style: none; margin: 0; padding: 6px 0; min-width: 12rem; max-width: calc(100vw - 2rem); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.nav-menu-list[hidden] { display: none; }
/* When the header wraps, the menu button starts its own line at the left
   edge, so the list opens rightwards from it instead. */
@media (max-width: 640px) { .nav-menu-list { left: 0; right: auto; } }
.nav-menu-list a { display: block; padding: 8px 14px; color: var(--text); text-decoration: none; }
.nav-menu-list a:hover { background: var(--bg); }
.nav-menu-list a[aria-current="page"] { font-weight: 600; color: var(--primary); }
.nav-menu-toggle:focus-visible, .nav-menu-list a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Help pages: readable line length. */
.info-page { max-width: 46rem; }
.faq-page details { margin: 0.75rem 0; padding: 0.75rem; border: 1px solid var(--border-color, #e0e0e0); border-radius: 6px; }
.faq-page summary { cursor: pointer; font-weight: 600; }
.faq-page details p:last-child { margin-bottom: 0; }
.info-page h3 { margin-top: 1.5rem; }
.info-page h4 { margin: 1rem 0 0.25rem; }
.info-page section { margin-top: 1.75rem; scroll-margin-top: 1rem; }
.info-page section > h3:first-child, .info-page .section-kicker + h3 { margin-top: 0.25rem; }
.guide-toc { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 3px solid var(--primary); background: var(--bg, #f6f8f6); }
.guide-toc h3 { margin-top: 0.25rem; }
.guide-toc ol, .guide-toc ul { margin: 0.25rem 0; }
.guide-terms dt { margin-top: 0.75rem; font-weight: 700; }
.guide-terms dd { margin: 0.15rem 0 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.card-emphasis { border-color: #cfe2d1; box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.08); }
.page-title { margin: 0 0 6px; font-size: 1.5rem; }
.subtitle { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.section-kicker { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; background: #eef6ef; color: var(--primary); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.subsection { margin-top: 0; padding-top: 0; border-top: none; }
.subsection + .subsection { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.subsection h4 { margin: 0 0 4px; font-size: 0.98rem; }
.status-panel { margin-bottom: 12px; }

.wizard-shell { margin-bottom: 16px; }
.wizard-header { display: grid; gap: 16px; }
.wizard-title { margin: 0 0 6px; }
.wizard-progress { display: grid; gap: 10px; }
.wizard-progress-step {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.wizard-progress-step.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.12);
}
.wizard-progress-index {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}
.wizard-progress-step.is-active .wizard-progress-index {
    background: var(--primary);
    color: #fff;
}
.wizard-panel[hidden] { display: none !important; }
.wizard-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.source-cards { display: grid; gap: 10px; }
.source-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 2px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s;
}
.source-card input[type="radio"] { display: none; }
.source-card:has(input:checked) {
    border-color: var(--primary);
    background: #f0faf0;
}
.source-card-icon {
    grid-row: 1 / -1;
    font-size: 1.5rem;
    align-self: center;
}
.source-card-title { font-weight: 600; font-size: 0.95rem; }
.source-card-desc { font-size: 0.82rem; }

.explore-year-filter {
    position: sticky;
    top: 8px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.explore-filter-label { font-size: 0.9rem; font-weight: 700; }
.explore-year-options { display: flex; gap: 6px; flex-wrap: wrap; }
.explore-year-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    cursor: pointer;
}
.explore-year-option:has(input:checked) {
    border-color: var(--primary);
    background: #f0faf0;
}
.explore-view-label { display: block; margin-bottom: 6px; font-weight: 600; }
.explore-view-controls {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    max-width: 420px;
}
.explore-view-controls select,
.explore-view-step {
    min-width: 0;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
}
.explore-view-controls select { width: 100%; padding: 8px; font: inherit; }
.explore-view-step { font-size: 1.5rem; cursor: pointer; }
.explore-view-step:disabled { opacity: 0.35; cursor: default; }
.explore-view-results { scroll-margin-top: 82px; }
.explore-mobile-help { display: none; }
.solar-earnings-table-wrap { overflow-x: auto; }
.solar-earnings-details { display: none; }
.solar-earnings-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 1rem; }

.source-options { display: none; }
.source-options.is-visible { display: block; }
.source-empty-hint { margin-top: 10px; font-style: italic; }

.feedback-inline { font-weight: 600; }
.feedback-inline.feedback-success { color: var(--primary); }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }

.stat-box {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}
.stat-label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--fg); }

.chart-wrap { position: relative; width: 100%; margin-bottom: 16px; height: 320px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
@media (min-width: 640px) { .chart-wrap { height: 400px; } }
.chart-wrap-heatmap { height: auto !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 0.85rem; flex-wrap: wrap; }
.chart-breadcrumb button { background: none; border: none; color: var(--primary); cursor: pointer; padding: 2px 4px; font-size: 0.85rem; text-decoration: underline; }
.chart-breadcrumb button:hover { opacity: 0.7; }
.chart-breadcrumb .sep { color: var(--muted); }
.chart-breadcrumb .current { color: var(--fg); font-weight: 600; }

.stepper { margin: 0 0 16px; }
.stepper-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stepper-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.stepper-link { display: flex; align-items: center; gap: 12px; padding: 12px; color: inherit; text-decoration: none; }
.stepper-index { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #eef2f7; color: var(--muted); font-size: 0.85rem; font-weight: 700; flex: 0 0 auto; }
.stepper-copy { display: flex; flex-direction: column; gap: 2px; }
.stepper-label { font-weight: 600; font-size: 0.95rem; }
.stepper-meta { color: var(--muted); font-size: 0.82rem; }
.stepper-item.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.12); }
.stepper-item.is-active .stepper-index { background: var(--primary); color: #fff; }
.stepper-item.is-future .stepper-link { cursor: default; }

.layout-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.form-group { margin-bottom: 8px; }
label { display: block; margin-bottom: 4px; font-size: 0.9rem; font-weight: 600; }
input[type="text"],
input[type="number"],
input[type="date"],
select { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.92rem; background: #fff; }
.radio-row label { display: flex; align-items: center; gap: 8px; font-weight: normal; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 0.88rem; margin: 0 0 6px; }
.links-row a { text-decoration: none; }
.actions-row { margin-top: 8px; }
.map-wrap { margin-top: 12px; }
#map { height: 360px; width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.feedback { padding: 10px; border-radius: 6px; margin-bottom: 12px; }
.feedback-success { background: var(--ok-bg); color: var(--ok-text); }
.feedback-error { background: var(--err-bg); color: var(--err-text); }
.feedback-warn { background: var(--warn-bg); color: var(--warn-text); }
.feedback-info { background: #e8f0fe; color: #1a56db; }

/* The feedback form (/feedback); not the .feedback alert boxes above. */
.feedback-form fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.feedback-form legend { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.feedback-form textarea,
.feedback-form input[type="email"] { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 0.92rem; background: #fff; }
.feedback-form textarea { resize: vertical; min-height: 8rem; }
/* Off-screen rather than display:none, which some bots know to skip. */
.feedback-form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.feedback-form-privacy { margin-top: 1rem; }

.optimize-primary-action { margin: 12px 0 18px; }
.optimize-primary-action .hint { margin-top: 8px; }
.optimize-validation-error { margin-top: 10px; }
.optimize-validation-error[hidden] { display: none; }
.optimize-advanced { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.optimize-advanced > summary { cursor: pointer; font-weight: 600; }
.optimize-advanced[open] > summary { margin-bottom: 14px; }
.optimize-advanced-action { margin-top: 12px; }

.hint { font-size: 0.82rem; color: var(--muted); margin: 2px 0 0; }
.next-steps { border-left: 3px solid var(--primary); padding: 10px 14px; margin: 12px 0; background: var(--bg); border-radius: 4px; }
.next-steps h4 { margin: 0 0 6px; font-size: 0.95rem; }
.next-steps ul { margin: 0; padding-left: 18px; }
.next-steps li { margin-bottom: 4px; font-size: 0.92rem; }

.btn { padding: 8px 16px; color: white; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary { background-color: #4CAF50; }
.btn-primary:hover { background-color: #45a049; }
.btn-secondary { background-color: #666; }
.btn-secondary:hover { background-color: #555; }
.btn-danger { background-color: #c0392b; }
.btn-danger:hover { background-color: #962d22; }
.btn-sm { padding: 6px 14px; font-size: 0.9rem; }

.price-period-editor { margin: 8px 0 12px; }
.price-period-editor h5 { margin: 0 0 2px; }
.price-period-editor > .hint { margin-bottom: 6px; }
.price-period-header { display: none; }
.price-period-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.price-period-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}
.price-period-row input,
.price-period-row select { padding: 5px 7px; font-size: 0.85rem; }
.price-period-remove { display: flex; align-items: flex-end; justify-content: flex-end; }
.remove-price-period {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #b3261e;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
#addPricePeriod { margin-top: 7px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; }
.input-readonly { background: #f0f0f0; color: #666; border-color: #ddd; }

.info-card { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 16px; font-size: 0.9rem; }
.info-row { display: flex; gap: 8px; margin-bottom: 4px; }
.info-row:last-child { margin-bottom: 0; }
.info-label { font-weight: 600; min-width: 140px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; }
th { background-color: #f5f5f5; }

.coverage-grid { display: grid; gap: 10px; margin: 16px 0; }
.coverage-card { padding: 12px; border: 1px solid var(--border); border-left-width: 5px; border-radius: 8px; }
.coverage-card-success { border-left-color: var(--primary); background: #f6fbf6; }
.coverage-card-warn { border-left-color: #b7791f; background: #fffbeb; }
.coverage-card-error { border-left-color: #c0392b; background: #fff7f7; }
.coverage-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.coverage-card-heading h3 { margin: 0; font-size: 1rem; }
.coverage-status { padding: 3px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.coverage-status-success { background: var(--ok-bg); color: var(--ok-text); }
.coverage-status-warn { background: var(--warn-bg); color: var(--warn-text); }
.coverage-status-error { background: var(--err-bg); color: var(--err-text); }
.coverage-facts { display: grid; gap: 6px; margin: 10px 0 0; }
.coverage-facts div { display: flex; justify-content: space-between; gap: 12px; }
.coverage-facts dt { color: var(--muted); font-weight: 600; }
.coverage-facts dd { margin: 0; text-align: right; }
.coverage-gaps { margin-top: 10px; }
.coverage-gap-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 4px 12px;
    max-height: 280px;
    overflow-y: auto;
    margin: 8px 0 0;
    padding-left: 20px;
}

/* Surface editor table — see _step4_pv.html.  Default desktop rules;
   tablet/mobile overrides live in the media queries below. */
.surface-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 6px; }
.surface-table th, .surface-table td { border: none; padding: 3px 5px; }
.surface-table thead tr { text-align: left; border-bottom: 2px solid #dee2e6; }
.surface-table col.col-name { width: 26%; }
.surface-table col.col-tilt { width: 15%; }
.surface-table col.col-az   { width: 22%; }
.surface-table col.col-kwp  { width: 18%; }
.surface-table col.col-ops  { width: 19%; }
.surface-table input[type="text"],
.surface-table input[type="number"] { padding: 5px 7px; font-size: 0.88rem; }
.surface-table .cell-inline { display: flex; align-items: center; gap: 4px; }
.surface-table .cell-inline input { width: 100%; }
.surface-table .btn-icon {
    font-size: 0.95rem; background: none; border: 1px solid #ccc;
    border-radius: 4px; cursor: pointer; padding: 4px 8px; line-height: 1;
    flex: 0 0 auto; min-width: 32px; min-height: 32px;
}
.surface-table .btn-remove-surface {
    background: none; border: none; cursor: pointer; font-size: 1.05rem; color: #c00;
}
.surface-detail-row summary {
    font-size: 0.8rem; color: var(--muted); cursor: pointer; padding: 2px 0; list-style: revert;
}
.surface-detail-row .surface-detail-grid {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: 0.82rem; color: #555; padding: 4px 0 2px;
}
.surface-detail-row select { padding: 2px 4px; font-size: 0.82rem; width: auto; }
.surface-detail-row input[type="number"] { font-size: 0.82rem; padding: 3px 4px; }

@media (min-width: 600px) and (max-width: 899px) {
    .wizard-progress {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 4px;
    }
    .wizard-progress-step {
        flex: 0 0 auto;
        min-width: 100px;
        padding: 8px 10px;
    }
    /* Compact PV surface editor: shrink font.  Tilt/compass assistant
       buttons stay visible — they're more useful on touch than on a
       precision pointer. */
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .surface-table { font-size: 0.82rem; }
    .surface-table th, .surface-table td { padding: 2px 4px; }
}

@media (min-width: 900px) {
    .layout-grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .price-period-header,
    .price-period-row {
        grid-template-columns: 1fr 1fr 0.85fr 0.9fr 30px;
    }
    .price-period-header {
        display: grid;
        gap: 8px;
        padding: 3px 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 600;
    }
    .price-period-row { align-items: center; padding: 5px 0; }
    .price-period-cell::before { display: none; }
    .price-period-remove { align-items: center; }
    .stepper-list { grid-template-columns: repeat(6, 1fr); }
    .stepper-link { min-height: 78px; }
    .wizard-header { grid-template-columns: 1.2fr 1fr; align-items: start; }
    .wizard-progress { grid-template-columns: repeat(6, 1fr); }
    .source-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .container { padding: 12px; }
    .btn { width: 100%; margin-bottom: 8px; }
}

@media (max-width: 599px) {
    .wizard-progress {
        display: flex;
        gap: 4px;
        justify-content: center;
        flex-wrap: wrap;
        max-width: 100%;
    }
    .wizard-progress-step {
        flex: 0 0 auto;
        width: auto;
        padding: 4px;
        justify-content: center;
        min-width: 0;
    }
    .wizard-progress-step span:not(.wizard-progress-index) {
        display: none;
    }
    .wizard-progress-index {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    #map { height: 220px; }
    .form-row { flex-wrap: wrap; }
    .source-cards { grid-template-columns: 1fr; }

    .explore-year-filter {
        top: 4px;
        align-items: flex-start;
        padding: 8px;
        margin-inline: -4px;
    }
    .explore-filter-label { width: 100%; }
    .explore-year-options {
        flex-wrap: wrap;
        max-width: 100%;
        padding-bottom: 2px;
    }
    .explore-year-option { flex: 0 0 auto; }
    .explore-view-picker { margin-bottom: 4px; }
    .explore-view-results .subsection { padding-inline: 0; }
    .explore-secondary-text { display: none; }
    .explore-mobile-help {
        display: block;
        margin: 6px 0 10px;
        color: var(--muted);
        font-size: 0.82rem;
    }
    .explore-mobile-help summary {
        width: fit-content;
        color: var(--primary);
        cursor: pointer;
        font-weight: 600;
    }
    .explore-mobile-help p { margin: 6px 0 0; }
    .explore-view-results .subsection > p.muted { display: none; }
    .explore-view-results .subsection > details p.muted { display: block; }

    .solar-earnings-details { display: inline-flex; gap: 6px; margin-bottom: 8px; }
    .solar-earnings-table { font-size: 0.75rem; }
    .solar-earnings-table th,
    .solar-earnings-table td { padding: 6px 3px !important; }
    .solar-earnings-table th { overflow-wrap: anywhere; }
    .solar-earnings-table td { white-space: nowrap; }
    .solar-earnings-table-wrap:not(:has(.solar-earnings-details input:checked)) .solar-detail-column {
        display: none;
    }

    .coverage-gap-list { grid-template-columns: 1fr 1fr; }

    /* Surface editor: stack each row as a card with inline labels. */
    .surface-table,
    .surface-table thead,
    .surface-table tbody,
    .surface-table tfoot,
    .surface-table tr,
    .surface-table td,
    .surface-table th { display: block; width: 100%; }
    .surface-table thead { display: none; }
    .surface-table colgroup { display: none; }
    .surface-table tr.surface-row {
        border: 1px solid var(--border); border-radius: 8px;
        padding: 8px; margin-bottom: 8px; background: #fafbfc;
    }
    .surface-table tr.surface-row td { padding: 4px 0; border: none; }
    .surface-table tr.surface-row td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--muted);
        margin-bottom: 2px;
    }
    .surface-table tr.surface-row td.cell-ops {
        text-align: right;
        position: absolute;
        top: 4px; right: 6px;
        width: auto;
    }
    .surface-table tr.surface-row { position: relative; }
    .surface-table tr.surface-row td.cell-ops::before { display: none; }
    .surface-table .cell-inline { display: flex; gap: 6px; }
    .surface-table .cell-inline input { flex: 1 1 auto; min-width: 0; }
    .surface-table tr.surface-details {
        border: 1px solid var(--border); border-top: none;
        border-radius: 0 0 8px 8px;
        margin-top: -9px; margin-bottom: 8px;
        padding: 6px 8px; background: #fff;
    }
    .surface-table tfoot tr {
        display: flex; justify-content: space-between; align-items: center;
        padding: 4px 0;
    }
    .surface-table tfoot td { display: inline; padding: 0; border: none; }
}

/* Loading overlay (moved from inline style in index.html) */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.loading-overlay.active { display: flex; }
.loading-card {
    max-width: 32rem;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 999px;
    animation: spin 0.9s linear infinite;
    margin-bottom: 1rem;
}
.loading-bar {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.75rem 0;
}
.loading-bar-fill {
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    animation: loading-slide 1.4s ease-in-out infinite;
}
.nudge-warn {
    font-size: 0.85rem;
    color: var(--warn-text);
    background: var(--warn-bg);
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 6px;
    display: none;
}
.nudge-warn.is-visible { display: block; }

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
}
.btn-pulse { animation: btn-pulse 1.5s ease-in-out 3; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* Step 3 support scheme view */
.support-scheme-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 520px; margin: 0.5rem 0; }
.support-scheme-table th, .support-scheme-table td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--border); vertical-align: top; }
.support-scheme-table th:first-child { text-align: left; }
.support-scheme-table thead th { border-bottom: 2px solid var(--border); font-weight: 600; }
.support-scheme-table .muted, .support-scheme-diff { display: block; font-size: 0.8rem; font-weight: normal; }
