/* Selected item inside the input box */
.select2-selection__rendered {
    font-size: 1.1rem !important;
    display: flex;
    align-items: center;
}

/* Items in the dropdown */
.select2-results__option {
    font-size: 1.1rem !important;
    padding: 5px 10px !important;
    display: flex;
    align-items: center;
}

/* Image styling in dropdown */
.select2-results__option img {
    width: 60px !important;
    height: 60px !important;
    margin-right: 10px;
    border-radius: 4px;
    object-fit: cover;
}

/* Image inside the selected item */
.select2-selection__rendered img {
    width: 60px !important;
    height: 60px !important;
    margin-right: 10px;
    border-radius: 4px;
    object-fit: cover;
}

/* Selection box styling */
.select2-container--default .select2-selection--single {
    height: 70px !important;
    display: flex;
    align-items: center;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

/* Dropdown border radius */
.select2-container--default .select2-dropdown {
    border-radius: 0 0 6px 6px;
    border: 1px solid #ced4da;
}

.responsive-heading {
        font-size: 0.9rem;
    }

    @media (min-width: 768px) {
        .responsive-heading {
            font-size: 1.3rem;
        }
    }

    @media (min-width: 992px) {
        .responsive-heading {
            font-size: 1.5rem;
        }
    }

    .responsive-title {
        font-size: 1.2rem;
    }

    @media (min-width: 768px) {
        .responsive-title {
            font-size: 1.5rem;
        }
    }

    @media (min-width: 992px) {
        .responsive-title {
            font-size: 1.8rem;
        }
    }
/* Recipe list cards: when "Add to Meal Plan" would no longer fit next to the
   portions box (a row narrower than about 270 px; the margin covers wider
   system fonts, e.g. on iPhones and iPads), the button shows "+" instead.
   The full text stays readable for screen readers. */
.add-row {
    container-type: inline-size;
}

/* The "+" carries Bootstrap's d-none, so a browser still holding an older
   copy of this file shows only the full text, never both. */
@container (max-width: 18rem) {
    .add-to-meal-btn .add-label-full {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .add-to-meal-btn .add-label-short.d-none {
        display: inline !important;
        font-size: 1.25rem;
        font-weight: 600;
        line-height: 1;
    }

    /* Slimmer, so even a 320 px phone keeps everything on one line. */
    .add-row .add-to-meal-btn {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }
}

/* ---------- Recipe page ---------- */

/* Same height for both top buttons on every screen size. */
.recipe-page .page-btn {
    padding-top: .4rem;
    padding-bottom: .4rem;
    font-size: 1rem;
}

.recipe-photo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
}

/* A recipe without its photo yet (a draft): a plain 3:2 area in the photo's place. */
.photo-placeholder {
    aspect-ratio: 3 / 2;
    background: #E8E2D6;
}

/* A category with no published recipe yet (coming_soon.html): a short centred note. */
.coming-soon {
    max-width: 640px;
    margin: 2.5rem auto 3rem;
    text-align: center;
}
.coming-soon-badge {
    display: inline-block;
    background: #B35238;
    color: #fff;
    border-radius: 999px;
    padding: .2rem .8rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* The same idea in the Recipes menu, next to the category's name. */
.menu-soon-tag {
    display: inline-block;
    margin-left: .35rem;
    background: #FAF7F2;
    color: #B35238;
    border-radius: 999px;
    padding: 0 .5rem;
    font-size: .7em;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: .15em;
}

/* Facts as small rounded labels instead of a line with "|" separators. */
.recipe-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.recipe-facts li {
    background-color: #EEF2EC;
    border: 1px solid #D5DED3;
    border-radius: 999px;
    padding: .3rem .85rem;
    font-size: .95rem;
}

/* A small green line icon before a fact (partials/_fact_icon.html): clock for prep + cooking, hourglass for the
   waits on top of it. */
.fact-icon {
    width: 1.1em;
    height: 1.1em;
    margin-right: .35rem;
    vertical-align: -.2em;
    color: #2C5E3B;
    flex-shrink: 0;
}

/* How hard a recipe is: 1, 2 or 3 filled bars of rising height, then the word (partials/_difficulty.html).
   The number of filled bars tells the levels apart, not colour alone. On cards it is a small green label. */
.difficulty-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background-color: #EEF2EC;
    border: 1px solid #D5DED3;
    border-radius: 999px;
    padding: 0 .6rem 0 .5rem;
    color: #2C5E3B;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}

/* On the recipe page the fact's own rounded label is the frame, so no second one inside it. */
.difficulty-label.difficulty-fact {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    gap: .5rem;
}

.difficulty-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: .8rem;
}

.difficulty-bar {
    width: 4px;
    border-radius: 1px;
    background-color: #C9D3C6;
}

.difficulty-bar:nth-child(1) { height: 50%; }
.difficulty-bar:nth-child(2) { height: 75%; }
.difficulty-bar:nth-child(3) { height: 100%; }
.difficulty-bar.filled { background-color: #2C5E3B; }

.allergen-badge {
    display: inline-block;
    background-color: #FBE9E4;
    border: 1px solid #E7B9AC;
    color: #8A3A26;
    border-radius: 999px;
    padding: .1rem .65rem;
    margin: 0 .3rem .3rem 0;
    font-size: .9rem;
    font-weight: 600;
}

/* The tip on campfire recipes (details.html). */
.tip-box {
    background-color: #EEF4EC;
    border-left: 4px solid #2C5E3B;
    border-radius: 6px;
    padding: .75rem 1rem;
    color: #1F3B27;
}

/* Smaller − 8 + on the manual planner's cards. */
.portion-stepper-sm { flex-wrap: wrap; gap: .25rem; }
.portion-stepper-sm label { font-size: .875rem; }
.portion-stepper-sm input { width: 3.5rem; }
.portion-stepper-sm .stepper-btn { width: 1.9rem; height: 1.9rem; font-size: 1rem; }

/* − 8 + next to the Ingredients heading. */
.portion-stepper {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.portion-stepper label {
    color: #4A6B53;
    font-weight: 600;
    margin-right: .25rem;
}

.portion-stepper input {
    width: 4rem;
    -moz-appearance: textfield;
}

.portion-stepper input::-webkit-outer-spin-button,
.portion-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.portion-stepper .stepper-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 2px solid #4A6B53;
    border-radius: 50%;
    color: #4A6B53;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.portion-stepper .stepper-btn:hover,
.portion-stepper .stepper-btn:focus-visible {
    background-color: #4A6B53;
    color: #ffffff;
}

/* Ingredient and step checkboxes in the site's green. */
.recipe-check.form-check-input {
    width: 1.15em;
    height: 1.15em;
    border: 2px solid #4A6B53;
    border-radius: .3em;
}

.recipe-check.form-check-input:checked {
    background-color: #2C5E3B;
    border-color: #2C5E3B;
}

.recipe-check.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(74, 107, 83, .3);
}

/* Nutrition as six tiles: 3 per row on phones, 6 on wider screens. */
.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
}

@media (min-width: 768px) {
    .nutrition-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.nutrition-grid > div {
    background-color: #ffffff;
    border: 1px solid #E3E0D8;
    border-radius: 10px;
    padding: .6rem .5rem;
    text-align: center;
}

.nutrition-grid dt {
    font-size: .8rem;
    font-weight: 400;
    color: #5E6B62;
}

.nutrition-grid dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2C5E3B;
}

/* ---------- Recipe cards (lists, home page, planner) ---------- */

.recipe-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

a:hover .recipe-card-title,
a:focus-visible .recipe-card-title {
    text-decoration: underline;
}

/* ---------- Sponsor band ---------- */

.sponsor-text {
    font-family: Lora, Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.4;
    max-width: 52rem;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (min-width: 768px) {
    .sponsor-text {
        font-size: 1.2rem;
    }
}

/* ---------- Fonts ---------- */
/* Self-hosted (no requests to Google Fonts), SIL Open Font License: see fonts/*-LICENSE.txt.
   One variable file per family covers every weight. */
@font-face {
    font-family: "Lora";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/lora-latin-wght-normal.9577af3ccda5.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("fonts/source-sans-3-latin-wght-normal.9ef356ea553a.woff2") format("woff2");
}

:root {
    --bs-body-font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: 1.05rem; /* Source Sans runs slightly small */
}

/* ---------- Recipe list ---------- */

.filter-toggle {
    background-color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ---------- Footer and 404 ---------- */

.site-footer {
    border-top: 1px solid #E3E0D8;
}

.not-found-code {
    font-family: Lora, Georgia, serif;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    color: #D5DED3;
    margin-bottom: .5rem;
}

/* Spaced links instead of "·" separators, which dangled at line ends on phones. */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem 1.25rem;
}

/* ---------- Home page ---------- */

.home .hero {
    padding: 3rem 0 2.5rem;
}

.home .hero h1 {
    font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem);
    line-height: 1.15;
}

.home .hero .lead {
    font-size: 1.2rem;
    max-width: 34rem;
}

.hero-facts {
    color: #5E6B62;
    font-size: .95rem;
}

.hero-photo,
.about-illustration {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.hero-photo {
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .12);
}

.home .section-title {
    font-size: 1.75rem;
}

.feature-card {
    display: block;
    height: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .08);
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease;
}

