@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    /* Campsite palette: pine and campfire on warm paper. */
    --pine: #1f4d3a;
    --pine-dark: #153527;
    --pine-soft: #e4efe7;
    --fire: #d9541e;
    --fire-dark: #b64312;
    --fire-soft: #fdebdf;
    --cream: #f6f1e6;
    --paper: #fffdf8;
    --ink: #26302b;
    --muted: #5f6c64;
    --line: rgba(31, 77, 58, 0.18);
    --shadow: 0 6px 18px rgba(38, 48, 43, 0.08);

    /* The five MyPlate food groups. */
    --fruit: #d24b4b;
    --vegetable: #3f8f45;
    --grain: #d98a1f;
    --protein: #7654a3;
    --dairy: #3b82c4;

    /* Day colors from the paper form (brown, green, purple), repeating after day 3. */
    --day: var(--pine);

    font-family: 'Nunito', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
}

.day-c1 { --day: #6b4a3f; }
.day-c2 { --day: #3f6b4a; }
.day-c3 { --day: #4b4a6e; }

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--cream);
    color: var(--ink);
}

h1, h2, h3 {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    color: var(--pine);
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

h1:focus {
    outline: none;
}

p {
    margin: 0 0 0.75rem;
}

a {
    color: var(--pine);
    text-underline-offset: 2px;
}

    a:hover {
        color: var(--fire-dark);
    }

:focus-visible {
    outline: 3px solid var(--fire);
    outline-offset: 2px;
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

code {
    background: var(--pine-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---- Shell ---- */
.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: var(--pine);
    color: white;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: white;
    text-decoration: none;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
}

    .brand:hover {
        color: white;
    }

.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

    .site-nav a {
        color: white;
        text-decoration: none;
        font-weight: 700;
        padding: 0.4rem 0.75rem;
        border-radius: 999px;
    }

        .site-nav a:hover {
            background: rgba(255, 255, 255, 0.14);
        }

        .site-nav a.active {
            background: white;
            color: var(--pine);
        }

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
}

    .site-footer a {
        color: var(--muted);
    }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font: inherit;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    padding: 0.65rem 1.15rem;
    min-height: 2.9rem;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--fire);
    color: white;
}

    .btn-primary:hover:not(:disabled) {
        background: var(--fire-dark);
        color: white;
        transform: translateY(-1px);
    }

.btn-secondary {
    background: var(--paper);
    color: var(--pine);
    border-color: var(--line);
}

    .btn-secondary:hover:not(:disabled) {
        border-color: var(--pine);
        color: var(--pine);
    }

.btn-danger {
    background: #a3261c;
    color: white;
}

.btn-lg {
    font-size: 1.25rem;
    padding: 0.9rem 1.6rem;
    min-height: 3.6rem;
}

.btn-sm {
    font-size: 0.9rem;
    padding: 0.35rem 0.8rem;
    min-height: 2.2rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.copied {
    background: var(--pine);
    border-color: var(--pine);
    color: white;
}

.link-button {
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--pine);
    background: none;
    border: none;
    padding: 0.35rem 0.2rem;
    cursor: pointer;
    text-align: left;
}

    .link-button:hover {
        color: var(--fire-dark);
        text-decoration: underline;
    }

.icon-button {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

    .icon-button:hover {
        background: var(--fire-soft);
        color: var(--fire-dark);
    }

/* ---- Cards, text, alerts ---- */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card-title-row, .page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

    .card-title-row h2, .page-title-row h1 {
        margin: 0;
    }

.card-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hint {
    color: var(--muted);
    font-size: 0.92rem;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

.loading {
    color: var(--muted);
    padding: 2rem 0;
    text-align: center;
}

.alert {
    border-radius: 0.8rem;
    padding: 0.7rem 0.9rem;
    margin: 0 0 1rem;
    border: 1px solid transparent;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.alert-warning {
    background: #fff4d6;
    border-color: #ecc866;
    color: #6b4a00;
}

.alert-info {
    background: var(--pine-soft);
    border-color: var(--line);
    color: var(--pine-dark);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #ece6d8;
    color: #55503f;
    white-space: nowrap;
}

.badge-troop {
    background: #fff0c9;
    color: #6b4a00;
}

.badge-ok {
    background: var(--pine);
    color: white;
}

.count-pill {
    display: inline-block;
    min-width: 1.6rem;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--pine-soft);
    color: var(--pine);
    vertical-align: middle;
}

.empty-state {
    text-align: center;
    max-width: 34rem;
    margin: 2.5rem auto;
    padding: 2rem 1.5rem;
}

.empty-state-icon {
    font-size: 2.4rem;
    color: var(--fire);
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    text-decoration: none;
}

/* ---- Forms ---- */
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
    font: inherit;
    color: var(--ink);
    background: white;
    border: 1.5px solid var(--line);
    border-radius: 0.65rem;
    padding: 0.5rem 0.7rem;
    min-height: 2.7rem;
    width: 100%;
    min-width: 0;
}

    input:focus, select:focus, textarea:focus {
        border-color: var(--pine);
    }

    input[readonly] {
        background: var(--cream);
        color: var(--muted);
    }

input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--pine);
}

.field {
    margin-bottom: 0.9rem;
}

    .field > label, .field-label {
        display: block;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1rem;
}

