:root {
    color-scheme: light;
    --ink: #17231f;
    --muted: #66736e;
    --line: #dfe7e3;
    --surface: #ffffff;
    --surface-soft: #f5f8f6;
    --green: #176b4d;
    --green-dark: #0d4f38;
    --green-soft: #e6f4ed;
    --sun: #f5b82e;
    --sun-soft: #fff3cf;
    --red: #b23a32;
    --red-soft: #fae9e7;
    --blue: #256a8a;
    --blue-soft: #e8f2f6;
    --shadow: 0 18px 55px rgba(24, 52, 42, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #eef3f0;
    color: var(--ink);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 2%, rgba(245, 184, 46, 0.14), transparent 27rem),
        radial-gradient(circle at 96% 11%, rgba(23, 107, 77, 0.12), transparent 30rem),
        #eef3f0;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    width: min(1480px, calc(100% - 40px));
    margin: 18px auto 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 24px rgba(30, 62, 50, 0.06);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--sun-soft);
    color: #b87800;
    font-size: 1.45rem;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    letter-spacing: -0.02em;
}

.brand small,
.header-note {
    color: var(--muted);
    font-size: 0.78rem;
}

.site-main {
    flex: 1;
    width: min(1480px, calc(100% - 40px));
    margin: 24px auto 48px;
}

.site-footer {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto 22px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted);
    font-size: 0.78rem;
}

.calculator-page {
    display: grid;
    gap: 20px;
}