.feature-card:hover,
.feature-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .12);
}

.feature-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.feature-body {
    display: block;
    padding: .8rem 1rem 1rem;
}

.feature-meta {
    color: #5E6B62;
    font-size: .9rem;
}

/* Two cards per row on phones: a little tighter. */
@media (max-width: 575.98px) {
    .feature-body {
        padding: .55rem .6rem .7rem;
    }

    .feature-card .recipe-card-title {
        font-size: .98rem;
    }

    .feature-meta {
        font-size: .8rem;
    }
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: #2C5E3B;
    color: #ffffff;
    font-weight: 700;
}

.home .about {
    background-color: #EEF2EC;
    border-radius: 16px;
}

/* Home: what a free account adds. */
.home .account-offer {
    background-color: #ffffff;
    border: 1px solid rgba(74, 107, 83, .2);
    border-left: 5px solid #4A6B53;
    border-radius: 16px;
}
.account-benefits {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .6rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 768px) {
    .account-benefits {
        grid-template-columns: repeat(2, minmax(0, 1fr));  /* 2 + 2, never 3 + 1 */
    }
}
.account-benefits li {
    position: relative;
    padding-left: 1.6rem;
}
.account-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #2C5E3B;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .feature-card {
        transition: none;
    }

    .feature-card:hover {
        transform: none;
    }
}

