*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f5f5f0;
    --color-surface: #ffffff;
    --color-primary: #2d6a4f;
    --color-primary-hover: #1b4332;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-border: #e5e5e5;
    --color-breakfast: #f59e0b;
    --color-lunch: #10b981;
    --color-dinner: #6366f1;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100dvh;
    padding: 1rem;
}

header {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

main {
    max-width: 480px;
    margin: 0 auto;
}

/* Meal slots */
.meal-plan {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.meal-slot {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    border-left: 4px solid var(--color-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.meal-slot:active {
    transform: scale(0.98);
}

.meal-slot[data-meal="breakfast"] { border-left-color: var(--color-breakfast); }
.meal-slot[data-meal="lunch"] { border-left-color: var(--color-lunch); }
.meal-slot[data-meal="dinner"] { border-left-color: var(--color-dinner); }

.meal-slot h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.selected-meal {
    font-size: 1.1rem;
    font-weight: 500;
}

.placeholder {
    color: var(--color-text-muted);
    font-style: italic;
    font-weight: 400;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

/* Picker modal */
.meal-picker {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.meal-picker.hidden {
    display: none;
}

.picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.picker-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 70dvh;
    display: flex;
    flex-direction: column;
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.picker-header h2 {
    font-size: 1.1rem;
}

.picker-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    line-height: 1;
}

.picker-list {
    overflow-y: auto;
    padding: 0.5rem 0;
}

.picker-item {
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.1s ease;
}

.picker-item:hover {
    background: var(--color-bg);
}

/* Desktop */
@media (min-width: 600px) {
    body {
        padding: 2rem;
    }

    header {
        padding: 2rem 0 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .picker-content {
        border-radius: var(--radius);
        max-height: 60vh;
        margin-bottom: 2rem;
    }

    .picker-backdrop {
        backdrop-filter: blur(2px);
    }
}
