* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    background: #ffffff;
    color: #1f1f1f;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

button,
input,
select {
    font: inherit;
}

.tool-container {
    width: 100%;
    max-width: 760px;
    margin: 0;
}

.tool-header {
    padding-bottom: 24px;
    border-bottom: 2px solid #1f1f1f;
}

.tool-header h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
}

.tool-header p {
    max-width: 650px;
    margin: 0;
    color: #505050;
}

.calculator-section,
.results-section,
.info-section {
    padding: 28px 0;
    border-bottom: 2px solid #1f1f1f;
}

.info-section {
    border-bottom: 0;
}

h2 {
    margin: 0 0 18px;
    font-size: 1.35rem;
    line-height: 1.3;
}

.subheading {
    margin-top: 32px;
}

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

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    margin-bottom: 6px;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #999999;
    border-radius: 4px;
    background: #ffffff;
    color: #1f1f1f;
}

.field input:focus,
.field select:focus {
    border-color: #1f1f1f;
    outline: 2px solid #cfcfcf;
    outline-offset: 1px;
}

.field-note {
    margin: 12px 0 0;
    color: #5a5a5a;
    font-size: 0.92rem;
}

button {
    min-height: 46px;
    padding: 10px 18px;
    border: 2px solid #1f1f1f;
    border-radius: 4px;
    background: #1f1f1f;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #3a3a3a;
}

button:focus {
    outline: 3px solid #bdbdbd;
    outline-offset: 2px;
}

#addRoomButton {
    margin-top: 20px;
}

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

.secondary-button {
    background: #ffffff;
    color: #1f1f1f;
}

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

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

.room-list-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #b7b7b7;
}

.room-list-section h2 {
    margin-bottom: 12px;
}

.room-list {
    border-top: 1px solid #b7b7b7;
}

.empty-message {
    margin: 0;
    padding: 16px 0;
    color: #666666;
}

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #b7b7b7;
}

.room-information {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.room-information strong {
    font-size: 1rem;
}

.room-information span {
    color: #555555;
    font-size: 0.92rem;
}

.room-information .room-area {
    color: #1f1f1f;
    font-weight: 700;
}

.remove-room-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid #767676;
    background: #ffffff;
    color: #1f1f1f;
    font-size: 0.88rem;
}

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

.results {
    border-top: 2px solid #1f1f1f;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 13px 0;
    border-bottom: 1px solid #b7b7b7;
}

.result-row span {
    color: #444444;
}

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

.total-row {
    border-bottom: 2px solid #1f1f1f;
    font-size: 1.08rem;
}

.result-note {
    margin: 16px 0 0;
    color: #555555;
    font-size: 0.92rem;
}

.info-section h2 {
    margin-top: 30px;
}

.info-section h2:first-child {
    margin-top: 0;
}

.info-section p {
    margin: 0 0 16px;
}

.formula {
    margin: 20px 0;
    padding: 16px;
    border-left: 4px solid #1f1f1f;
    background: #f2f2f2;
    font-weight: 700;
}

@media (max-width: 600px) {
    body {
        padding: 18px;
    }

    .tool-header h1 {
        font-size: 1.7rem;
    }

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

    .button-row {
        flex-direction: column;
    }

    .button-row button {
        width: 100%;
    }

    .room-item {
        align-items: flex-start;
    }

    .result-row {
        align-items: flex-start;
    }

    .result-row strong {
        max-width: 50%;
    }
}