/* "Browse by type" tiles on the home page: photo with the type's name on a dark band. */
.type-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background-color: #4A6B53;
    text-decoration: none !important;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .08);
}

.type-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.type-tile:hover img,
.type-tile:focus-visible img {
    transform: scale(1.05);
}

.type-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem .5rem .5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0));
    color: #ffffff;
    font-family: Lora, Georgia, serif;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .type-tile img {
        transition: none;
    }

    .type-tile:hover img {
        transform: none;
    }
}

/* ---------- Planner pages ---------- */

.page-intro {
    padding-top: .5rem;
}

.page-intro h1 {
    font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
}

.page-intro .lead {
    font-size: 1.15rem;
    max-width: 44rem;
}

/* White card for the planner settings and the empty-plan message. */
.planner-card,
.filter-panel {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .08);
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .planner-card,
    .filter-panel {
        padding: 1.75rem;
    }
}

.planner-number {
    max-width: 8rem;
}

/* ---------- Filter panel ---------- */

.filter-panel .form-label {
    font-weight: 600;
    color: #2C5E3B;
    margin-bottom: .3rem;
}

/* Allergens and occasions as tappable chips (Bootstrap's btn-check). */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.chip {
    border: 1px solid #C9D3C6;
    border-radius: 999px;
    background-color: #ffffff;
    color: #2C5E3B;
    padding: .3rem .85rem;
    font-size: .95rem;
}

.chip:hover {
    border-color: #4A6B53;
    color: #2C5E3B;
}

.btn-check:checked + .chip {
    background-color: #2C5E3B;
    border-color: #2C5E3B;
    color: #ffffff;
}

