/* ===== GENERATOR APPLIANCE LOAD BUILDER ===== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #222222;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

.tool-container {
    max-width: 760px;
    margin: 0;
    padding: 20px;
}

.tool-header h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.tool-header p {
    margin: 0;
    color: #555555;
}

.calculator-section,
.results-section,
.info-section {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 2px solid #333333;
}

h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.subheading {
    margin-top: 28px;
}

.info-section h2:not(:first-child) {
    margin-top: 28px;
}

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

.planning-grid {
    margin-top: 0;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-weight: 600;
}

input,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #aaaaaa;
    border-radius: 4px;
    background: #ffffff;
    color: #222222;
    font-size: 16px;
}

input:focus,
select:focus {
    outline: 2px solid #555555;
    outline-offset: 1px;
}

.field-note {
    margin: 12px 0 0;
    color: #666666;
    font-size: 14px;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.primary-button,
.secondary-button {
    padding: 11px 18px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    margin-top: 20px;
    border: 0;
    background: #222222;
    color: #ffffff;
}

.button-row .primary-button {
    margin-top: 0;
}

.primary-button:hover {
    background: #444444;
}

.secondary-button {
    border: 2px solid #333333;
    background: #ffffff;
    color: #222222;
}

.secondary-button:hover {
    background: #eeeeee;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.remove-button:focus-visible {
    outline: 3px solid #777777;
    outline-offset: 3px;
}

.error-message {
    min-height: 24px;
    margin: 10px 0 0;
    color: #a00000;
    font-weight: 600;
}

.appliance-list {
    border: 1px solid #cccccc;
    border-radius: 4px;
}

#emptyListMessage {
    margin: 0;
    padding: 14px;
    color: #666666;
}

.table-wrapper {
    overflow-x: auto;
}

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

.appliance-table th,
.appliance-table td {
    padding: 10px;
    border-bottom: 1px solid #dddddd;
    text-align: left;
    white-space: nowrap;
}

.appliance-table th {
    background: #f3f3f3;
    font-size: 14px;
}

.appliance-table tr:last-child td {
    border-bottom: 0;
}

.remove-button {
    padding: 6px 9px;
    border: 1px solid #777777;
    border-radius: 4px;
    background: #ffffff;
    color: #222222;
    font-size: 14px;
    cursor: pointer;
}

.remove-button:hover {
    background: #eeeeee;
}

.results {
    border: 1px solid #cccccc;
    border-radius: 4px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 14px;
    border-bottom: 1px solid #dddddd;
}

.result-row:last-child {
    border-bottom: 0;
}

.result-row strong {
    text-align: right;
}

.recommendation-row {
    background: #f3f3f3;
}

.result-note {
    margin-bottom: 0;
    color: #666666;
    font-size: 14px;
}

.info-section p {
    color: #444444;
}

.formula {
    margin-top: 16px;
    padding: 12px;
    border-left: 4px solid #333333;
    background: #f3f3f3;
    font-weight: 700;
}

@media (max-width: 650px) {

    .tool-container {
        padding: 14px;
    }

    .tool-header h1 {
        font-size: 26px;
    }

    .input-grid {
        grid-template-columns: 1fr;
    }

    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .result-row {
        flex-direction: column;
        gap: 3px;
    }

    .result-row strong {
        text-align: left;
    }
}