* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

.container {
    max-width: 950px;
    margin: 40px auto;
    padding: 35px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

header {
    text-align: center;
    margin-bottom: 35px;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
}

.subtitle {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.section,
.results-section,
.breakdown-section,
.tips-section {
    margin-bottom: 35px;
}

h2 {
    margin-bottom: 18px;
    font-size: 21px;
}

.helper-text {
    margin-top: -10px;
    margin-bottom: 20px;
    color: #777;
    font-size: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

label {
    font-weight: bold;
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 9px;
    font-size: 15px;
    background: white;
    outline: none;
}

input:focus,
select:focus {
    border-color: #777;
}

.money-input {
    display: flex;
    gap: 10px;
}

.money-input select {
    width: 125px;
}

.money-input input {
    flex: 1;
}

.expense-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.expense-card {
    padding: 18px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.expense-card label {
    display: block;
    margin-bottom: 10px;
}

.expense-card input + input {
    margin-top: 9px;
}

.buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 35px;
}

button {
    padding: 13px 22px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

.calculate-button {
    background: #222;
    color: white;
}

.reset {
    background: #e5e5e5;
    color: #222;
}

button:hover {
    opacity: 0.88;
}

.result {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.result-card {
    padding: 22px;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.result-card span {
    display: block;
    margin-bottom: 9px;
    color: #666;
    font-size: 14px;
}

.result-card strong {
    font-size: 23px;
}

.status {
    margin-top: 18px;
    padding: 17px;
    background: #f8f8f8;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.breakdown-item {
    margin-bottom: 18px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 14px;
}

.bar-background {
    width: 100%;
    height: 12px;
    background: #e9e9e9;
    border-radius: 20px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: #555;
    border-radius: 20px;
    transition: width 0.4s ease;
}

.empty-message {
    color: #777;
    font-size: 14px;
}

.tips-section {
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
}

.tips-section ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.tips-section li {
    margin-bottom: 9px;
    line-height: 1.5;
}

@media (max-width: 650px) {

    .container {
        margin: 15px;
        padding: 22px;
    }

    h1 {
        font-size: 26px;
    }

    .expense-grid,
    .result {
        grid-template-columns: 1fr;
    }

    .money-input {
        flex-direction: column;
    }

    .money-input select {
        width: 100%;
    }

    .buttons {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}