.btn-check:focus-visible + .chip {
    box-shadow: 0 0 0 .2rem rgba(74, 107, 83, .35);
}

/* "35 min · 130 kcal" under the recipe names in the lists. */
.card-meta {
    color: #5E6B62;
    font-size: .9rem;
    margin-top: .15rem;
}

/* ---------- Terms and privacy ---------- */

/* Reading text at about 75 characters per line. */
.legal-page {
    max-width: 48rem;
}

/* ---------- Printing ---------- */

@media print {
    /* Only the content: no menu, buttons, banners or footer. */
    .site-header,
    .site-footer,
    aside[aria-label="Sponsorship"],
    #cookie-consent-banner,
    .spinner-backdrop,
    #loadingSpinner,
    .recipe-page .page-btn,
    #add-to-planner-form,
    .save-box,
    .private-note,
    .recipe-reviews,
    .recipe-meta-rating,
    .site-message,
    .portion-stepper .stepper-btn,
    .recipe-check,
    .btn {
        display: none !important;
    }

    body,
    .site-body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }

    .container,
    .recipe-page {
        max-width: none !important;
        width: 100% !important;
        padding: 0 !important;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    /* A smaller photo, so ingredients and steps fit on the first page. */
    .recipe-photo {
        max-width: 9cm;
        box-shadow: none;
    }

    .recipe-facts li,
    .tip-box,
    .allergen-badge,
    .nutrition-grid > div {
        border-color: #999999 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    .fact-icon {
        color: #000000;
    }

    /* Browsers drop background colours when printing: outline the bars and keep the filled ones black. */
    .difficulty-bar {
        border: 1px solid #000000;
        background-color: #ffffff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .difficulty-bar.filled {
        background-color: #000000;
    }

    .portion-stepper input {
        border: none;
        padding: 0;
        width: 3ch !important;
        text-align: left !important;
        font-weight: 700;
    }

    /* Keep each step, heading and the nutrition tiles in one piece. */
    .form-check,
    .nutrition-grid,
    h2,
    h3 {
        break-inside: avoid;
    }

    h2,
    h3 {
        break-after: avoid;
    }

    .form-check {
        padding-left: 0;
    }
}

/* ---------- Accounts ---------- */

/* Slim line of account links at the top right of the green header. */
.account-links {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    font-size: .85rem;
    margin: -.5rem 0 .1rem;
}

.account-links a,
.account-links button {
    color: #ffffff;
    background: none;
    border: 0;
    padding: 0;
    text-decoration: none;
}

.account-links a:hover,
.account-links button:hover,
.account-links a:focus-visible,
.account-links button:focus-visible {
    text-decoration: underline;
}

/* The flags: the current one framed in white and not a button any more, the others a little faded. */
.language-switch {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
}
.account-links .language-switch button {
    display: block;
    padding: 2px;
    border-radius: 3px;
    line-height: 0;
    opacity: .75;
}
.language-switch img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
.account-links .language-switch button:hover,
.account-links .language-switch button:focus-visible {
    opacity: 1;
}
.account-links .language-switch button[disabled] {
    box-shadow: 0 0 0 2px #ffffff;
    cursor: default;
    opacity: 1;
}

.site-message {
    border-radius: 10px;
    padding: .7rem 1rem;
    margin-bottom: .5rem;
    background-color: #EEF2EC;
    border: 1px solid #C9D3C6;
    color: #2C5E3B;
    font-weight: 600;
}

.site-message-error {
    background-color: #FBE9E4;
    border-color: #E7B9AC;
    color: #8A3A26;
}

/* Small auth forms (log in, sign up, password) */
.auth-card {
    max-width: 28rem;
    margin: 2rem auto;
}

.auth-card .form-text,
.auth-card .helptext,
.auth-card ul {
    font-size: .85rem;
    color: #5E6B62;
}

.errorlist,
.auth-card .errorlist {  /* not the grey of the help texts above */
    list-style: none;
    padding: 0;
    margin: .25rem 0 0;
    color: #8A3A26;
    font-size: .9rem;
    font-weight: 600;
}