.hero-panel,
.section-card,
.source-note,
.empty-state {
    border: 1px solid rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.hero-panel {
    min-height: 250px;
    padding: clamp(28px, 5vw, 58px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 34px;
    overflow: hidden;
    position: relative;
    border-radius: 30px;
    color: #fff;
    background:
        linear-gradient(110deg, rgba(10, 64, 45, 0.98), rgba(24, 112, 80, 0.92)),
        var(--green-dark);
}

.hero-panel::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -100px;
    top: -170px;
    border-radius: 50%;
    border: 70px solid rgba(245, 184, 46, 0.16);
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 8px;
    color: #ccf0df;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-panel h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.15rem, 5vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-copy {
    max-width: 680px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(0.95rem, 1.6vw, 1.12rem);
    line-height: 1.6;
}

.hero-actions {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.status-pill,
.mini-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill {
    min-height: 42px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(8px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
}

.button {
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.button-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 7px 18px rgba(23, 107, 77, 0.16);
}

.button-primary:hover:not(:disabled) {
    background: var(--green-dark);
}

.button-secondary {
    border-color: rgba(255, 255, 255, 0.28);
    background: #fff;
    color: var(--green-dark);
}

.button-quiet {
    border-color: rgba(255, 255, 255, 0.22);
    background: transparent;
    color: #fff;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    min-height: 142px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
}

.metric-card span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-card strong {
    margin: 10px 0 5px;
    font-size: clamp(1.6rem, 2.6vw, 2.35rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.metric-card small {
    font-size: 0.82rem;
}

.metric-card-status {
    border-color: transparent;
}

.metric-card-status.status-pass {
    background: var(--green-soft);
    color: var(--green-dark);
}

.metric-card-status.status-warning {
    background: var(--sun-soft);
    color: #8a5900;
}

.metric-card-status.status-fail {
    background: var(--red-soft);
    color: #872d27;
}

.metric-card-status.status-information {
    background: var(--blue-soft);
    color: #1c5873;
}

.section-card {
    padding: clamp(22px, 3vw, 38px);
    border-radius: 24px;
}

.section-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.section-heading-actions {
    align-items: center;
}

.section-number {
    margin: 0 0 5px;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.section-heading h2,
.source-note h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    letter-spacing: -0.035em;
}

.section-heading p:not(.section-number) {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

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

.form-grid-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
    display: grid;
    align-content: start;
    gap: 7px;
}

.field > span {
    color: #405049;
    font-size: 0.79rem;
    font-weight: 750;
}

.field-span-2 {
    grid-column: span 2;
}

input,
select {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid #ccd8d2;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(23, 107, 77, 0.1);
}

.input-with-unit {
    display: flex;
    align-items: stretch;
}

.input-with-unit input {
    border-radius: 11px 0 0 11px;
}

.input-with-unit > span {
    min-width: 48px;
    padding: 0 10px;
    display: grid;
    place-items: center;
    border: 1px solid #ccd8d2;
    border-left: 0;
    border-radius: 0 11px 11px 0;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.compact-input {
    min-width: 108px;
}

.inverter-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 2.2fr);
    gap: 28px;
    align-items: start;
}

.spec-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--line);
}

.spec-grid div {
    min-height: 82px;
    padding: 14px;
    background: var(--surface-soft);
}

.spec-grid dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.spec-grid dd {
    margin: 9px 0 0;
    font-weight: 800;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 15px;
}

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

.input-table {
    min-width: 980px;
}

.result-table {
    min-width: 960px;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-soft);
    color: #46544e;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

td {
    font-size: 0.84rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfdfc;
}

.input-table input,
.input-table select {
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 0.81rem;
}

.wide-column {
    min-width: 290px;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #e1c2bf;
    border-radius: 9px;
    background: #fff;
    color: var(--red);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.icon-button:hover {
    background: var(--red-soft);
}

.subheading {
    margin: 28px 0 12px;
    font-size: 1rem;
}

.mini-status {
    min-width: 76px;
    padding: 5px 9px;
    font-size: 0.7rem;
}

.mini-status.status-pass {
    background: var(--green-soft);
    color: var(--green-dark);
}

.mini-status.status-warning {
    background: var(--sun-soft);
    color: #845700;
}

.mini-status.status-fail {
    background: var(--red-soft);
    color: #922f29;
}

.mini-status.status-information {
    background: var(--blue-soft);
    color: var(--blue);
}

.row-check-list {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.check-details {
    overflow: hidden;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 13px;
    background: #fff;
}

.check-details.status-pass {
    border-left-color: var(--green);
}

.check-details.status-warning {
    border-left-color: var(--sun);
}

.check-details.status-fail {
    border-left-color: var(--red);
}

.check-details.status-information {
    border-left-color: var(--blue);
}

.check-details summary {
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.check-details summary::-webkit-details-marker {
    display: none;
}

.check-details ul {
    margin: 0;
    padding: 0 15px 15px;
    display: grid;
    gap: 9px;
    list-style: none;
}

.check-details li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #53615b;
    font-size: 0.8rem;
    line-height: 1.45;
}

.check-icon {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--blue);
}

.check-icon.status-pass {
    background: var(--green);
}

.check-icon.status-warning {
    background: var(--sun);
}

.check-icon.status-fail {
    background: var(--red);
}

.assessment-card {
    background: #fbfdfc;
}

.assessment-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.assessment-item {
    min-height: 104px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.assessment-symbol {
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 900;
}

.assessment-item.status-pass .assessment-symbol {
    background: var(--green-soft);
    color: var(--green-dark);
}

.assessment-item.status-warning .assessment-symbol {
    background: var(--sun-soft);
    color: #8a5900;
}

.assessment-item.status-fail .assessment-symbol {
    background: var(--red-soft);
    color: var(--red);
}

.assessment-item h3 {
    margin: 1px 0 6px;
    font-size: 0.9rem;
}

.assessment-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.48;
}

.source-note {
    padding: clamp(22px, 3vw, 34px);
    display: grid;
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
    gap: 35px;
    border-radius: 22px;
    background: #19352b;
    color: #fff;
}

.source-note .eyebrow {
    color: #86d7af;
}

.source-note ul {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    line-height: 1.5;
}

.empty-state {
    max-width: 720px;
    margin: 70px auto;
    padding: 50px;
    border-radius: 26px;
    text-align: center;
}

.empty-state .eyebrow {
    color: var(--green);
}

.empty-state h1 {
    margin: 0;
}

.empty-state p:not(.eyebrow) {
    margin: 12px 0 24px;
    color: var(--muted);
}

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

@media (max-width: 1100px) {
    .summary-grid,
    .form-grid-wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inverter-layout {
        grid-template-columns: 1fr;
    }

    .row-check-list,
    .assessment-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .site-header,
    .site-main,
    .site-footer {
        width: min(100% - 22px, 1480px);
    }

    .site-header {
        margin-top: 10px;
    }

    .header-note {
        display: none;
    }

    .site-main {
        margin-top: 12px;
    }

    .hero-panel {
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
        border-radius: 23px;
    }

    .hero-actions {
        min-width: 0;
    }

    .summary-grid,
    .form-grid,
    .form-grid-wide,
    .spec-grid,
    .source-note {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .section-heading,
    .section-heading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading .button {
        width: 100%;
    }

    .source-note {
        gap: 20px;
    }

    .site-footer {
        flex-direction: column;
        gap: 6px;
    }
}
