.input-error {
    border: 2px solid #d32f2f !important;
    background: #fff5f5;
}

.page {
    width: 100%;
    padding: 24px;
}

.page-title {
    margin-bottom: 24px;
    color: #1976d2;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(420px, 7fr);
    gap: 24px;
    align-items: flex-start;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.result-column {
    position: sticky;
    top: 24px;
    min-width: 0;
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* .card h2 {
    margin-top: 0;
    color: #1976d2;
} */

.field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
}

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

.field label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

input,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    height: 40px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15);
}

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

button {
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #1976d2;
    color: white;
}

.button-row button:hover {
    background: #125aa0;
}

button.secondary {
    background: #1d9e75;
}

button.secondary:hover {
    background: #14795a;
}

#statusBox {
    margin-bottom: 12px;
    font-weight: 600;
    color: #444;
}

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

.result-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.result-table td:nth-child(2) {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.result-table td:nth-child(3) {
    font-weight: 700;
    width: 60px;
}

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .result-column {
        position: relative;
        top: auto;
    }

    .field-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 650px) {
    .page {
        padding: 12px;
    }

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

.op-mode-block {
    margin-top: 18px;
}

.op-mode-block h3 {
    margin: 16px 0 12px;
    color: #555;
}

.op-point-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
}

hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 18px 0;
}

.dhw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.dhw-card-header h2 {
    margin: 0;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 48px;
    color: #666;
    font-size: 14px;
}

.switch {
    gap: 48px;
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    display: none;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e24b4a;
    border-radius: 999px;
    transition: 0.2s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .switch-slider {
    background: #1d9e75;
}

.switch input:checked + .switch-slider::before {
    transform: translateX(24px);
}

.switch-state {
    min-width: 38px;
    font-weight: 700;
}

.switch-state.yes {
    color: #0f6e56;
}

.switch-state.no {
    color: #791f1f;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 42px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #333;
}

.radio-option input {
    width: auto;
}

.accordion-card .accordion-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-card .accordion-header::after {
    content: "⌄";
    font-size: 20px;
    font-weight: bold;
}

.accordion-card.collapsed .accordion-header::after {
    content: "›";
}

.accordion-card.collapsed .accordion-content {
    display: none;
}

.warning-text {
    color: #b71c1c;
    background: #ffebee;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #606166;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}  

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 220px;
    max-width: 300px;
    background: #111827;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}