:root {
    --warm-white: #FCFAF5;
    --soft-cream: #F6F1E7;
    --mist-gray: #E9E6DF;
    --sage: #BFD3C1;
    --basil: #6FA377;
    --herb: #4F7A57;
    --tomato: #E46F5A;
    --citrus: #E8B94E;
    --olive: #C6A04A;
    --plum: #7F4B5D;
    --ink: #28352A;
    --muted: #6F756B;
    --white: #FFFFFF;
    --shadow: 0 18px 45px rgba(63, 72, 57, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(191, 211, 193, 0.38), transparent 34rem),
        linear-gradient(180deg, var(--warm-white), var(--soft-cream));
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--herb);
    text-decoration: none;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--mist-gray);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    background: var(--white);
    color: var(--ink);
}

select option {
    color: var(--ink);
    background: var(--white);
}

label {
    display: grid;
    gap: 0.4rem;
    color: var(--herb);
    font-weight: 700;
}

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

h1 {
    max-width: 820px;
    font-size: clamp(2.35rem, 7vw, 5.25rem);
    line-height: 0.98;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.05rem;
}

.app-shell {
    width: min(1180px, calc(100% - 1.25rem));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ink);
    font-weight: 900;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: var(--herb);
    color: var(--warm-white);
    box-shadow: var(--shadow);
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    font-weight: 700;
}

.top-nav a {
    color: var(--ink);
}

.nav-pill {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: var(--sage);
}

.content {
    padding: 1.25rem 0 3rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 2rem;
    align-items: center;
    min-height: 74vh;
}

.hero-copy p {
    max-width: 620px;
    font-size: 1.2rem;
    color: var(--muted);
}

.eyebrow {
    margin-bottom: 0.6rem;
    color: var(--tomato);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.produce-board {
    position: relative;
    min-height: 420px;
    border-radius: var(--radius);
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.86), rgba(246, 241, 231, 0.84)),
        repeating-linear-gradient(90deg, rgba(198, 160, 74, 0.09) 0 12px, transparent 12px 24px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.produce {
    position: absolute;
    display: block;
    border-radius: 999px;
    box-shadow: inset -14px -16px 28px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(63, 72, 57, 0.13);
}

.tomato { width: 125px; height: 125px; left: 14%; top: 18%; background: var(--tomato); }
.herb { width: 150px; height: 70px; right: 13%; top: 18%; background: var(--basil); transform: rotate(-18deg); }
.lemon { width: 142px; height: 92px; left: 20%; bottom: 18%; background: var(--citrus); transform: rotate(16deg); }
.plum { width: 96px; height: 96px; right: 22%; bottom: 18%; background: var(--plum); }
.leaf { width: 105px; height: 52px; right: 32%; top: 48%; background: var(--sage); transform: rotate(35deg); }

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1.05rem;
    background: var(--herb);
    color: var(--white);
    font-weight: 900;
    cursor: pointer;
}

.button.primary {
    background: var(--herb);
}

.button.ghost {
    background: var(--white);
    color: var(--herb);
    border: 1px solid var(--sage);
}

.button.tomato {
    background: var(--tomato);
}

.button:disabled,
button.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button.small {
    min-height: 2.25rem;
    padding: 0.48rem 0.85rem;
    font-size: 0.9rem;
}

.card,
.metric-card,
.mini-card {
    border: 1px solid rgba(233, 230, 223, 0.9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 30px rgba(63, 72, 57, 0.08);
}

.card {
    padding: 1.15rem;
}

.auth-panel,
.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr);
    gap: 1.25rem;
    align-items: start;
}

.page-heading,
.recipe-hero,
.placeholder-panel {
    padding: 2rem 0;
}

.form-card {
    display: grid;
    gap: 1rem;
}

.form-note {
    margin-bottom: 0;
    color: var(--muted);
}

.two-col,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.check-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.check-row input {
    width: auto;
}

.metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.metric-card {
    padding: 1rem;
}

.metric-card span {
    display: block;
    color: var(--herb);
    font-size: 2rem;
    font-weight: 950;
}

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

.metric-value {
    margin-bottom: 0.2rem;
    color: var(--herb);
    font-size: 3rem;
    line-height: 1;
    font-weight: 950;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.pack-grid form,
.recipe-card form {
    margin: 0;
}

.pack-grid .button {
    width: 100%;
}

.stack {
    display: grid;
    gap: 0.75rem;
}

.mini-card {
    padding: 0.9rem;
}

.mini-card strong,
.mini-card span {
    display: block;
}

.mini-card span {
    color: var(--muted);
}

.inventory-layout {
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
}

.inventory-item,
.shopping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.badge-row,
.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badge,
.recipe-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    background: var(--mist-gray);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 900;
}

.badge.sage { background: var(--sage); color: var(--herb); }
.badge.coral { background: rgba(228, 111, 90, 0.16); color: #A94231; }
.badge.gold { background: rgba(232, 185, 78, 0.22); color: #765E18; }

.icon-button {
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}

.icon-button.danger {
    background: rgba(228, 111, 90, 0.14);
    color: #A94231;
}

.match-bar {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--mist-gray);
    margin: 1rem 0 0.55rem;
}

.match-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--basil), var(--citrus));
}

.missing-preview {
    color: var(--plum);
    font-weight: 700;
}

.recipe-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.ingredient-list,
.steps {
    padding-left: 1.1rem;
}

.ingredient-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--mist-gray);
}

.steps li {
    margin-bottom: 0.75rem;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 100px 110px 150px auto;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.shopping-item.purchased {
    opacity: 0.55;
}

.shopping-item.purchased h3 {
    text-decoration: line-through;
}

.group-heading {
    margin: 1rem 0 0;
    color: var(--herb);
}

.recipe-match-section {
    margin-bottom: 2rem;
}

.highlight-card {
    margin-bottom: 1.5rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 241, 231, 0.82)),
        rgba(191, 211, 193, 0.16);
}

.ai-result-links {
    margin-top: 1rem;
}

.placeholder-panel {
    min-height: 56vh;
    display: grid;
    align-content: center;
}

.zinger-card {
    display: grid;
    gap: 0.9rem;
}

.tutorial-placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(111, 163, 119, 0.28), rgba(232, 185, 78, 0.24)),
        var(--soft-cream);
    color: var(--herb);
    font-weight: 950;
}

.notice {
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.notice.success {
    background: rgba(191, 211, 193, 0.55);
    color: var(--herb);
}

.notice.error {
    background: rgba(228, 111, 90, 0.13);
    color: #A94231;
}

.site-footer {
    padding: 2rem 0;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero,
    .auth-panel,
    .split-grid,
    .recipe-hero {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inline-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .app-shell {
        width: min(100% - 1rem, 1180px);
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .produce-board {
        min-height: 300px;
    }

    .metric-grid,
    .card-grid,
    .two-col,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .inventory-item,
    .shopping-item,
    .ingredient-list li {
        align-items: flex-start;
        flex-direction: column;
    }
}
