:root {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #191919;
    background: #f7f7f4;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #e5e5df;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand {
    font-weight: 800;
    font-size: 20px;
    color: inherit;
    text-decoration: none;
}
.topbar nav {
    display: flex;
    gap: 18px;
}
.topbar nav a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}
.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}
.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 22px;
}
.hero h1 {
    font-size: 42px;
    line-height: 1.05;
    margin: 4px 0 10px;
}
.lede {
    max-width: 720px;
    color: #5d5d57;
    line-height: 1.55;
    margin: 0;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 800;
    color: #77776f;
    margin: 0;
}
.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #deded7;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    white-space: nowrap;
}
.card {
    background: #fff;
    border: 1px solid #e1e1da;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}
.toolbar {
    display: grid;
    grid-template-columns: 1.1fr 2fr 1.1fr auto;
    gap: 10px;
    margin-bottom: 16px;
}
.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.stack h2,
.inventory-section h2,
#review h2,
.planner-section h2 {
    margin: 4px 0 0;
    font-size: 20px;
}
.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
label {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
label small {
    font-weight: 500;
    color: #777;
    line-height: 1.35;
}
input,
select,
button {
    font: inherit;
}
input,
select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d7d7cf;
    border-radius: 10px;
    background: #fff;
}
button {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #222;
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
button.secondary {
    background: #eee;
    color: #222;
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.muted {
    color: #66645f;
    line-height: 1.5;
    margin: 0;
}
.notice {
    background: #fff4d6;
    border: 1px solid #efd58e;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.status {
    min-height: 24px;
    color: #555;
    font-size: 13px;
    margin: 6px 0 10px;
}
.hidden {
    display: none !important;
}
.review-head,
.inventory-head,
.planner-head,
.meal-idea-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.review-lines {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
}
.review-row {
    display: grid;
    grid-template-columns: auto 1.6fr 0.55fr 0.55fr 0.7fr;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid #eee;
}
.review-row:first-child {
    border-top: 0;
}
.review-row .confidence {
    font-size: 12px;
    color: #777;
}
.planner-section {
    margin-top: 16px;
}
.planner-head .muted {
    max-width: 780px;
    margin-top: 7px;
}
.planner-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
    align-items: end;
}
.planner-staples {
    grid-column: span 4;
}
#plan-meal {
    min-height: 42px;
}
.meal-ideas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.meal-idea-card {
    border: 1px solid #e6e6df;
    border-radius: 14px;
    padding: 15px;
    background: #fafaf7;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.meal-idea-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
}
.meal-idea-head .pill {
    flex: 0 0 auto;
    text-transform: capitalize;
}
.idea-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.idea-metrics span {
    background: #ecece6;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 750;
}
.idea-detail {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    font-size: 13px;
    line-height: 1.45;
}
.idea-detail strong {
    color: #4f4f49;
}
.idea-detail span {
    color: #66645f;
}
.inventory-section {
    margin-top: 16px;
}
.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f0f0eb;
    font-size: 12px;
    font-weight: 800;
}
.inventory-list {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}
.inventory-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 0.75fr 0.75fr 0.75fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-top: 1px solid #eee;
}
.inventory-row:first-child {
    border-top: 0;
}
.inventory-row strong {
    display: block;
}
.inventory-row small {
    color: #777;
}
.stock-low {
    font-weight: 800;
}
.stock-depleted {
    opacity: 0.55;
}
.empty {
    padding: 30px 4px;
    color: #777;
    text-align: center;
}
@media (max-width: 760px) {
    .topbar nav {
        display: none;
    }
    .shell {
        padding: 22px 14px 48px;
    }
    .hero {
        flex-direction: column;
    }
    .hero h1 {
        font-size: 34px;
    }
    .toolbar {
        grid-template-columns: 1fr 1fr;
    }
    .toolbar #search {
        grid-column: 1/-1;
        grid-row: 1;
    }
    .grid-two,
    .meal-ideas {
        grid-template-columns: 1fr;
    }
    .planner-form {
        grid-template-columns: 1fr 1fr;
    }
    .planner-staples,
    #plan-meal {
        grid-column: 1/-1;
    }
    .review-row {
        grid-template-columns: auto 1fr 0.7fr;
    }
    .review-row .review-unit,
    .review-row .confidence {
        display: none;
    }
    .inventory-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .inventory-row .inventory-unit,
    .inventory-row .inventory-location,
    .inventory-row .inventory-state {
        display: none;
    }
    .switch-row {
        align-self: flex-start;
    }
    .idea-detail {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