.add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

    .add-row input {
        flex: 1 1 12rem;
        width: auto;
    }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.push-right {
    margin-left: auto;
}

.saved-note {
    font-weight: 800;
    color: var(--vegetable);
}

.stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

    .stepper .btn {
        width: 2.9rem;
        padding: 0;
        font-size: 1.4rem;
    }

.stepper-value {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

/* ---- Chips ---- */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    min-height: 2.2rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: white;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

button.chip:hover {
    border-color: var(--pine);
}

.chip-on {
    background: var(--pine);
    border-color: var(--pine);
    color: white;
}

.chip-add {
    border-style: dashed;
    border-color: var(--fire);
    color: var(--fire-dark);
    background: var(--paper);
}

button.chip-add:hover {
    background: var(--fire);
    border-color: var(--fire);
    border-style: solid;
    color: white;
}

.chip-scout {
    cursor: default;
    background: var(--pine-soft);
    border-color: transparent;
    color: var(--pine-dark);
    padding-right: 0.25rem;
}

.chip-x {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--pine);
    cursor: pointer;
}

    .chip-x:hover {
        background: white;
        color: var(--fire-dark);
    }

.chip-fruit.chip-on { background: var(--fruit); border-color: var(--fruit); }
.chip-vegetable.chip-on { background: var(--vegetable); border-color: var(--vegetable); }
.chip-grain.chip-on { background: var(--grain); border-color: var(--grain); }
.chip-protein.chip-on { background: var(--protein); border-color: var(--protein); }
.chip-dairy.chip-on { background: var(--dairy); border-color: var(--dairy); }

/* ---- Home ---- */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem 0 2rem;
}

@media (min-width: 800px) {
    .hero {
        grid-template-columns: 1.5fr 1fr;
        padding: 3rem 0;
    }
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
}

.lede {
    font-size: 1.15rem;
    max-width: 34rem;
    margin-bottom: 1.25rem;
}

.hero form {
    margin-bottom: 0.75rem;
}

.hero-plate {
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

    .hero-plate .plate-wrap {
        --plate: 12rem;
        margin-bottom: 0.75rem;
    }

    .hero-plate .wedge i {
        font-size: 2rem;
    }

.recent-plans ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-plans li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
}

    .recent-plans li a {
        font-weight: 800;
    }

    .recent-plans li span {
        color: var(--muted);
        font-size: 0.9rem;
    }

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.step-card {
    margin: 0;
}

.step-num {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--pine);
    color: white;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ---- Plan header and steps ---- */
.plan-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

    .plan-head h1 {
        margin-bottom: 0.2rem;
    }

.plan-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.plan-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.save-state {
    font-size: 0.85rem;
    color: var(--vegetable);
    font-weight: 700;
    min-height: 1.3rem;
}

.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

    .share-row label {
        font-weight: 800;
        white-space: nowrap;
    }

    .share-row input {
        flex: 1 1 14rem;
        width: auto;
        font-size: 0.85rem;
    }

    .share-row .hint {
        flex-basis: 100%;
        margin: 0;
    }

.steps {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.1rem;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--cream);
}

.step {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font: inherit;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    padding: 0.6rem 0.9rem;
    min-height: 2.9rem;
    border-radius: 0.9rem;
    border: 1.5px solid var(--line);
    background: var(--paper);
    color: var(--pine);
    cursor: pointer;
    text-decoration: none;
}

    .step:hover {
        border-color: var(--pine);
        color: var(--pine);
    }

.step-current {
    background: var(--pine);
    border-color: var(--pine);
    color: white;
}

    .step-current:hover {
        color: white;
    }

.step-print {
    flex: 0 0 auto;
}

@media (max-width: 560px) {
    .step {
        flex-direction: column;
        gap: 0.15rem;
        font-size: 0.8rem;
        padding: 0.45rem 0.5rem;
    }
}

.step-next {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.roster-title {
    margin-top: 1.25rem;
}

.roster-patrol {
    margin-bottom: 0.75rem;
}

.roster-patrol-name {
    display: block;
}

.people-field {
    margin: 1.25rem 0 0;
}

    .people-field .add-row {
        max-width: 26rem;
    }

.allergy-field {
    margin: 1.25rem 0 0;
}

.chip-allergy.chip-on {
    background: var(--fire-dark);
    border-color: var(--fire-dark);
}

/* ---- Menu: days and meals ---- */
.day {
    margin-bottom: 1.5rem;
    border-radius: 1.1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.day-title {
    margin: 0;
    padding: 0.6rem 1.2rem;
    background: var(--day);
    color: white;
    font-size: 1.15rem;
    font-weight: 500;
}

    .day-title span {
        font-weight: 700;
    }

.meal {
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--line);
}

.day-title + .meal {
    border-top: none;
}

.meal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 1rem;
    margin-bottom: 0.4rem;
}

    .meal-head h3 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--day);
    }

.meal-skipped {
    background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(31, 77, 58, 0.035) 10px 20px);
}

    .meal-skipped .hint {
        margin: 0;
    }

.meal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.5rem;
}

@media (min-width: 760px) {
    .meal-body {
        grid-template-columns: minmax(0, 1fr) 16rem;
    }

    .meal-body-plain {
        grid-template-columns: 1fr;
    }
}

.slot {
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    padding: 0.3rem 0;
}