/* Ingredient rows in the personal recipe form */
.ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(4.5rem, 1fr) minmax(5.5rem, 1fr) auto;
    gap: .5rem;
    align-items: start;
    margin-bottom: .5rem;
}

@media (max-width: 575.98px) {
    .ingredient-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }

    .ingredient-row .ingredient-name {
        grid-column: 1 / -1;
    }
}

.ingredient-row .remove-row {
    padding-top: .45rem;
    white-space: nowrap;
    font-size: .9rem;
}

.ingredient-row .remove-row input {
    margin-right: .25rem;
}

/* Second line of a row: the optional note and part. */
.ingredient-row .ingredient-extra {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: .5rem;
    margin-top: -.25rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(74, 107, 83, .15);
}

/* Share page: the invite link and its Copy button side by side. */
.invite-copy {
    display: flex;
    gap: .5rem;
}
.invite-copy .form-control {
    min-width: 0;
}

/* My recipes: a placeholder letter when a recipe has no photo. */
.feature-card .no-photo,
.recipe-card .no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    background-color: #EEF2EC;
    color: #4A6B53;
    font-family: Lora, Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Planner cards: the member's recipe fills the photo slot. */
.recipe-card .no-photo {
    aspect-ratio: auto;
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
}

/* Member recipe form: allergen tick boxes in a wrapping row. */
.allergen-choices {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
}
.allergen-choices .form-check-input {
    margin-right: .3rem;
}

/* Site recipe page: save to / copy into a member's cookbook. */
.save-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.save-box .form-select {
    width: auto;
    max-width: 14rem;
}

/* Member recipe form: ingredient suggestions while typing (members/recipe_form.js). */
.ingredient-row .ingredient-name {
    position: relative;
}
.ingredient-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-y: auto;
    margin: 0;
    padding: .25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(74, 107, 83, .35);
    border-radius: .375rem;
    box-shadow: 0 8px 20px rgba(44, 94, 59, .15);
}
.ingredient-suggestions[hidden] {
    display: none;
}
.ingredient-suggestions [role=option] {
    padding: .4rem .75rem;
    cursor: pointer;
}
.ingredient-suggestions [role=option]:hover,
.ingredient-suggestions [role=option][aria-selected=true] {
    background: #E8EFE9;
    color: #2C5E3B;
}

/* My recipes: search and filters. */
.my-search {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: end;
}
.my-search-buttons {
    display: flex;
    gap: .5rem;
}
@media (max-width: 767.98px) {
    .my-search {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .my-search > div:first-child,
    .my-search-buttons {
        grid-column: 1 / -1;
    }
}
.plan-chips .chip {
    margin: 0 .35rem .35rem 0;
}

/* Site recipe page: the member's private note. */
.private-note summary {
    cursor: pointer;
    width: fit-content;
}

/* Saved meal plan: the shopping list to tick off. */
.shopping-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0 .6rem;
    align-items: baseline;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(74, 107, 83, .15);
}
.shopping-item .form-check-input {
    margin: 0;
    width: 1.25rem;
    height: 1.25rem;
    align-self: center;
}
.shopping-item .shopping-amount {
    font-weight: 600;
    color: #2C5E3B;
    white-space: nowrap;
}
.shopping-item.is-done label,
.shopping-item.is-done .shopping-amount {
    text-decoration: line-through;
    color: #6C7A70;
}

/* Recipe cards: a site recipe the member saved. */
.saved-mark {
    color: #2C5E3B;
    font-weight: 600;
    white-space: nowrap;
}

/* Link-style buttons in the site's green, not Bootstrap's blue (red ones keep text-terracotta). */
main .btn-link {
    color: #4A6B53;
}
main .btn-link:hover {
    color: #2C5E3B;
}


/* Save plan panel above a planner's shopping list (members/_save_plan_button.html): it opens under
   the card header, across its width, so it fits on phones too. */
