/* Meal Planner — mobile-first iPhone web app */
:root {
    --green: #2e7d4f;
    --green-dark: #236139;
    --ink: #1c1c1e;
    --muted: #6b6f76;
    --bg: #f6f7f6;
    --card: #ffffff;
    --line: #e5e7e5;
    --warn: #b3541e;
    --nav-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--green); }
img { display: block; max-width: 100%; }

.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--green); color: #fff;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.who { font-size: .85rem; opacity: .9; }

main {
    max-width: 680px; margin: 0 auto;
    padding: 12px 12px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
}
h2 { font-size: 1.15rem; margin: 18px 4px 8px; }
h3 { margin: 18px 0 6px; }

.flash {
    background: #e7f4ec; border: 1px solid #bfe3cd; color: var(--green-dark);
    padding: 10px 12px; border-radius: 10px; margin: 8px 0;
}
.error {
    background: #fdecea; border: 1px solid #f5c6c0; color: #a33;
    padding: 10px 12px; border-radius: 10px;
}
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.hint { color: var(--muted); font-size: .85rem; }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; display: flex; flex-direction: column;
}
.card-photo { position: relative; display: block; aspect-ratio: 16/10; background: #dfe5df; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--green), #79b98a);
}
.badge {
    position: absolute; left: 8px; bottom: 8px;
    background: rgba(20, 40, 28, .82); color: #fff;
    font-size: .72rem; padding: 4px 8px; border-radius: 999px;
}
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; }
.meta { margin: 0; color: var(--muted); font-size: .85rem; }
.status { margin: 0; font-size: .85rem; font-weight: 600; }
.status.ok { color: var(--green-dark); }
.status.pending { color: var(--muted); }
.status.warn { color: var(--warn); }
.pickform { margin-top: 2px; }

.btn {
    appearance: none; border: 0; border-radius: 12px;
    background: var(--green); color: #fff;
    font-size: 1rem; font-weight: 700;
    padding: 12px 16px; min-height: 48px; width: 100%;
    cursor: pointer;
}
.btn:active { background: var(--green-dark); }
.btn.ghost { background: #eef1ee; color: var(--ink); }
.btn.big { font-size: 1.05rem; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.form input, .form select {
    font-size: 1rem; padding: 12px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; width: 100%;
}
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.form .check input { width: auto; }

.recipe-photo { width: 100%; border-radius: 14px; aspect-ratio: 16/10; object-fit: cover; }
.recipe-photo.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--green), #79b98a);
    color: #fff; font-size: 4rem; font-weight: 700;
}
.ingredients, .steps { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.ingredients li, .steps li { margin: 8px 0; line-height: 1.45; }
.back { display: inline-block; margin-top: 12px; }

.copybar { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.copybar textarea {
    width: 100%; min-height: 120px; font-size: .85rem; font-family: ui-monospace, monospace;
    border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff;
}
.shop { margin-top: 20px; }
.shoplinks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.shoplinks a {
    display: block; background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; padding: 12px; text-decoration: none; color: var(--ink);
    font-weight: 600;
}
.rows { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.rows li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    display: flex; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    min-height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.bottomnav a {
    flex: 1; display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: var(--muted); font-weight: 700; font-size: .95rem;
    min-height: var(--nav-h); user-select: none; -webkit-user-select: none;
}
.bottomnav a.on { color: var(--green); }