.slot-label {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    color: var(--muted);
    padding-top: 0.55rem;
}

.slot-picked, .slot-own {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.slot-picked {
    min-height: 2.7rem;
    padding: 0.15rem 0.2rem 0.15rem 0.8rem;
    border-radius: 0.65rem;
    background: var(--pine-soft);
}

/* The chosen food's name is a button: tapping it opens its details. */
.slot-name {
    font: inherit;
    font-weight: 800;
    color: var(--ink);
    background: none;
    border: none;
    padding: 0.3rem 0;
    margin-right: auto;
    text-align: left;
    cursor: pointer;
    text-decoration: underline dotted var(--moss, #7fa48a);
    text-underline-offset: 4px;
}

    .slot-name:hover {
        color: var(--pine);
        text-decoration-style: solid;
    }

    .slot-name small {
        font-weight: 700;
        color: var(--muted);
        margin-left: 0.5rem;
        white-space: nowrap;
        display: inline-block;
    }

/* An empty line: a wide dashed button that opens the picker. */
.slot-choose {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font: inherit;
    font-weight: 700;
    color: var(--pine);
    background: white;
    border: 1.5px dashed color-mix(in srgb, var(--pine) 45%, transparent);
    border-radius: 0.65rem;
    padding: 0.5rem 0.8rem;
    min-height: 2.7rem;
    cursor: pointer;
    text-align: left;
}

    .slot-choose:hover {
        background: var(--pine-soft);
        border-style: solid;
        border-color: var(--pine);
    }

/* ---- The meal picker pop-up ---- */
body:has(.modal-backdrop) {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(21, 53, 39, 0.55);
    animation: fade-in 0.15s ease;
}

.modal {
    display: flex;
    flex-direction: column;
    width: min(100%, 60rem);
    max-height: calc(100dvh - 2rem);
    background: var(--paper);
    border-radius: 1.2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    text-align: left;
    animation: modal-in 0.2s ease;
}

    .modal:focus {
        outline: none;
    }

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes modal-in {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem 0.8rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

    .modal-head h2 {
        margin: 0 auto 0 0;
        font-size: 1.35rem;
    }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.25rem;
    overscroll-behavior: contain;
}

.modal-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border-top: 1px solid var(--line);
    background: var(--cream);
}

.picker-tools {
    display: grid;
    gap: 0.6rem;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--cream);
}

.picker-none {
    margin-bottom: 1rem;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.8rem;
}

.idea-card {
    display: flex;
    flex-direction: column;
    font: inherit;
    text-align: left;
    color: var(--ink);
    background: white;
    border: 1.5px solid var(--line);
    border-radius: 0.9rem;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .idea-card:hover {
        border-color: var(--pine);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

.idea-card-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.idea-card-name {
    font-weight: 800;
    line-height: 1.25;
    padding: 0.55rem 0.7rem 0.2rem;
}

.idea-card-waiting {
    padding: 0 0.7rem 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fire-dark);
}

.idea-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    padding: 0 0.7rem 0.65rem;
    margin-top: auto;
    font-size: 0.82rem;
    color: var(--muted);
}

    .idea-card-meta .food-icon {
        width: 1.3rem;
        height: 1.3rem;
        font-size: 0.62rem;
    }

.idea-card-time {
    font-weight: 700;
    white-space: nowrap;
}

.idea-card-own {
    border-style: dashed;
}

/* The picture a meal has until someone adds a photo: its course's color and symbol. */
.photo-tile {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 2.6rem;
    background: linear-gradient(135deg, var(--tile-a, var(--pine)), var(--tile-b, var(--pine-dark)));
}