.save-plan-menu > summary { list-style: none; }
.save-plan-menu > summary::-webkit-details-marker { display: none; }
.save-plan-menu[open] > summary { box-shadow: 0 0 0 .2rem rgba(74, 107, 83, .25) !important; }
.save-plan-panel {
    position: absolute;
    top: 100%;
    left: .75rem;
    right: .75rem;
    z-index: 20;
    background: #fff;
    border: 1px solid #4A6B53;
    border-radius: .5rem;
    padding: .75rem;
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .12);
}
.save-plan-taken { color: #8A4B2F; }

/* A card the page comes back to after one of its buttons (e.g. a plan's "Share it"): a little room above it. */
.scroll-target { scroll-margin-top: 1rem; }

/* Saved plan: notes on shopping list items, the list and chat tabs, and the chat (members/plan.js). */
.item-note-row { grid-column: 2 / -1; font-size: .85rem; }
.shopping-item.is-done .item-note-row { display: none; }
.item-note { margin: .1rem 0 0; color: #4A5A4F; background: #F1EFE9; border-radius: .4rem; padding: .1rem .5rem; display: inline-block; }
.item-note-who { font-weight: 600; color: #2C5E3B; }
.item-note-edit > summary { list-style: none; cursor: pointer; color: #4A6B53; font-size: .8rem; display: inline-block; }
.item-note-edit > summary::-webkit-details-marker { display: none; }
.item-note-edit[open] > summary { display: none; }
.item-note-fields { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .25rem; }
.item-note-fields input { flex: 1 1 10rem; min-width: 0; }

.plan-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: .75rem; border-bottom: 1px solid rgba(74, 107, 83, .25); }
.plan-tabs [role=tab] { background: none; border: 0; border-bottom: 3px solid transparent; padding: .5rem; font-weight: 600; color: #6C7A70; }
.plan-tabs [role=tab][aria-selected=true] { color: #2C5E3B; border-bottom-color: #4A6B53; }
.plan-tabs [role=tab]:focus-visible { outline: 2px solid #4A6B53; outline-offset: 2px; }
.chat-unread { background: #B8603F; color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .45rem; margin-left: .25rem; }
.plan-tabs:not([hidden]) ~ .plan-chat-card { margin-top: 0 !important; }

.plan-chat { max-height: 24rem; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; padding: .25rem; }
.chat-msg { max-width: 85%; align-self: flex-start; background: #F1EFE9; border-radius: .8rem .8rem .8rem .25rem; padding: .35rem .7rem; }
.chat-msg.is-mine { align-self: flex-end; background: #E3EEE5; border-radius: .8rem .8rem .25rem .8rem; }
.chat-who { display: block; font-size: .75rem; color: #6C7A70; font-weight: 600; }
.chat-text { white-space: pre-line; overflow-wrap: anywhere; }
.chat-delete { display: inline; margin-left: .4rem; }
.chat-delete .btn { font-size: .75rem; color: #6C7A70; }
.chat-empty { align-self: center; padding: 1rem 0; }
.chat-compose { display: flex; gap: .5rem; align-items: flex-end; }
.chat-compose textarea { resize: vertical; min-height: 2.6rem; }
.chat-error { color: #8A4B2F; }

/* Automatic planner, "Recipes to use": a cookbook with no usable mains, and the hint (white on the sage menu). */
.planner-sources .dropdown-menu { min-width: 16rem; }
.planner-sources .source-empty { opacity: .6; }
.planner-sources .source-count { font-variant-numeric: tabular-nums; }
.planner-sources .source-hint { color: #fff; opacity: .85; max-width: 17rem; }

/* A plan's or cookbook's name, changed where it stands (members/rename_title.js). */
.rename-title h1.is-editable { cursor: text; display: inline-flex; align-items: baseline; gap: .35rem; }
.rename-title h1.is-editable .rename-title-text { border-bottom: 2px dashed transparent; }
.rename-title h1.is-editable:hover .rename-title-text { border-bottom-color: rgba(74, 107, 83, .45); }
.rename-title-start { font-size: 1.1rem; color: #4A6B53; padding: 0 .2rem; text-decoration: none; }
.rename-title-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; max-width: 36rem; }
.rename-title-form input { flex: 1 1 14rem; min-width: 0; font-family: Lora, Georgia, serif; color: #2C5E3B; }

/* Recipes menu: "More categories" folds out the rest; its caret turns when open. */
.more-categories-caret {
    display: inline-block;
    transition: transform .2s;
}
.more-categories-toggle[aria-expanded="true"] .more-categories-caret {
    transform: rotate(180deg);
}

/* Under the recipe's title: its stars and when it was last updated. */
.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    color: #5E6B62;
    font-size: .95rem;
}
.recipe-meta a {
    color: #2C5E3B;
    text-decoration: none;
    font-weight: 600;
}
.recipe-meta a:hover { text-decoration: underline; }

/* Stars: a rating (custom_filters.star_marks) and the picker in the review form. */
.stars {
    color: #C98A1B;
    letter-spacing: .05em;
    white-space: nowrap;
}
.stars-off { color: #D9D2C3; }

/* Reviews at the bottom of a recipe (partials/_reviews.html). */
.review-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    background-color: #EEF2EC;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.review-score {
    display: grid;
    justify-items: start;
    gap: .15rem;
}
.review-average {
    font-family: Lora, Georgia, serif;
    font-size: 2.4rem;
    line-height: 1;
    color: #2C5E3B;
}
.review-bars {
    flex: 1 1 14rem;
    max-width: 22rem;
    margin: 0;
    display: grid;
    gap: .15rem;
    font-size: .85rem;
    color: #5E6B62;
    font-variant-numeric: tabular-nums;
}
.review-bars > div {
    display: grid;
    grid-template-columns: 1.8rem minmax(0, 1fr);
    align-items: center;
}
.review-bars dt { font-weight: 400; }
.review-bars dd {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.6rem;
    gap: .5rem;
    align-items: center;
}
.review-bars progress {
    width: 100%;
    height: .5rem;
    appearance: none;
    border: 0;
    border-radius: 4px;
    background-color: #D5DED3;
    overflow: hidden;
}
.review-bars progress::-webkit-progress-bar { background-color: #D5DED3; }
.review-bars progress::-webkit-progress-value { background-color: #C98A1B; }
.review-bars progress::-moz-progress-bar { background-color: #C98A1B; }
.review-bars dd span { text-align: right; }

.review-form {
    border: 1px solid #D5DED3;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background-color: #ffffff;
}
.star-picker {
    border: 0;
    padding: 0;
    margin: 0;
}
/* Highest first in the page, shown lowest first: a chosen or pointed star lights up those before it. */
.star-picker-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: .1rem;
}
.star-picker-stars input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.star-picker-stars label {
    font-size: 1.9rem;
    line-height: 1;
    color: #D9D2C3;
    cursor: pointer;
    padding: 0 .05rem;
    border-radius: 4px;
}
.star-picker-stars input:checked ~ label,
.star-picker-stars label:hover,
.star-picker-stars label:hover ~ label {
    color: #C98A1B;
}
.star-picker-stars input:focus-visible + label {
    outline: 2px solid #2C5E3B;
    outline-offset: 2px;
}

.review-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}
.review {
    display: grid;
    gap: .35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #D5DED3;
    scroll-margin-top: 5rem;
}
.review:last-child { border-bottom: 0; }
.review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .7rem;
}
.review-text { overflow-wrap: anywhere; }
.review-reply {
    margin-left: 1rem;
    border-left: 3px solid #2C5E3B;
    background-color: #EEF2EC;
    border-radius: 0 8px 8px 0;
    padding: .6rem .9rem;
    overflow-wrap: anywhere;
}
.review-badge {
    background-color: #2C5E3B;
    color: #ffffff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 4px;
    padding: .05rem .45rem;
}
.review-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .25rem 1.1rem;
    font-size: .9rem;
}
.review-actions a,
.review-action summary,
.review-report {
    color: #4A6B53;
    font-weight: 600;
    text-decoration: none;
    font-size: .9rem;
}
.review-action summary {
    cursor: pointer;
    width: fit-content;
}
.review-action[open] { flex-basis: 100%; }
.review-action summary.review-delete { color: #8A3A26; }
.btn-delete {
    background-color: #8A3A26;
    color: #ffffff;
}
.btn-delete:hover,
.btn-delete:focus-visible {
    background-color: #6E2D1D;
    color: #ffffff;
}

