body {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    color: #2f4b3b;
    background: #f3faf5;
}

h1 {
    color: #2f7050;
    text-align: center;
}

body > p {
    text-align: center;
    line-height: 1.1;
}

.diary-card {
    padding: 24px;
    background: white;
    border: 1px solid #cee4d5;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(42, 94, 64, 0.08);
}

label {
    display: block;
    margin-top: 16px;
    font-weight: bold;
}

input, textarea, button {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 16px;
    border-radius: 10px;
}

input, textarea {
    border: 1px solid #b7d4c2;
}

textarea {
    min-height: 90px;
}

button {
    margin-top: 24px;
    border: 0;
    background: #3e805b;
    color: white;
    font-weight: bold;
}
.app-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 24px 0;
}

.app-nav button {
    margin: 0;
    padding: 12px 6px;
    background: #dcefe2;
    color: #2f4b3b;
}

.app-nav button.active {
    background: #3e805b;
    color: white;
}

.app-view[hidden] {
    display: none;
}
.entry-item {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f3faf5;
    border-left: 4px solid #67a77d;
    border-radius: 10px;
}

.entry-item h3 {
    margin: 0 0 4px;
    color: #2f7050;
    font-size: 18px;
}

.entry-item p {
    margin: 3px 0;
    line-height: 1.35;
    font-size: 15px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stats-grid p {
    margin: 0;
    padding: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.5;
    background: #e9f5ed;
    border-radius: 14px;
}
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 26px;
    }

    .diary-card {
        padding: 18px;
        border-radius: 14px;
    }

    .app-nav {
        gap: 6px;
        margin: 18px 0;
    }

    .app-nav button {
        padding: 11px 4px;
        font-size: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid p {
        min-height: 64px;
    }
}
.entry-item .delete-button {
    display: block;
    width: auto;
    min-height: 44px;
    margin: 14px 0 0 auto;
    padding: 10px 14px;
    background: #b94f5b;
    color: white;
    font-size: 15px;
    border-radius: 10px;
}
.entry-item .edit-button {
    display: inline-block;
    width: auto;
    min-height: 44px;
    margin: 14px 8px 0 0;
    padding: 8px 16px;
    font-size: 15px;
    background: #5f9b73;
    border-radius: 10px;
}
.entry-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.entry-item .edit-button,
.entry-item .delete-button {
    display: inline-block;
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 8px 14px;
}
#weight-change {
    background: #d8efdf;
    color: #245a3b;
    font-size: 22px;
    border: 2px solid #8cc6a0;
}
.weight-chart-card {
    margin-top: 18px;
    padding: 18px;
    background: #f3faf5;
    border: 1px solid #c7e2cf;
    border-radius: 14px;
}

.weight-chart-card h3 {
    margin: 0 0 16px;
    color: #2f7050;
}

#weight-chart {
    overflow-x: auto;
    color: #557562;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: max-content;
    min-height: 190px;
    padding: 8px 2px;
}

.chart-item {
    width: 64px;
    text-align: center;
    color: #2f7050;
}

.chart-value,
.chart-date {
    display: block;
    font-size: 13px;
}

.chart-bar {
    width: 36px;
    margin: 6px auto;
    background: #76b58b;
    border-radius: 8px 8px 3px 3px;
}
.chart-note {
    margin: 10px 0 0;
    color: #668071;
    font-size: 13px;
    line-height: 1.4;
}
#weight-change.weight-up {
    background: #f7ebdf;
    color: #765039;
    border-color: #d8b69a;
}
#photo-preview {
    display: block;
    max-width: 100%;
    max-height: 240px;
    margin-top: 12px;
    object-fit: contain;
    border-radius: 10px;
}

#photo-preview[hidden] {
    display: none;
}
.entry-photo {
    display: block;
    width: 120px;
    height: 90px;
    margin-top: 8px;
    object-fit: cover;
    border-radius: 8px;
}
#remove-photo {
    display: inline-block;
    width: auto;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 14px;
    background: #b94f5b;
    font-size: 14px;
}

#remove-photo[hidden] {
    display: none;
}