.photo-tile-main { --tile-a: #c9682e; --tile-b: #8f3d14; }
.photo-tile-side { --tile-a: #5fa35f; --tile-b: #2f6e3c; }
.photo-tile-drink { --tile-a: #4f9bd6; --tile-b: #2a639c; }
.photo-tile-dessert { --tile-a: #9a6cc4; --tile-b: #5e3d8a; }
.photo-tile-snack { --tile-a: #d9a13a; --tile-b: #a86a12; }
.photo-tile-own { --tile-a: #8b958f; --tile-b: #5f6c64; }

.detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 700px) {
    .detail {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        align-items: start;
    }
}

.detail-photo {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.9rem;
    font-size: 4.5rem;
}

.detail-thumbs {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.detail-thumb {
    width: 4rem;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.7;
}

    .detail-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.detail-thumb-on, .detail-thumb:hover {
    border-color: var(--fire);
    opacity: 1;
}

.detail-description {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
}

.detail-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--pine-soft);
    color: var(--pine-dark);
}

.fact-groups {
    background: white;
    border: 1.5px solid var(--line);
}

.detail-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem 2rem;
}

@media (min-width: 700px) {
    .detail-columns {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

.detail-columns h3 {
    font-size: 1.15rem;
    border-bottom: 2px solid var(--pine);
    padding-bottom: 0.2rem;
}

    .detail-columns h3 small {
        font-family: 'Nunito', system-ui, sans-serif;
        font-weight: 700;
        font-size: 0.85rem;
        color: var(--muted);
    }

.detail-ingredients {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .detail-ingredients li {
        display: grid;
        grid-template-columns: 5.2rem minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.3rem 0;
        border-bottom: 1px dotted var(--line);
    }

.detail-steps {
    margin: 0;
    padding-left: 1.4rem;
}

    .detail-steps li {
        padding: 0.25rem 0 0.25rem 0.2rem;
    }

        .detail-steps li::marker {
            font-family: 'Fredoka', system-ui, sans-serif;
            font-weight: 600;
            color: var(--fire-dark);
        }

.detail-tip {
    margin: 0.8rem 0 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.7rem;
    background: var(--fire-soft);
    color: #7a3410;
    font-weight: 700;
}

@media (max-width: 560px) {
    .modal-backdrop {
        padding: 0;
        place-items: end stretch;
    }

    .modal {
        max-height: 94dvh;
        border-radius: 1.2rem 1.2rem 0 0;
    }

    .picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .modal-foot .btn {
        flex: 1 1 auto;
    }
}

/* ---- Admin: a meal idea's photos ---- */
.short-input {
    max-width: 7rem;
}

.photo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

/* While pictures are being dragged over the photos. */
.photo-row.file-drop-over {
    outline: 3px dashed var(--fire);
    outline-offset: 6px;
    border-radius: 0.7rem;
    background: var(--fire-soft);
}

    .photo-row.file-drop-over .photo-add {
        border-color: var(--fire);
        border-style: solid;
        color: var(--fire-dark);
        background: white;
    }

.photo-add small {
    font-weight: 600;
    color: var(--muted);
}

.photo-thumb {
    position: relative;
    width: 9rem;
    aspect-ratio: 4 / 3;
    border-radius: 0.7rem;
    overflow: hidden;
    border: 1.5px solid var(--line);
}

    .photo-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.photo-thumb-actions {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
    display: flex;
    gap: 0.2rem;
}

    .photo-thumb-actions .icon-button {
        background: rgba(255, 255, 255, 0.92);
        width: 2rem;
        height: 2rem;
    }

.photo-add {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.3rem;
    width: 9rem;
    aspect-ratio: 4 / 3;
    border: 2px dashed color-mix(in srgb, var(--pine) 45%, transparent);
    border-radius: 0.7rem;
    color: var(--pine);
    font-weight: 700;
    cursor: pointer;
}

    .photo-add:hover, .photo-add:focus-within {
        background: var(--pine-soft);
        border-style: solid;
    }

.idea-row-photo {
    width: 2.6rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.35rem;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.slot-details {
    margin: 0.25rem 0 0.25rem 0.2rem;
}

    .slot-details > summary {
        cursor: pointer;
        color: var(--muted);
        font-size: 0.88rem;
        font-weight: 700;
        padding: 0.2rem 0;
    }

        .slot-details > summary:hover {
            color: var(--pine);
        }

    .slot-details[open] {
        padding-bottom: 0.5rem;
    }

    .slot-details textarea {
        margin: 0.4rem 0;
    }

.own-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.4rem 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.add-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0 0 0 5.1rem;
}

.ingredients {
    margin-top: 0.3rem;
}

/* On a phone the name gets a line to itself, with the amount and unit under it. */
.ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2.3rem;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
    align-items: center;
}

.ingredient-name {
    grid-column: 1 / -1;
}

    .ingredient-row input, .ingredient-row select {
        min-height: 2.3rem;
        padding: 0.25rem 0.45rem;
        font-size: 0.9rem;
    }

.ingredient-section {
    grid-column: 1 / 4;
    grid-row: 2;
    display: none;
}

@media (min-width: 620px) {
    .ingredient-row {
        grid-template-columns: minmax(0, 1.4fr) 4.4rem 5.2rem minmax(0, 1fr) 2.3rem;
        margin-bottom: 0.3rem;
    }

    .ingredient-name {
        grid-column: auto;
    }

    .ingredient-section {
        display: block;
        grid-column: auto;
        grid-row: auto;
    }
}

/* ---- The plate ---- */
.plate-wrap {
    --plate: 8.5rem;
    position: relative;
    display: inline-block;
    padding: calc(var(--plate) * 0.07) calc(var(--plate) * 0.2) 0 0;
    line-height: 0;
}

.plate {
    position: relative;
    width: var(--plate);
    height: var(--plate);
    border-radius: 50%;
    overflow: hidden;
    background: white;
    box-shadow: 0 0 0 5px white, 0 0 0 6.5px var(--line), 0 8px 18px rgba(38, 48, 43, 0.16);
}

.wedge {
    position: absolute;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    font: inherit;
    cursor: pointer;
    color: white;
    transition: background 0.25s ease, color 0.25s ease;
}

/* The cross between the sections and the dashed outlines of the empty ones (MealPlate.razor). */
.plate-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.plate-cross {
    fill: none;
    stroke: white;
    stroke-width: 2.6;
}

.plate-dash {
    fill: none;
    stroke: color-mix(in srgb, var(--group) 60%, transparent);
    stroke-width: 1.5;
    stroke-dasharray: 4.5 3.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.plate-dash-fruit { --group: var(--fruit); }
.plate-dash-vegetable { --group: var(--vegetable); }
.plate-dash-grain { --group: var(--grain); }
.plate-dash-protein { --group: var(--protein); }

span.wedge {
    cursor: default;
}

.wedge i {
    font-size: calc(var(--plate) * 0.17);
}

/* Sized like the MyPlate picture: vegetables the biggest, then grains. */
.wedge-fruit { left: 0; top: 0; width: 50%; height: 45%; --group: var(--fruit); }
.wedge-vegetable { left: 0; top: 45%; width: 50%; height: 55%; --group: var(--vegetable); }
.wedge-grain { left: 50%; top: 0; width: 50%; height: 55%; --group: var(--grain); }
.wedge-protein { left: 50%; top: 55%; width: 50%; height: 45%; --group: var(--protein); }

.wedge-dairy {
    --group: var(--dairy);
    top: 0;
    right: 0;
    width: calc(var(--plate) * 0.36);
    height: calc(var(--plate) * 0.36);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 1.5px var(--line);
}

    .wedge-dairy i {
        font-size: calc(var(--plate) * 0.14);
    }

.wedge-on {
    background: var(--group);
    animation: wedge-pop 0.45s ease;
}

/* An empty section is a pale, striped tint of its color, out to the rim of the plate. */
.wedge-off {
    background: repeating-linear-gradient(
        135deg,
        color-mix(in srgb, var(--group) 16%, white) 0 7px,
        color-mix(in srgb, var(--group) 7%, white) 7px 14px);
    color: color-mix(in srgb, var(--group) 60%, #b9b3a4);
}

/* The dairy cup is a circle of its own, so it can carry a dashed edge. */
.wedge-dairy.wedge-off {
    outline: 2px dashed color-mix(in srgb, var(--group) 50%, transparent);
    outline-offset: -5px;
}

button.wedge-off:hover, .wedge-selected.wedge-off {
    background: color-mix(in srgb, var(--group) 28%, white);
    color: var(--group);
}

/* An empty wedge wobbles to be noticed, once there's food on the plate to compare it with. */
.plate-wrap:not(.plate-empty):not(.plate-mini) .wedge-off i {
    animation: wedge-wobble 2.6s ease-in-out infinite;
}

@keyframes wedge-wobble {
    0%, 78%, 100% { transform: rotate(0); }
    82% { transform: rotate(-14deg) scale(1.1); }
    88% { transform: rotate(12deg) scale(1.1); }
    94% { transform: rotate(-6deg); }
}

@keyframes wedge-pop {
    0% { transform: scale(0.8); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.plate-stamp {
    position: absolute;
    left: 50%;
    bottom: -0.7rem;
    transform: translateX(-60%) rotate(-5deg);
    background: var(--fire);
    color: white;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 2px solid white;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.plate-stamp-in {
    animation: stamp-in 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes stamp-in {
    from { transform: translateX(-60%) rotate(-20deg) scale(2.2); opacity: 0; }
    to { transform: translateX(-60%) rotate(-5deg) scale(1); opacity: 1; }
}

.confetti {
    position: absolute;
    left: calc(var(--plate) / 2);
    top: calc(var(--plate) / 2);
    pointer-events: none;
}

    .confetti i {
        position: absolute;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 2px;
        opacity: 0;
        background: var(--fire);
        animation: confetti-fly 1s ease-out forwards;
        animation-delay: calc(var(--n) * 12ms);
    }

        .confetti i:nth-child(5n + 1) { background: var(--fruit); }
        .confetti i:nth-child(5n + 2) { background: var(--vegetable); }
        .confetti i:nth-child(5n + 3) { background: var(--grain); }
        .confetti i:nth-child(5n + 4) { background: var(--protein); border-radius: 50%; }
        .confetti i:nth-child(5n + 5) { background: var(--dairy); }

@keyframes confetti-fly {
    0% { transform: rotate(calc(var(--n) * 25.7deg)) translateY(0) scale(1); opacity: 1; }
    100% { transform: rotate(calc(var(--n) * 25.7deg)) translateY(calc(var(--plate) * -0.95)) scale(0.5); opacity: 0; }
}

.plate-mini {
    --plate: 2.2rem;
}

    .plate-mini .plate {
        box-shadow: 0 0 0 2px white, 0 0 0 3px var(--line);
    }

    .plate-mini .wedge {
        animation: none;
    }

    .plate-mini .wedge-off, .plate-mini .wedge-dairy.wedge-off {
        outline: none;
        background: #e7e1d3;
    }

    .plate-mini .wedge-dairy {
        border-width: 1.5px;
        box-shadow: none;
    }

.meal-plate {
    text-align: center;
}

.plate-message {
    margin: 1rem 0 0.5rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.35;
}

.plate-message-full {
    color: var(--vegetable);
}

.fix {
    text-align: left;
    padding: 0.6rem 0.7rem;
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--group, var(--fire)) 9%, white);
    border: 1.5px solid color-mix(in srgb, var(--group, var(--fire)) 30%, transparent);
}

.fix-fruit { --group: var(--fruit); }
.fix-vegetable { --group: var(--vegetable); }
.fix-grain { --group: var(--grain); }
.fix-protein { --group: var(--protein); }
.fix-dairy { --group: var(--dairy); }

.fix-title {
    display: block;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--group);
    margin-bottom: 0.4rem;
}

.nudge {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    padding: 0.55rem 0.8rem;
    border-radius: 0.8rem;
    background: #fff7dc;
    border: 1.5px solid #f0d98a;
}

.nudge-text {
    font-weight: 700;
    color: #5f4500;
}

    .nudge-text i {
        color: var(--grain);
    }

/* ---- Food-group icons ---- */
.food-icons {
    display: inline-flex;
    gap: 0.2rem;
    vertical-align: middle;
}

.food-icon {
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    font-size: 0.72rem;
    border: 1.5px solid var(--group);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.food-icon-fruit { --group: var(--fruit); }
.food-icon-vegetable { --group: var(--vegetable); }
.food-icon-grain { --group: var(--grain); }
.food-icon-protein { --group: var(--protein); }
.food-icon-dairy { --group: var(--dairy); }

.food-icon-on {
    background: var(--group);
    color: white;
}

.food-icon-off {
    border-style: dashed;
    border-color: #b9b3a4;
    color: #b9b3a4;
    background: transparent;
}

/* ---- Trip strip ---- */
.trip-strip-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-bottom: 0.6rem;
}

    .trip-strip-head h2 {
        margin: 0;
    }

.trip-score {
    font-weight: 700;
    color: var(--muted);
}

    .trip-score strong {
        font-family: 'Fredoka', system-ui, sans-serif;
        font-size: 1.5rem;
        color: var(--fire-dark);
    }

.trip-score-full strong {
    color: var(--vegetable);
}

.trip-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.trip-day {
    border: 1.5px solid var(--line);
    border-top: 5px solid var(--day);
    border-radius: 0.8rem;
    padding: 0.4rem 0.7rem 0.5rem;
    background: white;
}

.trip-day-name {
    display: block;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--day);
    margin-bottom: 0.25rem;
}

.trip-plates {
    display: flex;
    gap: 0.5rem;
}

.trip-plate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
}

.trip-plate-none {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.35rem;
    margin-right: 0.44rem;
    color: #c9c2b1;
    font-size: 1.1rem;
}

.trip-notes {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
}

    .trip-notes li {
        padding: 0.3rem 0;
        font-weight: 700;
    }

    .trip-notes i {
        color: var(--grain);
    }

.trip-legend {
    margin: 0.8rem 0 0;
}

/* ---- Shopping ---- */
.shopping {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.9rem 2rem;
    align-items: start;
}

.shopping-section {
    break-inside: avoid;
}

    .shopping-section h3 {
        border-bottom: 2px solid var(--pine);
        padding-bottom: 0.15rem;
        margin-bottom: 0.3rem;
    }

    .shopping-section ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .shopping-section li {
        display: grid;
        grid-template-columns: 1.1rem 4.8rem minmax(0, 1fr);
        gap: 0.5rem;
        align-items: baseline;
        padding: 0.25rem 0;
        border-bottom: 1px dotted var(--line);
    }

.tick-box {
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--ink);
    border-radius: 3px;
    align-self: center;
}

.shopping-amount {
    font-weight: 800;
}

.shopping-name small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

/* What each item likely contains; filled in when it's one of the patrol's allergies. */
.allergen-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

.allergen {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 0.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    white-space: nowrap;
}

.allergen-hit {
    background: var(--fire-dark);
    border-color: var(--fire-dark);
    color: white;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.allergy-note {
    break-inside: avoid;
}

.allergen-footnote {
    margin: 0.75rem 0 0;
}

.extra-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 2.3rem;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    align-items: center;
}

/* ---- Kitchen crew ---- */
.crew-meal {
    border-left: 5px solid var(--day);
    padding: 0.4rem 0 0.4rem 0.9rem;
    margin-bottom: 0.9rem;
}

    .crew-meal h3 {
        color: var(--day);
    }

.crew-jobs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.5rem 0.75rem;
}

.crew-job span {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
}

.crew-jobs-list {
    margin: 0 0 0.75rem;
}

    .crew-jobs-list dt {
        font-weight: 800;
        margin-top: 0.4rem;
    }

    .crew-jobs-list dd {
        margin: 0;
    }

/* ---- Read-only menu (approver page and print) ---- */
.menu-day {
    border: 1.5px solid var(--day);
    border-radius: 0.6rem;
    overflow: hidden;
    margin-bottom: 0.9rem;
    break-inside: avoid;
}

.menu-day-title {
    margin: 0;
    padding: 0.3rem 0.8rem;
    background: var(--day);
    color: white;
    font-size: 1rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.menu-meal {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: start;
    padding: 0.4rem 0.8rem;
    border-top: 1px solid var(--line);
}

.menu-meal-name {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    color: var(--day);
}

.menu-line {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr);
    gap: 0.4rem;
    min-height: 1.5rem;
}

    .menu-line strong {
        color: var(--muted);
        font-size: 0.88rem;
    }

    .menu-line span:only-child {
        grid-column: 1 / -1;
    }

.menu-none {
    color: var(--muted);
    font-style: italic;
}

/* ---- Approver pages ---- */
.approve-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    border: 2px solid var(--fire);
}

    .approve-box .hint {
        margin: 0.2rem 0 0;
    }

.approve-box-done {
    border-color: var(--vegetable);
    background: #f1f8f1;
}

.plan-list {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.plan-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    margin: 0;
    text-decoration: none;
    color: var(--ink);
}

    .plan-row:hover {
        border-color: var(--pine);
        color: var(--ink);
    }

.plan-row-name {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--pine);
}

.plan-row-meta {
    color: var(--muted);
    margin-right: auto;
}

/* ---- Admin ---- */
.table-wrap {
    padding: 0.4rem 0.6rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th {
        text-align: left;
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
        padding: 0.5rem 0.6rem;
    }

    .data-table td {
        padding: 0.5rem 0.6rem;
        border-top: 1px solid var(--line);
        vertical-align: middle;
    }

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.row-muted {
    opacity: 0.6;
}

@media (max-width: 720px) {
    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        padding: 0.6rem 0;
        border-top: 1px solid var(--line);
    }

    .data-table td {
        display: grid;
        grid-template-columns: 5.5rem minmax(0, 1fr);
        gap: 0.5rem;
        border: none;
        padding: 0.2rem 0.3rem;
    }

        .data-table td::before {
            content: attr(data-label);
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--muted);
        }

        .data-table td.row-actions {
            display: flex;
            justify-content: flex-start;
        }

            .data-table td.row-actions::before {
                content: none;
            }
}

/* The search box with the "Good for:" pills beside it; the pills drop below on a narrow screen. */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
}

