:root {
    --bg: #fff8fb;
    --panel: #ffffff;
    --ink: #30242a;
    --muted: #756872;
    --pink: #f7c6d9;
    --rose: #e98ab2;
    --mint: #a7dcc9;
    --butter: #ffe7a8;
    --line: #f0dce5;
    --danger: #b9475c;
    --shadow: 0 16px 36px rgba(87, 52, 68, 0.13);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(247, 198, 217, 0.6), rgba(255, 248, 251, 0.95) 280px),
        var(--bg);
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    width: min(100%, 620px);
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.hero {
    padding: 18px 0 8px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #8f4b68;
    font-size: 0.9rem;
    font-weight: 700;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 20px;
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.status-panel,
.detail-box,
.card-form,
.chart-panel,
.empty-state,
.entry-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.status-panel {
    padding: 18px;
}

.status-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.status-panel strong {
    display: block;
    font-size: clamp(1.35rem, 7vw, 2.1rem);
    line-height: 1.12;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
}

.quick-actions form {
    margin: 0;
}

.primary-action,
.primary-submit,
.secondary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 82px;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(84, 54, 68, 0.16);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.primary-action.food {
    background: var(--pink);
}

.primary-action.weight {
    background: var(--mint);
}

.primary-submit,
.secondary-action {
    min-height: 58px;
    background: var(--rose);
    color: #ffffff;
    font-size: 1rem;
}

.secondary-action {
    background: #7b5d6a;
}

.detail-box {
    margin: 18px 0;
    padding: 4px 16px 16px;
}

.detail-box summary {
    padding: 14px 0;
    color: #6b4b58;
    font-weight: 700;
    cursor: pointer;
}

.stack-form,
.card-form {
    display: grid;
    gap: 14px;
}

.card-form {
    padding: 18px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.93rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #e5cbd6;
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--ink);
    background: #fff;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

.bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.bottom-nav a,
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #5f4450;
    font-weight: 800;
}

.page-header {
    display: grid;
    gap: 18px;
    padding: 12px 0 18px;
}

.page-header h1 {
    margin: 0;
}

.back-link {
    width: fit-content;
    min-width: 108px;
    padding: 0 16px;
}

.empty-state {
    padding: 22px;
    color: var(--muted);
}

.entry-list {
    display: grid;
    gap: 12px;
}

.entry-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
}

.entry-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.08rem;
}

.entry-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.entry-card .note {
    margin-top: 8px;
    color: #4a3a42;
}

.delete-button {
    min-height: 40px;
    border: 1px solid rgba(185, 71, 92, 0.28);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff1f4;
    color: var(--danger);
    font-weight: 800;
    cursor: pointer;
}

.chart-panel {
    margin-bottom: 14px;
    padding: 16px;
}

.chart-panel svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-panel line {
    stroke: #ead5df;
    stroke-width: 2;
}

.chart-panel polyline {
    fill: none;
    stroke: #e36f9d;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 680px) {
    .app-shell {
        padding-top: 34px;
    }

    h1 {
        font-size: 2.35rem;
    }
}