.filter-field {
    flex: 1 1 14rem;
    max-width: 24rem;
}

.filter-pills {
    align-items: center;
}

    .filter-pills .field-label {
        margin: 0;
    }

.idea-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.idea-row {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    padding: 0.7rem 0.9rem;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}

    .idea-row:hover {
        border-color: var(--pine);
    }

.idea-row-name {
    font-weight: 800;
}

.idea-row-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.idea-retired {
    opacity: 0.55;
}

/* What a written-in line can be given: a picture, a line about it, time, steps, a tip. */
.own-more .photo-row {
    margin-top: 0.4rem;
}

.own-field {
    display: grid;
    gap: 0.15rem;
    margin: 0.45rem 0;
    font-size: 0.9rem;
    font-weight: 700;
}

    .own-field input, .own-field textarea {
        margin: 0;
        font-weight: 400;
    }

/* A written-in line's way to be sent in as a meal idea. */
.share-own {
    display: inline-block;
    margin: 0.15rem 0 0.25rem 0.2rem;
    font-size: 0.88rem;
    text-decoration: none;
}

.detail-share {
    margin-top: 0.5rem;
}

/* The admin's link, in the footer of a food's details on a plan, to its meal idea. */
.admin-edit {
    /* On the left of the pop-up's footer, away from the buttons everyone gets. */
    margin-right: auto;
    align-self: center;
    text-decoration: none;
}

/* Settings: a meal idea sent in from a plan, waiting for an admin. */
.idea-review {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
}

.idea-review-body {
    flex: 1 1 18rem;
    display: grid;
    gap: 0.4rem;
    align-content: start;
}

    .idea-review-body h3, .idea-review-body p {
        margin: 0;
    }

/* The invitation under the menu to send a meal idea in. */
.share-idea {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
}

/* ---- Printed packet ---- */
.print-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

/* The boxes that choose which parts are printed. */
.print-parts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 1rem;
    flex-basis: 100%;
    margin: 0;
    padding: 0.5rem 0.8rem;
    border: 1.5px solid var(--line);
    border-radius: 0.7rem;
    background: var(--paper);
}

    .print-parts legend {
        float: left;
        padding: 0;
        font-weight: 800;
    }

    .print-parts label {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        cursor: pointer;
    }

/* A part unticked there. Said this firmly because some parts set their own display. */
.sheet[hidden], .sheet [hidden] {
    display: none !important;
}

/* The cost printed on its own needs no rule above it. */
[data-part="shopping"][hidden] ~ .shop-money {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.sheet {
    background: white;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    max-width: 8.5in;
    margin: 0 auto 1.5rem;
    padding: 0.5in;
    font-size: 0.9rem;
}

.sheet-head {
    border-bottom: 2.5px solid var(--ink);
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
}

    .sheet-head h1 {
        color: var(--ink);
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

/* The plan's sheet: its QR code sits to the right of the heading. */
.sheet-head-qr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sheet-qr {
    flex: none;
    margin: 0;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
}

    .sheet-qr img {
        display: block;
        width: 1in;
        height: 1in;
        margin: 0 auto 0.1rem;
        image-rendering: pixelated;
    }

.sheet-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1.5rem;
}

.sheet-approval {
    margin-top: 0.3rem;
}

.sheet-note {
    margin-top: 0.8rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--ink);
    border-radius: 0.4rem;
    font-size: 0.82rem;
    break-inside: avoid;
}

    .sheet-note h2 {
        color: var(--ink);
        font-size: 1rem;
    }

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
    break-inside: avoid;
}

    .sheet-table th, .sheet-table td {
        border: 1px solid var(--ink);
        padding: 0.35rem 0.5rem;
        text-align: left;
        height: 1.9rem;
    }

    .sheet-table thead th {
        background: #e9e4d8;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

.paid-table {
    max-width: 26rem;
}

/* The printed duty roster: names start at the top left of their box, in slightly smaller type. */
.duty-table {
    font-size: 85%;
}

    .duty-table th, .duty-table td {
        text-align: left;
        vertical-align: top;
    }

/* The cost estimate: meals down the side, dollars lined up on the right. */
.cost-table {
    max-width: 26rem;
    margin-top: 0.4rem;
}

    .cost-table th:not(:first-child), .cost-table td:not(:first-child) {
        text-align: right;
        width: 5.5rem;
    }

    .cost-table tfoot th {
        text-align: right;
    }

.cost-bring {
    margin: 0.6rem 0 0.2rem;
    font-size: 1.1rem;
}

    .cost-bring i {
        color: var(--pine);
    }

.cost-title {
    margin-top: 1rem;
}

.cost-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.75rem;
    max-width: 34rem;
}

    .paid-table th:not(:first-child) {
        width: 5.5rem;
    }

/* ---- The printed shopping list, kept tight so it fits one page ---- */
/* The list runs down three narrow columns, a section flowing on into the next column. */
.shopping-compact {
    display: block;
    column-count: 3;
    column-gap: 1.1rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

    .shopping-compact .shopping-section {
        break-inside: auto;
        margin-bottom: 0.4rem;
    }

        .shopping-compact .shopping-section h3 {
            font-size: 0.88rem;
            border-bottom-width: 1.5px;
            padding-bottom: 0;
            margin-bottom: 0.1rem;
            break-after: avoid;
        }

        .shopping-compact .shopping-section li {
            grid-template-columns: 0.7rem 3rem minmax(0, 1fr);
            gap: 0.3rem;
            padding: 0.03rem 0;
            break-inside: avoid;
        }

    .shopping-compact .tick-box {
        width: 0.7rem;
        height: 0.7rem;
        border-width: 1px;
        border-radius: 2px;
    }

    .shopping-compact .shopping-name small {
        display: inline;
        font-size: 0.66rem;
        margin-left: 0.15rem;
        white-space: nowrap;
    }

    .shopping-compact .allergen-tags {
        display: inline-flex;
        gap: 0.15rem;
        margin: 0;
        vertical-align: middle;
    }

    .shopping-compact .allergen {
        font-size: 0.6rem;
        padding: 0 0.25rem;
    }

.sheet-shopping .sheet-head {
    margin-bottom: 0.45rem;
}

.sheet-shopping .allergy-note {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0.45rem;
}

.sheet-shopping .allergen-footnote {
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* The cost on the left, who's paid on the right. */
.shop-money {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.2rem;
    align-items: start;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1.5px solid var(--ink);
    break-inside: avoid;
    font-size: 0.8rem;
}

    .shop-money .cost-title {
        font-size: 0.95rem;
        margin: 0;
    }

    .shop-money .sheet-table {
        margin-top: 0.25rem;
    }

        .shop-money .sheet-table th, .shop-money .sheet-table td {
            height: 1.3rem;
            padding: 0.08rem 0.4rem;
        }

    .shop-money .cost-table th:not(:first-child), .shop-money .cost-table td:not(:first-child) {
        width: auto;
        white-space: nowrap;
    }

    .shop-money .cost-bring {
        font-size: 0.95rem;
        margin: 0.3rem 0 0.1rem;
    }

    .shop-money .hint {
        font-size: 0.7rem;
        margin: 0;
    }

@media (max-width: 720px) {
    .shopping-compact {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .shopping-compact {
        column-count: 1;
    }

    .shop-money {
        grid-template-columns: 1fr;
    }
}

@media print {
    .shopping-compact {
        column-count: 3;
    }

    .shop-money {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cook-day {
    margin-bottom: 0.9rem;
}

    .cook-day .menu-day-title {
        border-radius: 0.4rem;
    }

.cook-meal {
    padding: 0.4rem 0.2rem;
    border-bottom: 1px solid var(--line);
    break-inside: avoid;
}

    .cook-meal h3 {
        color: var(--day);
        margin-bottom: 0.2rem;
    }

        .cook-meal h3 small {
            font-family: 'Nunito', system-ui, sans-serif;
            font-weight: 600;
            color: var(--muted);
            margin-left: 0.5rem;
        }

.cook-item {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 0.1rem 0.75rem;
    padding: 0.15rem 0;
    /* The body of the cooking sheets, a little smaller than the headings around it. */
    font-size: 90%;
}

    .cook-item em, .cook-steps {
        grid-column: 2;
        color: var(--muted);
    }

    .cook-item strong small {
        display: block;
        font-weight: 600;
        color: var(--muted);
    }

.cook-steps {
    margin: 0.15rem 0 0.2rem;
    padding-left: 1.2rem;
    color: var(--ink);
}

@media (max-width: 600px) {
    .sheet {
        padding: 1rem;
    }

    .cook-item, .menu-meal {
        grid-template-columns: 1fr;
    }

        .cook-item em, .cook-steps {
            grid-column: 1;
        }
}

@media print {
    @page {
        size: letter;
        margin: 0.5in;
    }

    html, body {
        background: white;
        font-size: 11pt;
    }

    .no-print, #blazor-error-ui, #components-reconnect-modal {
        display: none !important;
    }

    .site-main {
        max-width: none;
        padding: 0;
    }

    .sheet {
        border: none;
        box-shadow: none;
        border-radius: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        break-after: page;
    }

        /* The last part being printed (marked in app.js; the very last one if that hasn't run). */
        .sheet:last-of-type, .sheet.sheet-last {
            break-after: auto;
        }

    .card {
        box-shadow: none;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* ---- Motion: none for people who've asked for less ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }

    .confetti {
        display: none;
    }
}

/* ---- Blazor's error bar ---- */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 0.7rem 1.2rem;
    background: #fff4d6;
    border-top: 2px solid #ecc866;
    color: #6b4a00;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
    }
