/* -------------------------------------------------------------------------- */
/* Step 23A - Compact recipe editor                                            */
/* Samsung-Food-inspired interaction pattern, Beast Recipes visual language.   */
/* -------------------------------------------------------------------------- */

.br-sf-editor {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
    padding: 8px 4px 22px;
}

.br-builder-ingredient-layout > div:first-child .br-sf-editor {
    max-width: none;
}

.br-sf-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 13px;
}

.br-sf-section-header h2 {
    margin: 0;
    color: var(--br-ink);
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.br-sf-section-header p {
    margin: 4px 0 0;
    color: var(--br-muted);
    font-size: 0.74rem;
}

.br-sf-reorder-toggle {
    padding: 5px 2px;
    color: var(--br-orange);
    background: transparent;
    border: 0;
    font-size: 0.75rem;
    font-weight: 850;
}

.br-sf-reorder-toggle:hover,
.br-sf-reorder-toggle.is-active {
    color: var(--br-orange-dark);
}

.br-sf-empty {
    padding: 18px 0;
    color: var(--br-muted);
    border-top: 1px solid var(--br-border);
    border-bottom: 1px solid var(--br-border);
    font-size: 0.8rem;
}

.br-sf-list,
.br-sf-step-list {
    display: flex;
    flex-direction: column;
}

.br-sf-row,
.br-sf-step-row {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    background: transparent;
    border-bottom: 1px solid #ecefea;
}

.br-sf-row:last-child,
.br-sf-step-row:last-child {
    border-bottom: 0;
}

.br-sf-row:hover,
.br-sf-step-row:hover {
    background: rgba(242, 247, 243, 0.68);
}

.br-sf-row-main,
.br-sf-step-main {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 42px 9px 4px;
    color: var(--br-text);
    background: transparent;
    border: 0;
    text-align: left;
}

.br-sf-food-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-right: 12px;
    color: var(--br-green-900);
    background:
        linear-gradient(
            135deg,
            var(--br-lime-soft),
            #f7fbef
        );
    border: 1px solid #dce8ce;
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 900;
}

.br-sf-row-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.br-sf-primary-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.br-sf-amount {
    flex: 0 0 auto;
    color: var(--br-ink);
    font-size: 0.85rem;
    font-weight: 900;
}

.br-sf-item-name {
    color: var(--br-ink);
    font-size: 0.84rem;
    font-weight: 600;
}

.br-sf-optional {
    padding: 2px 6px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 800;
}

.br-sf-secondary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 9px;
    margin-top: 3px;
    color: var(--br-muted);
    font-size: 0.68rem;
}

.br-sf-secondary-line > span + span::before {
    margin-right: 9px;
    color: #b5bbb7;
    content: "•";
}

.br-sf-remove-form {
    position: absolute;
    top: 50%;
    right: 3px;
    z-index: 2;
    transform: translateY(-50%);
}

.br-sf-remove-button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #a6ada9;
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0;
    transition:
        color 120ms ease,
        background-color 120ms ease,
        opacity 120ms ease;
}

.br-sf-row:hover .br-sf-remove-button,
.br-sf-step-row:hover .br-sf-remove-button,
.br-sf-remove-button:focus-visible {
    opacity: 1;
}

.br-sf-remove-button:hover {
    color: var(--br-danger);
    background: #fff0ef;
}

.br-sf-reorder-tools {
    display: none;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    margin-right: 7px;
}

.is-reordering .br-sf-reorder-tools {
    display: flex;
}

.is-reordering .br-sf-food-icon {
    margin-left: 2px;
}

.br-sf-drag,
.br-sf-move {
    display: grid;
    place-items: center;
    width: 27px;
    height: 29px;
    padding: 0;
    color: var(--br-muted);
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 7px;
    font-size: 0.66rem;
}

.br-sf-drag {
    cursor: grab;
}

.br-sf-drag:active {
    cursor: grabbing;
}

.br-sf-move {
    display: none;
}

.is-reordering .br-sf-move {
    display: grid;
}

.br-sf-drag {
    color: var(--br-green-900);
    background: var(--br-green-050);
    border-color: #ceddce;
}

.br-sf-add-line {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 43px;
    margin-top: 15px;
    padding: 8px 10px;
    color: #8b938f;
    background: #fff;
    border: 1px solid var(--br-border-strong);
    border-radius: 8px;
    text-align: left;
    font-size: 0.76rem;
}

.br-sf-add-line:hover {
    color: var(--br-green-900);
    border-color: #b8c8bc;
}

.br-sf-add-plus {
    color: var(--br-orange);
    font-size: 1.12rem;
    font-weight: 500;
}

.br-sf-add-hint {
    margin-left: auto;
    color: #a0a7a3;
    font-size: 0.62rem;
}

.br-sf-add-form {
    margin-top: 9px;
    padding: 15px;
    background: #f8faf7;
    border: 1px solid var(--br-border);
    border-radius: 9px;
}

.br-sf-add-form .br-add-ingredient-form,
.br-sf-add-form .br-add-instruction-form {
    margin: 0;
}

.br-sf-add-subactions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 9px;
}

.br-sf-group-create-panel {
    flex: 1 1 100%;
    align-items: center;
    gap: 7px;
    width: min(520px, 100%);
    max-width: 520px;
    margin-top: 0;
}

.br-sf-group-create-panel.show,
.br-sf-group-create-panel.collapsing {
    display: flex;
}

.br-sf-group-create-panel .form-control {
    min-width: 0;
    height: 36px;
    font-size: 0.78rem;
}

.br-sf-group-create-button,
.br-sf-group-create-cancel {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

.br-sf-group-create-button {
    color: #fff;
    background: var(--br-green-900);
    border: 1px solid var(--br-green-900);
}

.br-sf-group-create-cancel {
    color: var(--br-text);
    background: #fff;
    border: 1px solid var(--br-border-strong);
}

.br-sf-empty-group-drop-hint {
    display: none;
    place-items: center;
    min-height: 44px;
    color: var(--br-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.br-sf-ingredient-group.is-new-group.is-empty
.br-sf-empty-group-drop-hint,
.is-reordering .br-sf-ingredient-group.is-empty
.br-sf-empty-group-drop-hint {
    display: grid;
}

.br-sf-ingredient-group.is-group-focus {
    background: #fffaf3;
    border-color: var(--br-orange);
}

.br-sf-text-action {
    padding: 4px 2px;
    color: var(--br-orange);
    background: transparent;
    border: 0;
    font-size: 0.72rem;
    font-weight: 750;
}

/* Compact instructions */
.br-sf-instructions-editor {
    max-width: 800px;
}

.br-sf-step-group + .br-sf-step-group {
    margin-top: 20px;
}

.br-sf-ingredient-group.is-empty {
    display: none;
}

.br-sf-ingredient-group.is-empty.is-new-group,
.is-reordering .br-sf-ingredient-group.is-empty {
    display: block;
}

.br-sf-ingredient-group.is-empty .ingredient-sort-list {
    min-height: 46px;
    border: 1px dashed var(--br-border-strong);
    border-radius: 8px;
}

.is-reordering .br-sf-ingredient-group {
    padding: 8px;
    margin-inline: -8px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition:
        border-color 120ms ease,
        background-color 120ms ease;
}

.is-reordering .br-sf-ingredient-list {
    min-height: 46px;
}

.is-dragging-ingredient .br-sf-ingredient-group {
    border-color: var(--br-border);
}

.is-dragging-ingredient .br-sf-ingredient-group.is-drag-over {
    background: #fff7ed;
    border-color: var(--br-orange);
}

.is-dragging-ingredient .br-sf-ingredient-group.is-drag-over .br-sf-step-group-title::after {
    content: " · Drop here";
    color: var(--br-orange);
    font-size: 0.68rem;
    font-weight: 750;
}

.br-sf-step-group-title {
    margin: 0 0 5px;
    color: var(--br-ink);
    font-size: 0.82rem;
    font-weight: 850;
}

.br-sf-step-main {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 11px;
    padding-bottom: 11px;
}

.br-sf-step-label {
    color: var(--br-ink);
    font-size: 0.76rem;
    font-weight: 900;
}

.br-sf-step-text {
    margin-top: 3px;
    color: var(--br-text);
    font-size: 0.82rem;
    line-height: 1.45;
}

.br-sf-step-timer {
    margin-top: 4px;
    color: var(--br-muted);
    font-size: 0.66rem;
}

/* Keep the compact list centered, like a focused recipe editor. */
[data-builder-panel="instructions"] {
    max-width: 860px;
    margin-inline: auto;
}

[data-builder-panel="ingredients"] .br-builder-ingredient-layout {
    grid-template-columns: minmax(0, 1fr) 245px;
    max-width: 990px;
    margin-inline: auto;
}

/* Reordering should look deliberate, not like the UI broke. */
.is-reordering .br-sf-row,
.is-reordering .br-sf-step-row {
    background: #fbfcfa;
}

.is-reordering .br-sf-remove-button {
    display: none;
}

@media (max-width: 991.98px) {
    [data-builder-panel="ingredients"] .br-builder-ingredient-layout {
        grid-template-columns: 1fr;
        max-width: 800px;
    }

    .br-sf-editor {
        max-width: 800px;
    }
}

@media (max-width: 575.98px) {
    .br-sf-editor {
        padding-inline: 0;
    }

    .br-sf-section-header h2 {
        font-size: 1.2rem;
    }

    .br-sf-row-main {
        padding-right: 34px;
    }

    .br-sf-food-icon {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        margin-right: 9px;
    }

    .br-sf-add-hint {
        display: none;
    }

    .br-sf-reorder-tools {
        gap: 2px;
    }

    .br-sf-drag,
    .br-sf-move {
        width: 25px;
    }

    .br-sf-step-text {
        font-size: 0.78rem;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 24 - TheMealDB ingredient artwork                                     */
/* -------------------------------------------------------------------------- */

.br-sf-food-icon {
    overflow: hidden;
    background: #fff;
}

.br-sf-food-icon img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 2px;
    object-fit: contain;
}

.br-sf-food-icon-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--br-green-900);
    background:
        linear-gradient(
            135deg,
            var(--br-lime-soft),
            #f7fbef
        );
    font-size: 0.76rem;
    font-weight: 900;
}

.br-sf-food-icon-fallback[hidden] {
    display: none;
}


/* -------------------------------------------------------------------------- */
/* Step 24A - Searchable ingredient picker                                     */
/* -------------------------------------------------------------------------- */

.br-ingredient-picker-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.br-new-ingredient-link {
    margin-bottom: 5px;
    color: var(--br-orange);
    font-size: 0.68rem;
    font-weight: 850;
}

.br-new-ingredient-link:hover {
    color: var(--br-orange-dark);
}

.br-ingredient-picker {
    position: relative;
}

.br-ingredient-picker > .form-control {
    padding-right: 38px;
    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            var(--br-muted) 50%
        ),
        linear-gradient(
            135deg,
            var(--br-muted) 50%,
            transparent 50%
        );
    background-position:
        calc(100% - 17px) 18px,
        calc(100% - 12px) 18px;
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

.br-ingredient-search-results {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 330px;
    padding: 6px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 10px;
    box-shadow:
        0 14px 32px rgba(18, 33, 28, 0.14);
}

.br-ingredient-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    color: var(--br-text);
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
}

.br-ingredient-search-result:hover,
.br-ingredient-search-result.is-active {
    color: var(--br-green-950);
    background: var(--br-green-050);
}

.br-ingredient-search-name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.76rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.br-ingredient-search-shared {
    flex: 0 0 auto;
    padding: 3px 6px;
    color: var(--br-green-800);
    background: var(--br-lime-soft);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 850;
}

.br-ingredient-search-empty {
    padding: 11px 10px;
    color: var(--br-muted);
    font-size: 0.72rem;
}

.br-ingredient-search-create {
    display: block;
    margin-top: 5px;
    padding: 9px 10px;
    color: var(--br-orange);
    border-top: 1px solid var(--br-border);
    border-radius: 0 0 7px 7px;
    font-size: 0.72rem;
    font-weight: 850;
}

.br-ingredient-search-create:hover {
    color: var(--br-orange-dark);
    background: var(--br-orange-soft);
}

@media (max-width: 575.98px) {
    .br-ingredient-search-results {
        max-height: 270px;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 24B - USDA-first custom ingredient flow                               */
/* -------------------------------------------------------------------------- */

.br-usda-custom-fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 17px 18px;
    background:
        linear-gradient(
            135deg,
            var(--br-green-050),
            #fbfcf8
        );
    border: 1px solid #d7e4d9;
    border-radius: 11px;
}

.br-usda-custom-fallback h3 {
    margin: 1px 0 0;
    color: var(--br-ink);
    font-size: 1rem;
    font-weight: 850;
}

.br-usda-custom-fallback p {
    max-width: 620px;
    margin: 5px 0 0;
    color: var(--br-muted);
    font-size: 0.73rem;
}

@media (max-width: 767.98px) {
    .br-usda-custom-fallback {
        align-items: stretch;
        flex-direction: column;
    }

    .br-usda-custom-fallback .btn {
        width: 100%;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 25 - Recipe view / preview                                             */
/* -------------------------------------------------------------------------- */

.br-recipe-view {
    max-width: 1180px;
    margin-inline: auto;
}

.br-recipe-view-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
    color: var(--br-muted);
    font-size: 0.68rem;
}

.br-recipe-view-breadcrumb a {
    font-weight: 750;
}

.br-recipe-view-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 14px;
    box-shadow: var(--br-shadow-soft);
}

.br-recipe-view-photo {
    min-height: 455px;
    background: var(--br-green-050);
}

.br-recipe-view-photo > img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 455px;
    object-fit: cover;
}

.br-recipe-view-photo-empty {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 455px;
    gap: 10px;
    color: var(--br-muted);
}

.br-recipe-view-photo-empty img {
    width: 140px;
    height: 120px;
    object-fit: contain;
    opacity: 0.6;
}

.br-recipe-view-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 40px);
}

.br-recipe-view-status,
.br-recipe-view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.br-recipe-view-status > span,
.br-recipe-view-tags > span {
    padding: 5px 8px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.br-recipe-view-status .br-recipe-owner-status {
    color: var(--br-orange-dark);
    background: var(--br-orange-soft);
}

.br-recipe-view-summary h1 {
    margin: 12px 0 0;
    color: var(--br-ink);
    font-family:
        "Arial Narrow",
        "Roboto Condensed",
        "Segoe UI",
        sans-serif;
    font-size: clamp(2.2rem, 4.2vw, 4rem);
    font-weight: 950;
    line-height: 0.94;
    letter-spacing: -0.045em;
}

.br-recipe-view-description {
    margin: 13px 0 0;
    color: var(--br-text);
    font-size: 0.88rem;
    line-height: 1.55;
}

.br-recipe-view-author {
    margin-top: 12px;
    color: var(--br-muted);
    font-size: 0.68rem;
}

.br-recipe-view-author strong {
    color: var(--br-ink);
}

.br-recipe-view-tags {
    margin-top: 13px;
}

.br-recipe-view-time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 22px;
    border-top: 1px solid var(--br-border);
    border-bottom: 1px solid var(--br-border);
}

.br-recipe-view-time-grid > div {
    padding: 13px 7px;
    text-align: center;
}

.br-recipe-view-time-grid > div:not(:last-child) {
    border-right: 1px solid var(--br-border);
}

.br-recipe-view-time-grid strong,
.br-recipe-view-time-grid span {
    display: block;
}

.br-recipe-view-time-grid strong {
    color: var(--br-ink);
    font-size: 1rem;
}

.br-recipe-view-time-grid span {
    margin-top: 2px;
    color: var(--br-muted);
    font-size: 0.6rem;
}

.br-recipe-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.br-share-status {
    min-height: 18px;
    margin-top: 7px;
    color: var(--br-green-700);
    font-size: 0.65rem;
}

.br-recipe-view-tabs {
    position: sticky;
    top: 76px;
    z-index: 16;
    display: flex;
    gap: 2px;
    margin: 13px 0;
    padding: 5px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--br-border);
    border-radius: 10px;
    box-shadow: var(--br-shadow-soft);
    backdrop-filter: blur(8px);
}

.br-recipe-view-tabs button {
    flex: 0 0 auto;
    padding: 9px 13px;
    color: var(--br-text);
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 0.73rem;
    font-weight: 850;
}

.br-recipe-view-tabs button:hover {
    background: var(--br-green-050);
}

.br-recipe-view-tabs button.is-active {
    color: #fff;
    background: var(--br-green-900);
}

.br-recipe-view-panel[hidden] {
    display: none !important;
}

.br-recipe-view-panel {
    padding: 19px;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 12px;
    box-shadow: var(--br-shadow-soft);
}

.br-recipe-view-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 24px;
    align-items: start;
}

.br-recipe-view-single-column {
    max-width: 820px;
    margin-inline: auto;
}

.br-recipe-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 13px;
}

.br-recipe-section-heading h2 {
    margin: 0;
    color: var(--br-ink);
    font-size: 1.35rem;
    font-weight: 900;
}

.br-serving-control {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--br-muted);
    font-size: 0.67rem;
}

.br-serving-stepper {
    display: grid;
    grid-template-columns: 34px 58px 34px;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--br-border-strong);
    border-radius: 8px;
}

.br-serving-stepper button,
.br-serving-stepper input {
    height: 100%;
    border: 0;
    background: #fff;
    text-align: center;
}

.br-serving-stepper button {
    color: var(--br-green-900);
    font-size: 1rem;
    font-weight: 800;
}

.br-serving-stepper button:hover {
    background: var(--br-green-050);
}

.br-serving-stepper input {
    width: 100%;
    color: var(--br-ink);
    border-right: 1px solid var(--br-border);
    border-left: 1px solid var(--br-border);
    font-size: 0.75rem;
    font-weight: 850;
    -moz-appearance: textfield;
}

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

.br-scaling-note {
    margin-bottom: 8px;
    padding: 9px 10px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 8px;
    font-size: 0.65rem;
}

.br-view-ingredient-list {
    display: flex;
    flex-direction: column;
}

.br-view-ingredient-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 54px;
    padding: 8px 2px;
    border-bottom: 1px solid #edf0ec;
}

.br-view-food-image {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    overflow: hidden;
    color: var(--br-green-900);
    background: var(--br-green-050);
    border: 1px solid #dfe9df;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
}

.br-view-food-image img,
.br-view-food-image > span {
    width: 100%;
    height: 100%;
}

.br-view-food-image img {
    padding: 2px;
    object-fit: contain;
}

.br-view-food-image > span {
    display: grid;
    place-items: center;
}

.br-view-ingredient-copy {
    min-width: 0;
}

.br-view-ingredient-primary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.br-view-ingredient-primary strong {
    color: var(--br-ink);
    font-size: 0.82rem;
}

.br-view-unit {
    color: var(--br-text);
    font-size: 0.72rem;
}

.br-view-ingredient-name {
    margin-left: 4px;
    color: var(--br-ink);
    font-size: 0.8rem;
    font-weight: 600;
}

.br-view-optional {
    padding: 2px 6px;
    color: var(--br-green-800);
    background: var(--br-lime-soft);
    border-radius: 999px;
    font-size: 0.53rem;
    font-weight: 800;
}

.br-view-ingredient-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 9px;
    margin-top: 2px;
    color: var(--br-muted);
    font-size: 0.64rem;
}

.br-view-ingredient-secondary span + span::before {
    margin-right: 9px;
    content: "•";
}

.br-view-ingredient-group,
.br-view-instruction-group {
    margin-top: 21px;
}

.br-view-ingredient-group > h3,
.br-view-instruction-group > h3 {
    margin: 0 0 5px;
    color: var(--br-green-800);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.br-recipe-nutrition-card {
    position: sticky;
    top: 142px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 10px;
    box-shadow: var(--br-shadow-soft);
}

.br-recipe-nutrition-serving-label {
    color: var(--br-muted);
    font-size: 0.62rem;
}

.br-recipe-calories {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
    padding: 7px 0 10px;
    border-bottom: 2px solid var(--br-ink);
}

.br-recipe-calories span {
    color: var(--br-ink);
    font-size: 0.79rem;
    font-weight: 850;
}

.br-recipe-calories strong {
    color: var(--br-ink);
    font-size: 1.5rem;
}

.br-recipe-nutrition-list {
    margin: 0 0 9px;
}

.br-recipe-nutrition-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #edf0ec;
}

.br-recipe-nutrition-list dt,
.br-recipe-nutrition-list dd {
    margin: 0;
    font-size: 0.66rem;
}

.br-recipe-nutrition-list dt {
    color: var(--br-muted);
    font-weight: 650;
}

.br-recipe-nutrition-list dd {
    color: var(--br-ink);
    font-weight: 850;
}

.br-view-instruction-list {
    display: flex;
    flex-direction: column;
}

.br-view-instruction-row {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid var(--br-border);
}

.br-view-step-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: var(--br-green-900);
    border-radius: 50%;
    font-size: 0.73rem;
    font-weight: 900;
}

.br-view-instruction-row p {
    margin: 5px 0 0;
    color: var(--br-text);
    font-size: 0.84rem;
    line-height: 1.55;
}

.br-view-timer {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 6px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 6px;
    font-size: 0.59rem;
    font-weight: 750;
}

.br-full-nutrition-table {
    overflow: hidden;
    border: 1px solid var(--br-border);
    border-radius: 10px;
}

.br-full-nutrition-head,
.br-full-nutrition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 150px;
    gap: 12px;
    align-items: center;
    padding: 10px 13px;
}

.br-full-nutrition-head {
    color: var(--br-muted);
    background: #f7f8f5;
    font-size: 0.62rem;
    font-weight: 850;
    text-transform: uppercase;
}

.br-full-nutrition-row {
    border-top: 1px solid var(--br-border);
    font-size: 0.72rem;
}

.br-full-nutrition-row > span:first-child {
    color: var(--br-text);
}

.br-full-nutrition-row strong {
    color: var(--br-ink);
}

.br-nutrition-current-batch {
    color: var(--br-muted);
    font-size: 0.69rem;
}

.br-recipe-view-empty {
    padding: 28px;
    color: var(--br-muted);
    background: var(--br-green-050);
    border-radius: 9px;
    text-align: center;
    font-size: 0.76rem;
}

@media (max-width: 991.98px) {
    .br-recipe-view-hero {
        grid-template-columns: 1fr;
    }

    .br-recipe-view-photo,
    .br-recipe-view-photo > img,
    .br-recipe-view-photo-empty {
        min-height: 360px;
    }

    .br-recipe-view-content-grid {
        grid-template-columns: 1fr;
    }

    .br-recipe-nutrition-card {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .br-recipe-view-photo,
    .br-recipe-view-photo > img,
    .br-recipe-view-photo-empty {
        min-height: 260px;
    }

    .br-recipe-view-summary {
        padding: 21px;
    }

    .br-recipe-view-time-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .br-recipe-view-time-grid > div:nth-child(2) {
        border-right: 0;
    }

    .br-recipe-view-time-grid > div:nth-child(-n+2) {
        border-bottom: 1px solid var(--br-border);
    }

    .br-recipe-view-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .br-recipe-view-actions .btn:first-child:last-child,
    .br-recipe-view-actions .btn:first-child:nth-last-child(3) {
        grid-column: 1 / -1;
    }

    .br-recipe-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .br-serving-control {
        width: 100%;
        justify-content: space-between;
    }

    .br-full-nutrition-head,
    .br-full-nutrition-row {
        grid-template-columns: minmax(0, 1fr) 100px;
    }

    .br-full-nutrition-head > :nth-child(3),
    .br-full-nutrition-row > :nth-child(3) {
        display: none;
    }
}

@media print {
    .br-site-header,
    .br-site-footer,
    .br-recipe-view-breadcrumb,
    .br-recipe-view-tabs,
    .br-recipe-view-actions,
    .br-serving-control,
    .br-scaling-note,
    .br-share-status {
        display: none !important;
    }

    body.br-body,
    .br-page-frame {
        background: #fff !important;
    }

    .br-recipe-view {
        max-width: none;
    }

    .br-recipe-view-hero,
    .br-recipe-view-panel {
        border: 0;
        box-shadow: none;
    }

    .br-recipe-view-panel {
        display: block !important;
        padding-inline: 0;
    }

    .br-recipe-view-photo {
        min-height: 300px;
    }

    .br-recipe-view-photo > img {
        min-height: 300px;
        max-height: 420px;
    }

    .br-recipe-nutrition-card {
        position: static;
        box-shadow: none;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 25A - Continuous recipe flow                                           */
/* -------------------------------------------------------------------------- */

.br-flow-recipe {
    max-width: 1080px;
    margin-inline: auto;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 14px;
    box-shadow: var(--br-shadow-soft);
}

.br-flow-header {
    padding: 24px 28px 8px;
}

.br-flow-brandline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.br-flow-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.br-flow-intro {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}

.br-flow-cover {
    width: 205px;
    height: 205px;
    overflow: hidden;
    background: var(--br-green-050);
    border-radius: 12px;
}

.br-flow-cover > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.br-flow-cover-empty {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.br-flow-cover-empty img {
    width: 125px;
    height: 105px;
    object-fit: contain;
    opacity: 0.55;
}

.br-flow-author {
    color: var(--br-ink);
    font-size: 0.72rem;
    font-weight: 800;
}

.br-flow-intro-copy h1 {
    margin: 3px 0 0;
    color: var(--br-ink);
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.045em;
}

.br-flow-intro-copy > p {
    max-width: 720px;
    margin: 9px 0 0;
    color: var(--br-text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.br-flow-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 15px;
    margin-top: 13px;
    color: var(--br-muted);
    font-size: 0.66rem;
}

.br-flow-meta strong {
    color: var(--br-ink);
}

.br-flow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 12px;
}

.br-flow-tags span {
    padding: 4px 7px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 800;
}

.br-flow-section {
    margin: 0 28px;
    padding: 23px 0;
    border-top: 1px solid var(--br-border);
}

.br-flow-section:last-child {
    padding-bottom: 34px;
}

.br-flow-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.br-flow-section-heading h2 {
    margin: 0;
    color: var(--br-ink);
    font-size: 1.25rem;
    font-weight: 900;
}

.br-flow-section-note {
    margin: 3px 0 0;
    color: var(--br-muted);
    font-size: 0.67rem;
}

.br-flow-serving-control {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--br-muted);
    font-size: 0.67rem;
}

.br-flow-ingredient-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 30px;
    row-gap: 5px;
}

.br-flow-ingredient-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 0;
}

.br-flow-ingredient-image {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    overflow: hidden;
    color: var(--br-green-900);
    background: var(--br-green-050);
    border-radius: 50%;
    font-size: 0.64rem;
    font-weight: 900;
}

.br-flow-ingredient-image img,
.br-flow-ingredient-image > span {
    width: 100%;
    height: 100%;
}

.br-flow-ingredient-image img {
    padding: 1px;
    object-fit: contain;
}

.br-flow-ingredient-image > span {
    display: grid;
    place-items: center;
}

.br-flow-ingredient-copy {
    min-width: 0;
}

.br-flow-ingredient-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    color: var(--br-ink);
    font-size: 0.76rem;
    line-height: 1.25;
}

.br-flow-ingredient-primary strong {
    font-weight: 900;
}

.br-flow-ingredient-primary span {
    font-weight: 560;
}

.br-flow-ingredient-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 7px;
    margin-top: 3px;
    color: var(--br-muted);
    font-size: 0.6rem;
}

.br-flow-ingredient-secondary > span + span::before {
    margin-right: 7px;
    content: "•";
}

.br-flow-ingredient-group {
    margin-top: 18px;
}

.br-flow-ingredient-group h3,
.br-flow-instruction-group h3 {
    margin: 0 0 8px;
    color: var(--br-green-800);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.br-flow-instruction-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.br-flow-step strong {
    display: block;
    color: var(--br-ink);
    font-size: 0.75rem;
}

.br-flow-step p {
    margin: 5px 0 0;
    color: var(--br-text);
    font-size: 0.79rem;
    line-height: 1.5;
}

.br-flow-step > span {
    display: inline-block;
    margin-top: 4px;
    color: var(--br-muted);
    font-size: 0.6rem;
}

.br-flow-instruction-group {
    margin-top: 22px;
}

.br-flow-batch-label {
    color: var(--br-muted);
    font-size: 0.65rem;
}

.br-flow-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 26px;
}

.br-flow-nutrition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid #edf0ec;
}

.br-flow-nutrition-row > span {
    color: var(--br-text);
    font-size: 0.68rem;
}

.br-flow-nutrition-row > strong {
    color: var(--br-ink);
    font-size: 0.68rem;
}

.br-flow-nutrition-row > small {
    grid-column: 1 / -1;
    color: var(--br-muted);
    font-size: 0.56rem;
}

.br-flow-community-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 36px;
}

.br-flow-community-summary > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.br-flow-community-summary strong {
    color: var(--br-ink);
    font-size: 1rem;
}

.br-flow-community-summary span {
    color: var(--br-muted);
    font-size: 0.68rem;
}

.br-flow-notes-form textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.55;
}

.br-flow-notes-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 9px;
}

.br-flow-notes-actions > span {
    color: var(--br-muted);
    font-size: 0.62rem;
}

.br-flow-empty {
    padding: 16px;
    color: var(--br-muted);
    background: var(--br-green-050);
    border-radius: 8px;
    font-size: 0.72rem;
}

@media (max-width: 900px) {
    .br-flow-ingredient-grid,
    .br-flow-nutrition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .br-flow-header {
        padding: 18px 18px 6px;
    }

    .br-flow-section {
        margin-inline: 18px;
    }

    .br-flow-brandline {
        align-items: flex-start;
        flex-direction: column;
    }

    .br-flow-intro {
        grid-template-columns: 1fr;
    }

    .br-flow-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .br-flow-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .br-flow-serving-control {
        width: 100%;
        justify-content: space-between;
    }

    .br-flow-ingredient-grid,
    .br-flow-nutrition-grid {
        grid-template-columns: 1fr;
    }

    .br-flow-notes-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .br-flow-notes-actions .btn {
        width: 100%;
    }
}

@media print {
    .br-flow-header-actions,
    .br-flow-serving-control,
    .br-flow-notes-actions button,
    .br-site-header,
    .br-site-footer {
        display: none !important;
    }

    .br-flow-recipe {
        max-width: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .br-flow-section {
        break-inside: avoid;
    }

    .br-flow-section#notes {
        display: none;
    }

    .br-flow-cover {
        width: 160px;
        height: 160px;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 26 - Canonical ingredient artwork admin                               */
/* -------------------------------------------------------------------------- */

.br-artwork-admin-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.br-artwork-current {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--br-green-050);
    border: 1px solid var(--br-border);
    border-radius: 12px;
}

.br-artwork-current img {
    width: 88%;
    height: 88%;
    object-fit: contain;
}

.br-artwork-letter {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    color: var(--br-green-900);
    background: var(--br-lime-soft);
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 950;
}

.br-artwork-source-preview {
    width: 72px;
    height: 72px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 50%;
}

.br-artwork-candidate-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.br-artwork-candidate {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--br-border);
    border-radius: 11px;
}

.br-artwork-candidate-image {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: var(--br-green-050);
}

.br-artwork-candidate-image img {
    width: 88%;
    height: 88%;
    object-fit: contain;
}

.br-artwork-candidate-body {
    padding: 12px;
}

@media (max-width: 767.98px) {
    .br-artwork-admin-grid {
        grid-template-columns: 1fr;
    }

    .br-artwork-admin-grid > .card:first-child {
        max-width: 360px;
        width: 100%;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 26A - Artwork alignment + AI generation progress                      */
/* -------------------------------------------------------------------------- */

.br-artwork-candidates-panel {
    grid-column: 2;
    margin-top: 0;
}

.br-ai-generation-progress {
    margin-top: 12px;
    padding: 12px 13px;
    background: var(--br-green-050);
    border: 1px solid #d8e5da;
    border-radius: 9px;
}

.br-ai-generation-progress[hidden] {
    display: none !important;
}

.br-ai-generation-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--br-ink);
    font-size: 0.72rem;
}

.br-ai-generation-progress-head strong {
    font-weight: 850;
}

.br-ai-generation-progress-head span {
    flex: 0 0 auto;
    color: var(--br-muted);
    font-variant-numeric: tabular-nums;
}

.br-ai-generation-track {
    position: relative;
    height: 7px;
    margin-top: 9px;
    overflow: hidden;
    background: #dfe8e0;
    border-radius: 999px;
}

.br-ai-generation-track > span {
    position: absolute;
    inset-block: 0;
    left: -36%;
    width: 36%;
    background: var(--br-green-800);
    border-radius: inherit;
}

.br-ai-generation-track > span.is-running {
    animation:
        br-ai-progress-slide
        1.2s
        ease-in-out
        infinite;
}

.br-ai-generation-track > span.is-complete {
    left: 0;
    width: 100%;
    animation: none;
}

.br-ai-generation-track > span.is-error {
    left: 0;
    width: 100%;
    animation: none;
    background: #b42318;
}

.br-ai-generation-progress p {
    margin: 8px 0 0;
    color: var(--br-muted);
    font-size: 0.65rem;
    line-height: 1.45;
}

@keyframes br-ai-progress-slide {
    0% {
        left: -36%;
    }

    55% {
        left: 42%;
    }

    100% {
        left: 100%;
    }
}

@media (max-width: 767.98px) {
    .br-artwork-candidates-panel {
        grid-column: 1;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 26B - Ingredient list thumbnails                                      */
/* -------------------------------------------------------------------------- */

.br-ingredient-thumb-heading {
    width: 74px;
}

.br-ingredient-thumb-cell {
    width: 74px;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}

.br-ingredient-list-thumb {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    overflow: hidden;
    color: var(--br-green-900);
    background: var(--br-green-050);
    border: 1px solid #dce6dc;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 900;
}

.br-ingredient-list-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
}

.br-ingredient-list-thumb > span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            135deg,
            var(--br-lime-soft),
            #f8fbf3
        );
}

.br-ingredient-list-thumb > span[hidden] {
    display: none;
}

@media (max-width: 767.98px) {
    .br-ingredient-thumb-heading,
    .br-ingredient-thumb-cell {
        width: 60px;
    }

    .br-ingredient-list-thumb {
        width: 44px;
        height: 44px;
        border-radius: 9px;
    }
}


/* ========================================================================== */
/* Step 27 - Samsung-style public recipe details                              */
/* ========================================================================== */

.br-rd {
    width: 100%;
    padding: 14px 0 34px;
}

.br-rd-grid {
    display: grid;
    grid-template-columns:
        minmax(260px, 0.9fr)
        minmax(390px, 1.25fr)
        minmax(245px, 0.62fr);
    gap: 14px;
    align-items: start;
}

.br-rd-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(20, 47, 38, 0.07);
    border-radius: 18px;
    box-shadow: 0 3px 14px rgba(22, 44, 36, 0.035);
}

/* Top photo ---------------------------------------------------------------- */

.br-rd-photo-card {
    position: relative;
    align-self: stretch;
    min-height: 470px;
    background: #edf2ec;
}

.br-rd-photo,
.br-rd-photo-empty {
    width: 100%;
    height: 100%;
    min-height: 470px;
}

.br-rd-photo {
    display: block;
    object-fit: cover;
}

.br-rd-photo-empty {
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            145deg,
            #edf4ed,
            #f9fbf7
        );
}

.br-rd-photo-empty img {
    width: 58%;
    max-width: 210px;
    height: auto;
    opacity: 0.92;
}

.br-rd-photo-overlay {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    gap: 8px;
    padding: 7px 10px;
    color: #14241e;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(4px);
}

.br-rd-photo-overlay span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 800;
}

.br-rd-photo-overlay .fa-star {
    color: #dc741a;
}

/* Summary ------------------------------------------------------------------ */

.br-rd-summary-card {
    display: flex;
    flex-direction: column;
    min-height: 470px;
    padding: 20px 22px;
}

.br-rd-summary-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.br-rd-icon-actions {
    display: flex;
    gap: 6px;
}

.br-rd-icon-button,
.br-rd-community button,
.br-rd-print-mini {
    display: inline-grid;
    place-items: center;
    color: #173128;
    background: transparent;
    border: 0;
}

.br-rd-icon-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.br-rd-icon-button:hover,
.br-rd-icon-button:focus,
.br-rd-print-mini:hover,
.br-rd-print-mini:focus {
    background: #f0f4ef;
}

.br-rd-primary-action {
    color: #fff;
    background: #0f513f;
    border: 1px solid #0f513f;
    border-radius: 999px;
    padding: 0.58rem 1rem;
    font-size: 0.75rem;
    font-weight: 850;
}

.br-rd-primary-action:hover,
.br-rd-primary-action:focus {
    color: #fff;
    background: #0b4334;
    border-color: #0b4334;
}

.br-rd-owner {
    margin-bottom: 13px;
    color: #455750;
    font-size: 0.76rem;
}

.br-rd-owner strong {
    color: #1a2a24;
}

.br-rd-summary-card h1 {
    margin: 0;
    color: #101c18;
    font-size: clamp(2rem, 3vw, 3.05rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.br-rd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.br-rd-tags span,
.br-rd-owner-status span {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 9px;
    color: #345449;
    background: #eef5ec;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 750;
}

.br-rd-community {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    color: #31453d;
}

.br-rd-community > span,
.br-rd-community button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: 0.75rem;
}

.br-rd-community i {
    color: #d86717;
}

.br-rd-time-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 22px;
    padding: 14px 0;
    border-top: 1px solid #edf0ed;
    border-bottom: 1px solid #edf0ed;
}

.br-rd-time-grid > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 10px;
}

.br-rd-time-grid > div:first-child {
    padding-left: 0;
}

.br-rd-time-grid > div + div {
    border-left: 1px solid #edf0ed;
}

.br-rd-time-grid i {
    flex: 0 0 auto;
    color: #183c31;
    font-size: 0.95rem;
}

.br-rd-time-grid span {
    display: grid;
    min-width: 0;
    color: #6e7b76;
    font-size: 0.58rem;
    line-height: 1.2;
}

.br-rd-time-grid strong {
    color: #1b2a25;
    font-size: 0.67rem;
}

.br-rd-summary-spacer {
    flex: 1 1 auto;
    min-height: 24px;
}

.br-rd-description {
    margin: 0;
    padding-top: 16px;
    color: #68766f;
    border-top: 1px solid #edf0ed;
    font-size: 0.83rem;
    line-height: 1.55;
}

.br-rd-owner-status {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

/* Nutrition sidebar -------------------------------------------------------- */

.br-rd-nutrition-card {
    grid-column: 3;
    grid-row: 1 / span 2;
    position: sticky;
    top: 84px;
    padding: 18px 18px 16px;
}

.br-rd-card-heading,
.br-rd-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.br-rd-card-heading h2,
.br-rd-section-heading h2 {
    margin: 2px 0 0;
    color: #16261f;
    font-size: 1.05rem;
    font-weight: 900;
}

.br-rd-card-heading > a {
    color: #1e503f;
    font-size: 0.65rem;
    font-weight: 850;
    text-decoration: none;
}

.br-rd-calories {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 18px 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8ece9;
}

.br-rd-calories strong {
    color: #10241c;
    font-size: 2.05rem;
    font-weight: 950;
    letter-spacing: -0.04em;
    line-height: 1;
}

.br-rd-calories span {
    color: #708079;
    font-size: 0.67rem;
}

.br-rd-nutrition-list {
    display: grid;
}

.br-rd-nutrition-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #edf0ee;
    font-size: 0.72rem;
}

.br-rd-nutrition-list span {
    color: #596a62;
}

.br-rd-nutrition-list strong {
    color: #16261f;
}

.br-rd-serving-note {
    margin-top: 12px;
    color: #7d8984;
    font-size: 0.62rem;
}

.br-rd-nutrition-link {
    display: block;
    margin-top: 14px;
    color: #1d5c47;
    font-size: 0.67rem;
    font-weight: 850;
    text-align: center;
    text-decoration: none;
}

/* Ingredient / Instruction cards ----------------------------------------- */

.br-rd-ingredients-card,
.br-rd-instructions-card,
.br-rd-notes-card,
.br-rd-full-nutrition {
    padding: 22px;
}

.br-rd-ingredients-card {
    grid-column: 1;
}

.br-rd-instructions-card {
    grid-column: 2;
}

.br-rd-section-heading {
    margin-bottom: 18px;
}

.br-rd-section-heading p {
    margin: 4px 0 0;
    color: #75817c;
    font-size: 0.66rem;
}

.br-rd-serving-control {
    display: flex;
    align-items: center;
    gap: 7px;
}

.br-rd-serving-control button {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    color: #20503f;
    background: #fff;
    border: 1px solid #dce4df;
    border-radius: 50%;
    font-size: 0.62rem;
}

.br-rd-serving-control > span {
    min-width: 58px;
    color: #253930;
    font-size: 0.7rem;
    font-weight: 750;
    text-align: center;
}

.br-rd-serving-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.br-rd-ingredient-list,
.br-rd-step-list {
    display: grid;
}

.br-rd-ingredient-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 8px 0;
}

.br-rd-ingredient-image {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    color: #285441;
    background: #f1f6ee;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
}

.br-rd-ingredient-image img {
    width: 100%;
    height: 100%;
    padding: 2px;
    object-fit: contain;
}

.br-rd-ingredient-image > span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.br-rd-ingredient-image > span[hidden] {
    display: none;
}

.br-rd-ingredient-copy {
    min-width: 0;
}

.br-rd-ingredient-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: baseline;
    min-width: 0;
    color: #1d2c26;
    font-size: 0.78rem;
}

.br-rd-ingredient-primary strong {
    font-weight: 900;
}

.br-rd-ingredient-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
    color: #87908c;
    font-size: 0.65rem;
}

.br-rd-ingredient-secondary > span + span::before {
    content: "·";
    margin-right: 5px;
}

.br-rd-ingredient-group,
.br-rd-instruction-group {
    margin-top: 18px;
}

.br-rd-ingredient-group h3,
.br-rd-instruction-group h3 {
    margin: 0 0 6px;
    color: #718079;
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.br-rd-edit-section {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 138px;
    margin: 18px auto 0;
    padding: 8px 15px;
    color: #21473a;
    background: #fff;
    border: 1px solid #ccd7d1;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 850;
    text-decoration: none;
}

.br-rd-edit-section:hover,
.br-rd-edit-section:focus {
    color: #153b2e;
    background: #f5f8f5;
}

.br-rd-print-mini {
    width: 34px;
    height: 34px;
    border: 1px solid #dce4df;
    border-radius: 50%;
}

.br-rd-step {
    padding: 12px 0 16px;
}

.br-rd-step + .br-rd-step {
    border-top: 1px solid #edf0ee;
}

.br-rd-step > strong {
    display: block;
    margin-bottom: 6px;
    color: #182820;
    font-size: 0.75rem;
    font-weight: 900;
}

.br-rd-step p {
    margin: 0;
    color: #34473e;
    font-size: 0.79rem;
    line-height: 1.6;
}

.br-rd-step > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: #718079;
    font-size: 0.64rem;
}

/* Notes / full nutrition --------------------------------------------------- */

.br-rd-notes-card,
.br-rd-full-nutrition {
    grid-column: 1 / span 2;
}

.br-rd-note-form {
    display: grid;
    gap: 12px;
}

.br-rd-note-editor {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.br-rd-note-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: #0f513f;
    border-radius: 50%;
    font-size: 0.8rem;
}

.br-rd-note-editor textarea {
    min-height: 72px;
    padding: 13px 15px;
    background: #f5f6f5;
    border-color: transparent;
    border-radius: 18px;
    resize: vertical;
}

.br-rd-note-editor textarea:focus {
    background: #fff;
    border-color: #8cb7a7;
    box-shadow: 0 0 0 0.18rem rgba(46, 115, 90, 0.12);
}

.br-rd-note-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-left: 52px;
}

.br-rd-note-actions > span {
    color: #7b8782;
    font-size: 0.63rem;
}

.br-rd-batch-label {
    color: #68766f;
    font-size: 0.67rem;
}

.br-rd-full-nutrition-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
}

.br-rd-full-nutrition-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    gap: 3px 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf0ee;
}

.br-rd-full-nutrition-row span,
.br-rd-full-nutrition-row strong {
    font-size: 0.72rem;
}

.br-rd-full-nutrition-row span {
    color: #64736c;
}

.br-rd-full-nutrition-row strong {
    color: #16261f;
}

.br-rd-full-nutrition-row small {
    grid-column: 1 / -1;
    color: #909a95;
    font-size: 0.58rem;
}

.br-rd-empty {
    padding: 20px 0;
    color: #75817c;
    font-size: 0.74rem;
}

/* Tablet ------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .br-rd-grid {
        grid-template-columns:
            minmax(260px, 0.85fr)
            minmax(390px, 1.15fr);
    }

    .br-rd-nutrition-card {
        grid-column: 1 / span 2;
        grid-row: auto;
        position: static;
    }

    .br-rd-nutrition-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }

    .br-rd-notes-card,
    .br-rd-full-nutrition {
        grid-column: 1 / span 2;
    }
}

/* Mobile ------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .br-rd {
        padding-top: 8px;
    }

    .br-rd-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .br-rd-photo-card,
    .br-rd-summary-card,
    .br-rd-nutrition-card,
    .br-rd-ingredients-card,
    .br-rd-instructions-card,
    .br-rd-notes-card,
    .br-rd-full-nutrition {
        grid-column: 1;
        grid-row: auto;
    }

    .br-rd-photo-card,
    .br-rd-photo,
    .br-rd-photo-empty {
        min-height: 0;
    }

    .br-rd-photo-card {
        aspect-ratio: 1 / 0.78;
    }

    .br-rd-photo,
    .br-rd-photo-empty {
        height: 100%;
    }

    .br-rd-summary-card {
        min-height: 0;
        padding: 18px;
    }

    .br-rd-summary-card h1 {
        font-size: 2rem;
    }

    .br-rd-time-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        row-gap: 12px;
    }

    .br-rd-time-grid > div {
        padding-left: 0;
        border-left: 0 !important;
    }

    .br-rd-nutrition-card {
        position: static;
    }

    .br-rd-ingredients-card,
    .br-rd-instructions-card,
    .br-rd-notes-card,
    .br-rd-full-nutrition {
        padding: 18px;
    }

    .br-rd-full-nutrition-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .br-rd-note-actions {
        padding-left: 0;
    }
}

@media (max-width: 479.98px) {
    .br-rd-summary-actions {
        align-items: flex-start;
    }

    .br-rd-primary-action {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .br-rd-serving-control {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .br-rd-full-nutrition-grid {
        grid-template-columns: 1fr;
    }

    .br-rd-note-editor {
        grid-template-columns: 1fr;
    }

    .br-rd-note-avatar {
        display: none;
    }

    .br-rd-note-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .br-rd-note-actions .btn {
        width: 100%;
    }
}

/* Print -------------------------------------------------------------------- */

@media print {
    .br-site-header,
    .br-site-footer,
    .br-rd-summary-actions,
    .br-rd-community button,
    .br-rd-serving-control button,
    .br-rd-edit-section,
    .br-rd-print-mini,
    .br-rd-note-actions,
    .br-toast-container {
        display: none !important;
    }

    .br-rd-grid {
        display: block;
    }

    .br-rd-card {
        margin-bottom: 14px;
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }

    .br-rd-nutrition-card {
        position: static;
    }
}


/* -------------------------------------------------------------------------- */
/* Step 27B - Recipe unit converter                                           */
/* -------------------------------------------------------------------------- */

.br-rd-unit-converter {
    position: relative;
    display: inline-flex;
    margin: -6px 0 15px;
}

.br-rd-convert-units-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0.38rem 0.72rem;
    color: #243a31;
    background: #fff;
    border: 1px solid #cfd9d4;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.br-rd-convert-units-button:hover,
.br-rd-convert-units-button:focus,
.br-rd-unit-converter.is-open
.br-rd-convert-units-button {
    color: #123c2f;
    background: #f6f9f5;
    border-color: #8aa99d;
}

.br-rd-convert-units-button > i:first-child {
    color: #d86717;
}

.br-rd-convert-chevron {
    margin-left: 2px;
    color: #718078;
    font-size: 0.55rem;
    transition: transform 140ms ease;
}

.br-rd-unit-converter.is-open
.br-rd-convert-chevron {
    transform: rotate(180deg);
}

.br-rd-unit-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 1040;
    width: 245px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(20, 47, 38, 0.1);
    border-radius: 12px;
    box-shadow:
        0 16px 34px rgba(20, 38, 32, 0.15),
        0 3px 10px rgba(20, 38, 32, 0.06);
}

.br-rd-unit-menu[hidden] {
    display: none !important;
}

.br-rd-unit-menu > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 13px 14px;
    color: #1e3029;
    background: #fff;
    border: 0;
    text-align: left;
}

.br-rd-unit-menu > button + button {
    border-top: 1px solid #edf0ee;
}

.br-rd-unit-menu > button:hover,
.br-rd-unit-menu > button:focus {
    background: #f7f9f7;
}

.br-rd-unit-menu > button.is-active {
    background: #fbfcfa;
}

.br-rd-unit-menu > button > span {
    display: grid;
    gap: 2px;
}

.br-rd-unit-menu strong {
    font-size: 0.76rem;
    font-weight: 850;
}

.br-rd-unit-menu small {
    color: #839089;
    font-size: 0.59rem;
    line-height: 1.3;
}

.br-rd-unit-menu > button > i {
    flex: 0 0 auto;
    color: #d86717;
    font-size: 0.92rem;
}

.br-rd-ingredient-measurement {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .br-rd-unit-menu {
        width: min(
            270px,
            calc(100vw - 72px)
        );
    }
}

@media print {
    .br-rd-unit-converter {
        display: none !important;
    }
}


/* ========================================================================== */
/* Step 27C - Samsung-style recipe print preview                              */
/* ========================================================================== */

body.br-print-preview-open {
    overflow: hidden;
}

.br-print-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    overflow: auto;
    color: #161b18;
    background: #f2f3f2;
}

.br-print-overlay[hidden] {
    display: none !important;
}

.br-print-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 18px 26px;
    background: rgba(249, 250, 249, 0.97);
    border-bottom: 1px solid #e2e5e3;
    backdrop-filter: blur(8px);
}

.br-print-toolbar-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.br-print-action,
.br-print-options-toggle,
.br-print-close,
.br-print-options > button,
.br-print-option-stepper,
.br-print-dropdown > button {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.br-print-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    color: #fff;
    background: #0f513f;
    border: 1px solid #0f513f;
}

.br-print-options-toggle,
.br-print-dropdown > button {
    min-height: 38px;
    padding: 0 15px;
    color: #1e2e28;
    background: #fff;
    border: 1px solid #bdc7c2;
}

.br-print-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #707a75;
    background: transparent;
    border: 0;
    font-size: 1.2rem;
}

.br-print-options {
    position: sticky;
    top: 82px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 26px 14px;
    background: rgba(249, 250, 249, 0.97);
    border-bottom: 1px solid #e2e5e3;
    backdrop-filter: blur(8px);
}

.br-print-options[hidden] {
    display: none !important;
}

.br-print-options > button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    color: #24342d;
    background: #fff;
    border: 1px solid #ced6d2;
}

.br-print-options > button > i {
    color: #6f8078;
}

.br-print-options > button.is-active > i {
    color: #d86717;
}

.br-print-option-stepper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    background: #fff;
    border: 1px solid #ced6d2;
}

.br-print-option-stepper button {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    color: #d86717;
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.br-print-option-stepper strong {
    min-width: 70px;
    color: #26362f;
    font-size: 0.72rem;
    text-align: center;
}

.br-print-option-stepper input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.br-print-dropdown {
    position: relative;
}

.br-print-dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.br-print-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    width: 170px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8deda;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(16, 32, 25, 0.14);
}

.br-print-dropdown-menu[hidden] {
    display: none !important;
}

.br-print-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    color: #25362f;
    background: #fff;
    border: 0;
    text-align: left;
    font-size: 0.72rem;
}

.br-print-dropdown-menu button + button {
    border-top: 1px solid #edf0ee;
}

.br-print-dropdown-menu button:hover,
.br-print-dropdown-menu button.is-active {
    background: #f3f7f3;
}

.br-print-preview-shell {
    padding: 34px 24px 60px;
}

.br-print-sheet {
    width: 8.5in;
    min-height: 11in;
    margin: 0 auto;
    padding: 0.42in;
    background: #fff;
    box-shadow: 0 4px 18px rgba(22, 38, 32, 0.09);
}

.br-print-sheet.is-a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
}

.br-print-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.br-print-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.br-print-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.br-print-brand > div {
    display: grid;
}

.br-print-brand strong {
    color: #12382d;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.br-print-brand span {
    color: #74817b;
    font-size: 0.49rem;
}

.br-print-recipe-link {
    display: grid;
    max-width: 260px;
    color: #33443c;
    font-size: 0.56rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.br-print-hero {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 1px solid #dfe4e1;
}

.br-print-hero-image {
    width: 145px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f1;
}

.br-print-hero-image > img,
.br-print-photo-placeholder {
    width: 100%;
    height: 100%;
}

.br-print-hero-image > img {
    display: block;
    object-fit: cover;
}

.br-print-photo-placeholder {
    display: grid;
    place-items: center;
}

.br-print-photo-placeholder img {
    width: 62%;
    height: auto;
}

.br-print-owner {
    margin-bottom: 5px;
    color: #34463e;
    font-size: 0.65rem;
    font-weight: 750;
}

.br-print-hero-copy h1 {
    margin: 0;
    color: #111b17;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.br-print-hero-copy p {
    margin: 10px 0 0;
    color: #4d5c55;
    font-size: 0.68rem;
    line-height: 1.45;
}

.br-print-section {
    padding: 17px 0;
    border-bottom: 1px solid #dfe4e1;
}

.br-print-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.br-print-section h2 {
    margin: 0 0 10px;
    color: #15231d;
    font-size: 0.9rem;
    font-weight: 900;
}

.br-print-section-title h2 {
    margin-bottom: 0;
}

.br-print-section-title > span {
    color: #68766f;
    font-size: 0.55rem;
}

.br-print-ingredient-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px 22px;
}

.br-print-ingredient {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    min-width: 0;
}

.br-print-ingredient-image {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    overflow: hidden;
    color: #29503f;
    background: #eef4ed;
    border-radius: 50%;
    font-size: 0.5rem;
    font-weight: 900;
}

.br-print-ingredient-image img {
    width: 100%;
    height: 100%;
    padding: 1px;
    object-fit: contain;
}

.br-print-ingredient-line {
    color: #25352e;
    font-size: 0.62rem;
    line-height: 1.3;
}

.br-print-ingredient-line strong {
    color: #13231c;
}

.br-print-ingredient-note {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    color: #818b86;
    font-size: 0.51rem;
}

.br-print-ingredient-note span + span::before {
    content: "·";
    margin-right: 4px;
}

.br-print-instructions {
    display: grid;
    gap: 12px;
}

.br-print-instructions h3 {
    margin: 6px 0 -2px;
    color: #67766f;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.br-print-instructions article strong {
    display: block;
    margin-bottom: 4px;
    color: #15241e;
    font-size: 0.63rem;
}

.br-print-instructions article p {
    margin: 0;
    color: #34463e;
    font-size: 0.63rem;
    line-height: 1.5;
}

.br-print-instructions article small {
    display: block;
    margin-top: 3px;
    color: #7a8781;
    font-size: 0.5rem;
}

.br-print-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 20px;
}

.br-print-nutrition-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #eef0ef;
    font-size: 0.54rem;
}

.br-print-nutrition-grid span {
    color: #475950;
}

.br-print-nutrition-grid strong {
    color: #182820;
}

.br-print-rating-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #34463e;
    font-size: 0.58rem;
}

.br-print-rating-row i {
    margin-right: 3px;
    color: #d86717;
}

.br-print-notes p {
    margin: 0 0 10px;
    color: #51615a;
    font-size: 0.61rem;
}

.br-print-note-lines {
    display: grid;
    gap: 14px;
}

.br-print-note-lines span {
    display: block;
    height: 1px;
    background: #d8dedb;
}

.br-print-muted {
    color: #81908a;
    font-size: 0.6rem;
}

/* Actual printing ---------------------------------------------------------- */

@media print {
    body.br-printing-recipe * {
        visibility: hidden !important;
    }

    body.br-printing-recipe
    .br-print-overlay,
    body.br-printing-recipe
    .br-print-overlay * {
        visibility: visible !important;
    }

    body.br-printing-recipe
    .br-print-overlay {
        position: static !important;
        inset: auto !important;
        display: block !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.br-printing-recipe
    .br-print-toolbar,
    body.br-printing-recipe
    .br-print-options {
        display: none !important;
    }

    body.br-printing-recipe
    .br-print-preview-shell {
        padding: 0 !important;
    }

    body.br-printing-recipe
    .br-print-sheet {
        width: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    body.br-printing-recipe
    .br-print-section,
    body.br-printing-recipe
    .br-print-ingredient,
    body.br-printing-recipe
    .br-print-instructions article {
        break-inside: avoid;
    }

    body.br-printing-recipe
    [hidden] {
        display: none !important;
    }
}

/* Responsive preview ------------------------------------------------------- */

@media (max-width: 900px) {
    .br-print-preview-shell {
        padding-left: 12px;
        padding-right: 12px;
        overflow-x: auto;
    }
}

@media (max-width: 575.98px) {
    .br-print-toolbar,
    .br-print-options {
        padding-left: 12px;
        padding-right: 12px;
    }

    .br-print-options {
        top: 82px;
    }
}


/* ========================================================================== */
/* Step 27C1 - Fix actual browser print pagination                            */
/* ========================================================================== */

@media print {
    html,
    body.br-printing-recipe {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    /*
     * The preview overlay is moved directly under <body> by
     * recipe-print-preview.js. Remove every other direct body child from the
     * print layout entirely. The previous visibility:hidden approach hid the
     * normal site visually but left all of its height in the print flow,
     * producing the blank sheets seen in Chrome/Edge.
     */
    body.br-printing-recipe
    > :not(.br-print-overlay) {
        display: none !important;
    }

    body.br-printing-recipe
    > .br-print-overlay {
        position: static !important;
        inset: auto !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.br-printing-recipe
    .br-print-toolbar,
    body.br-printing-recipe
    .br-print-options {
        display: none !important;
    }

    body.br-printing-recipe
    .br-print-preview-shell {
        display: block !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.br-printing-recipe
    .br-print-sheet,
    body.br-printing-recipe
    .br-print-sheet.is-letter,
    body.br-printing-recipe
    .br-print-sheet.is-a4 {
        display: block !important;
        width: auto !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    body.br-printing-recipe
    .br-print-sheet-header,
    body.br-printing-recipe
    .br-print-hero,
    body.br-printing-recipe
    .br-print-section-title,
    body.br-printing-recipe
    .br-print-ingredient-grid,
    body.br-printing-recipe
    .br-print-nutrition-grid {
        break-inside: auto;
    }

    body.br-printing-recipe
    .br-print-ingredient,
    body.br-printing-recipe
    .br-print-instructions article,
    body.br-printing-recipe
    .br-print-nutrition-grid > div,
    body.br-printing-recipe
    .br-print-rating-row {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.br-printing-recipe
    .br-print-section {
        break-inside: auto;
        page-break-inside: auto;
    }

    body.br-printing-recipe
    [hidden] {
        display: none !important;
    }
}


/* ========================================================================== */
/* Step 27D - Samsung-style QR code on recipe print                           */
/* ========================================================================== */

.br-print-header-side {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
}

.br-print-recipe-link {
    align-self: center;
    max-width: 185px;
}

.br-print-qr {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 3px;
    background: #fff;
    border: 1px solid #dfe4e1;
    border-radius: 4px;
}

.br-print-qr img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 900px) {
    .br-print-sheet-header {
        align-items: start;
    }

    .br-print-header-side {
        gap: 10px;
    }

    .br-print-recipe-link {
        max-width: 150px;
    }

    .br-print-qr {
        width: 58px;
        height: 58px;
    }
}

@media print {
    .br-print-header-side {
        gap: 10px;
    }

    .br-print-qr {
        width: 0.72in;
        height: 0.72in;
        padding: 0.03in;
        border-radius: 0.04in;
    }
}


/* ========================================================================== */
/* Step 28A - Save/Favorite + star rating                                     */
/* ========================================================================== */

.br-rd-interactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 18px;
    color: #31453d;
}

.br-rd-save-recipe,
.br-rd-share-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: #31453d;
    background: transparent;
    border: 0;
    font-size: 0.75rem;
    font-weight: 750;
}

.br-rd-save-recipe i,
.br-rd-share-action i {
    color: #d86717;
}

.br-rd-save-recipe.is-saved {
    color: #123f31;
}

.br-rd-save-recipe.is-saved i {
    color: #0f694c;
}

.br-rd-save-recipe:disabled,
.br-rd-rating-star:disabled {
    opacity: 0.55;
    cursor: wait;
}

.br-rd-interaction-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    min-height: 20px;
    padding: 0 5px;
    color: #3e554b;
    background: #eff4f0;
    border-radius: 999px;
    font-size: 0.61rem;
    font-weight: 850;
}

.br-rd-community-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #43564e;
    font-size: 0.72rem;
}

.br-rd-community-stat i {
    color: #d86717;
}

.br-rd-rating-block {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.br-rd-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.br-rd-rating-star {
    display: grid;
    place-items: center;
    width: 22px;
    height: 24px;
    padding: 0;
    color: #ccd3cf;
    background: transparent;
    border: 0;
    font-size: 0.77rem;
    line-height: 1;
    transition:
        color 120ms ease,
        transform 120ms ease;
}

.br-rd-rating-star:hover,
.br-rd-rating-star:focus {
    transform: translateY(-1px);
    outline: none;
}

.br-rd-rating-star.is-active {
    color: #e17a1b;
}

.br-rd-rating-copy {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    color: #64736c;
    font-size: 0.68rem;
    white-space: nowrap;
}

.br-rd-rating-copy > strong {
    color: #233a31;
}

.br-rd-rating-copy > small {
    margin-left: 4px;
    color: #86918c;
    font-size: 0.58rem;
}

@media (max-width: 767.98px) {
    .br-rd-interactions {
        align-items: flex-start;
        gap: 12px;
    }

    .br-rd-rating-block {
        flex-basis: 100%;
    }

    .br-rd-rating-star {
        width: 25px;
        height: 27px;
        font-size: 0.86rem;
    }
}

@media print {
    .br-rd-interactions {
        display: none !important;
    }
}


/* ========================================================================== */
/* Step 28B - Anonymous landing page                                          */
/* ========================================================================== */

.br-public-nav .nav-link {
    white-space: nowrap;
}

.br-anon-hero .br-mockup-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.br-anon-eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 11px;
    padding: 5px 9px;
    color: var(--br-green-800);
    background: var(--br-green-050);
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.br-hero-benefits .br-benefit-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-right: 10px;
    color: var(--br-orange);
    font-size: 1rem;
}

.br-promo-copy a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.br-anon-feature-section {
    margin-top: 14px;
    padding: 28px;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(128, 197, 28, 0.09),
            transparent 25%
        ),
        #fff;
    border: 1px solid var(--br-border);
    border-radius: 12px;
    box-shadow: var(--br-shadow-soft);
    scroll-margin-top: 92px;
}

.br-anon-section-heading {
    display: grid;
    max-width: 700px;
    gap: 4px;
}

.br-anon-section-heading h2,
.br-anon-join-copy h2 {
    margin: 0;
    color: var(--br-ink);
    font-family:
        "Arial Narrow",
        "Roboto Condensed",
        "Segoe UI",
        sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.035em;
}

.br-anon-section-heading p,
.br-anon-join-copy p {
    margin: 7px 0 0;
    color: var(--br-muted);
    line-height: 1.55;
}

.br-anon-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.br-anon-feature-grid article {
    position: relative;
    min-height: 185px;
    padding: 20px;
    overflow: hidden;
    background: #f9faf7;
    border: 1px solid var(--br-border);
    border-radius: 12px;
    scroll-margin-top: 92px;
}

.br-anon-feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--br-green-900);
    background: #eaf3e6;
    border-radius: 11px;
    font-size: 1rem;
}

.br-anon-step {
    position: absolute;
    top: 14px;
    right: 16px;
    color: #cbd3ce;
    font-family:
        "Arial Narrow",
        "Roboto Condensed",
        sans-serif;
    font-size: 1.7rem;
    font-weight: 950;
}

.br-anon-feature-grid h3 {
    margin: 18px 0 0;
    color: var(--br-ink);
    font-size: 1rem;
    font-weight: 900;
}

.br-anon-feature-grid p {
    margin: 7px 0 0;
    color: var(--br-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.br-anon-section-subtitle {
    margin: 5px 0 0;
    color: var(--br-muted);
    font-size: 0.75rem;
}

#meal-prep,
#recipe-inspiration {
    scroll-margin-top: 92px;
}

.br-inspiration-heart {
    position: absolute;
    top: 9px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    color: #fff;
    background: rgba(15, 42, 33, 0.66);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.br-anon-join-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 34px;
    align-items: center;
    margin-top: 14px;
    padding: 30px;
    color: #fff;
    background:
        radial-gradient(
            circle at 82% 16%,
            rgba(135, 201, 44, 0.24),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            #092a21,
            #134f3c
        );
    border-radius: 13px;
    box-shadow: var(--br-shadow-soft);
}

.br-anon-join-copy .br-section-kicker {
    color: #cce9b8;
}

.br-anon-join-copy h2 {
    color: #fff;
}

.br-anon-join-copy p {
    max-width: 690px;
    color: rgba(255,255,255,0.8);
}

.br-anon-join-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.br-anon-join-card .br-btn-primary {
    color: #fff;
    background: var(--br-orange);
    border-color: var(--br-orange);
    box-shadow: none;
}

.br-anon-join-card .br-btn-primary:hover {
    background: var(--br-orange-dark);
    border-color: var(--br-orange-dark);
}

.br-anon-login-link {
    color: rgba(255,255,255,0.85);
    font-size: 0.76rem;
    font-weight: 750;
}

.br-anon-login-link:hover {
    color: #fff;
    text-decoration: underline;
}

.br-anon-join-points {
    display: grid;
    gap: 12px;
    padding: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
}

.br-anon-join-points span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 0.76rem;
    font-weight: 700;
}

.br-anon-join-points i {
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    color: #dff1d6;
    background: rgba(128, 197, 28, 0.16);
    border-radius: 50%;
    font-size: 0.6rem;
}

@media (max-width: 991.98px) {
    .br-anon-feature-grid {
        grid-template-columns: 1fr;
    }

    .br-anon-feature-grid article {
        min-height: 0;
    }

    .br-anon-join-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .br-anon-eyebrow {
        margin-bottom: 8px;
    }

    .br-anon-feature-section,
    .br-anon-join-card {
        padding: 20px;
    }

    .br-anon-join-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .br-anon-join-actions .br-btn {
        width: 100%;
    }

    .br-anon-login-link {
        text-align: center;
    }
}

/* -------------------------------------------------------------------------- */
/* Imported ingredient matching                                                */
/* -------------------------------------------------------------------------- */

.br-sf-ingredient-row-unlinked .br-sf-row-main {
    padding-right: 146px;
}

.br-sf-unlinked-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--br-orange-dark);
    font-weight: 800;
}

.br-sf-resolve-button {
    position: absolute;
    top: 50%;
    right: 36px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    color: var(--br-orange-dark);
    background: var(--br-orange-soft);
    border: 1px solid rgba(218, 118, 34, 0.28);
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 850;
    transform: translateY(-50%);
}

.br-sf-resolve-button:hover,
.br-sf-resolve-button:focus-visible {
    color: #fff;
    background: var(--br-orange);
    border-color: var(--br-orange);
}

.is-reordering .br-sf-resolve-button {
    display: none;
}

.br-resolve-ingredient-intro {
    margin-bottom: 16px;
    padding: 13px 14px;
    background: var(--br-green-050);
    border: 1px solid #dce8ce;
    border-radius: 10px;
}

.br-resolve-ingredient-intro h3 {
    margin: 2px 0 4px;
    color: var(--br-ink);
    font-size: 1rem;
    font-weight: 900;
}

.br-resolve-ingredient-intro p {
    margin: 0;
    color: var(--br-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.br-resolve-ingredient-external {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 13px 14px;
    background: #fbfcf8;
    border: 1px solid var(--br-border);
    border-radius: 10px;
}

.br-resolve-ingredient-external > .btn {
    /* Keep Search / Add New readable beside the explanatory copy. */
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: center;
}

.br-resolve-ingredient-external > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.br-resolve-ingredient-external strong {
    color: var(--br-ink);
    font-size: 0.76rem;
}

.br-resolve-ingredient-external span {
    color: var(--br-muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

@media (max-width: 575.98px) {
    .br-sf-ingredient-row-unlinked .br-sf-row-main {
        padding-right: 78px;
    }

    .br-sf-resolve-button {
        right: 34px;
        width: 34px;
        height: 34px;
        justify-content: center;
        padding: 0;
    }

    .br-sf-resolve-button span {
        display: none;
    }

    .br-resolve-ingredient-external {
        align-items: stretch;
        flex-direction: column;
    }

    .br-resolve-ingredient-external .btn {
        width: 100%;
    }
}

/* -------------------------------------------------------------------------- */
/* My Ingredients - responsive list                                           */
/* -------------------------------------------------------------------------- */

.br-ingredients-filter-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

@media (max-width: 767.98px) {
    .br-ingredients-page-heading {
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.25rem !important;
    }

    .br-ingredients-page-heading > div:first-child {
        width: 100%;
    }

    .br-ingredients-page-heading h1 {
        font-size: 1.75rem;
    }

    .br-ingredients-page-heading p {
        font-size: .92rem;
        line-height: 1.55;
    }

    .br-ingredients-page-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: .55rem !important;
    }

    .br-ingredients-page-actions > .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        white-space: nowrap;
    }

    .br-ingredients-page-actions > .btn:first-child {
        grid-column: 1 / -1;
    }

    .br-ingredients-filter-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: .75rem;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 1.25rem !important;
    }

    .br-ingredients-filter-form > [class*="col-"] {
        width: 100%;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .br-ingredients-filter-form .form-label {
        margin-bottom: .35rem;
        font-size: .78rem;
        font-weight: 800;
    }

    .br-ingredients-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
    }

    .br-ingredients-filter-actions > :only-child {
        grid-column: 1 / -1;
    }

    .br-ingredients-filter-actions .btn {
        width: 100%;
    }

    .br-ingredients-table-wrap {
        overflow: visible;
    }

    .br-ingredients-table {
        display: block;
        width: 100%;
        margin: 0;
        border: 0;
    }

    .br-ingredients-table thead {
        display: none;
    }

    .br-ingredients-table tbody {
        display: grid;
        gap: .85rem;
        width: 100%;
    }

    .br-ingredients-table tbody tr {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        gap: .7rem .85rem;
        width: 100%;
        padding: .95rem;
        background: var(--br-surface);
        border: 1px solid var(--br-border);
        border-radius: 16px;
        box-shadow: var(--br-shadow-soft);
    }

    .br-ingredients-table tbody td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
        gap: .6rem;
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
        color: var(--br-text);
        overflow-wrap: anywhere;
    }

    .br-ingredients-table tbody td::before {
        content: attr(data-label);
        color: var(--br-muted);
        font-size: .68rem;
        font-weight: 900;
        letter-spacing: .07em;
        line-height: 1.4;
        text-transform: uppercase;
    }

    .br-ingredients-table .br-ingredient-thumb-cell {
        display: block;
        grid-column: 1;
        grid-row: 1;
        width: 56px;
    }

    .br-ingredients-table .br-ingredient-thumb-cell::before,
    .br-ingredients-table .br-ingredient-name-cell::before,
    .br-ingredients-table .br-ingredient-actions-cell::before {
        display: none;
    }

    .br-ingredients-table .br-ingredient-list-thumb {
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }

    .br-ingredients-table .br-ingredient-name-cell {
        display: flex;
        align-items: center;
        grid-column: 2;
        grid-row: 1;
        min-height: 56px;
        font-size: 1.02rem;
        line-height: 1.35;
        color: var(--br-ink);
    }

    .br-ingredients-table .br-ingredient-status-cell > .badge {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
        text-align: left;
        line-height: 1.35;
    }

    .br-ingredients-table .br-ingredient-status-cell > .small {
        grid-column: 2;
        margin-top: -.25rem !important;
    }

    .br-ingredients-table .br-ingredient-actions-cell {
        display: block;
        margin-top: .15rem;
        padding-top: .85rem !important;
        border-top: 1px solid var(--br-border) !important;
    }

    .br-ingredient-row-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem !important;
        width: 100%;
    }

    .br-ingredient-row-actions > a,
    .br-ingredient-row-actions > form,
    .br-ingredient-row-actions > form > button {
        width: 100%;
        min-width: 0;
    }

    .br-ingredient-row-actions > a,
    .br-ingredient-row-actions > form > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 390px) {
    .br-ingredients-page-actions,
    .br-ingredients-filter-actions,
    .br-ingredient-row-actions {
        grid-template-columns: 1fr;
    }

    .br-ingredients-page-actions > .btn:first-child,
    .br-ingredients-filter-actions > :only-child {
        grid-column: auto;
    }

    .br-ingredients-table tbody td {
        grid-template-columns: 82px minmax(0, 1fr);
    }
}

/* -------------------------------------------------------------------------- */
/* My Ingredients - compact mobile rows + details modal                       */
/* -------------------------------------------------------------------------- */

.br-ingredients-mobile-list {
    display: none;
}

.br-ingredient-details-modal-body {
    display: grid;
    gap: 1.1rem;
}

.br-ingredient-details-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.br-ingredient-details-image {
    display: grid;
    place-items: center;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    background: var(--br-green-050);
    color: var(--br-green-900);
    font-size: 1.35rem;
    font-weight: 900;
}

.br-ingredient-details-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.br-ingredient-details-heading {
    min-width: 0;
}

.br-ingredient-details-kicker {
    display: block;
    margin-bottom: .2rem;
    color: var(--br-muted);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.br-ingredient-details-heading h3 {
    margin: 0 0 .45rem;
    color: var(--br-ink);
    font-size: 1.25rem;
    line-height: 1.2;
}

.br-ingredient-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
}

.br-ingredient-details-grid > div {
    min-width: 0;
    padding: .8rem .9rem;
    border: 1px solid var(--br-border);
    border-radius: 12px;
    background: #fbfcfa;
}

.br-ingredient-details-grid dt {
    margin-bottom: .2rem;
    color: var(--br-muted);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.br-ingredient-details-grid dd {
    margin: 0;
    color: var(--br-ink);
    overflow-wrap: anywhere;
}

.br-ingredient-details-notes {
    padding: .85rem .95rem;
    border-radius: 12px;
    background: var(--br-green-050);
}

.br-ingredient-details-notes > span {
    display: block;
    margin-bottom: .25rem;
    color: var(--br-green-800);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.br-ingredient-details-notes p {
    margin: 0;
    color: var(--br-text);
}

@media (max-width: 767.98px) {
    .br-ingredients-table-wrap {
        display: none !important;
    }

    .br-ingredients-mobile-list {
        display: grid;
        gap: .55rem;
    }

    .br-ingredient-mobile-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        min-height: 68px;
        padding: .55rem .6rem .55rem .7rem;
        border: 1px solid var(--br-border);
        border-radius: 14px;
        background: var(--br-surface);
        box-shadow: var(--br-shadow-soft);
    }

    .br-ingredient-mobile-main {
        display: flex;
        align-items: center;
        gap: .7rem;
        min-width: 0;
        flex: 1 1 auto;
    }

    .br-ingredient-mobile-row .br-ingredient-list-thumb {
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        border-radius: 11px;
    }

    .br-ingredient-mobile-name {
        min-width: 0;
        color: var(--br-ink);
        font-size: .96rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .br-ingredient-mobile-menu {
        flex: 0 0 auto;
    }

    .br-ingredient-mobile-menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--br-border-strong);
        border-radius: 11px;
        color: var(--br-green-900);
        background: #fff;
    }

    .br-ingredient-mobile-menu-button:hover,
    .br-ingredient-mobile-menu-button:focus,
    .br-ingredient-mobile-menu-button[aria-expanded="true"] {
        color: #fff;
        background: var(--br-green-900);
        border-color: var(--br-green-900);
    }

    .br-ingredient-action-menu {
        min-width: 220px;
        padding: .45rem;
        border: 1px solid var(--br-border);
        border-radius: 14px;
        box-shadow: 0 18px 40px rgba(18, 43, 34, .16);
    }

    .br-ingredient-action-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: .65rem;
        min-height: 42px;
        padding: .6rem .7rem;
        border-radius: 9px;
        color: var(--br-text);
        font-weight: 700;
    }

    .br-ingredient-action-menu .dropdown-item i {
        width: 18px;
        color: var(--br-green-800);
        text-align: center;
    }

    .br-ingredient-action-menu .dropdown-item:hover,
    .br-ingredient-action-menu .dropdown-item:focus {
        background: var(--br-green-050);
        color: var(--br-green-950);
    }

    .br-ingredient-action-menu form {
        margin: 0;
    }

    .br-ingredient-menu-submit {
        width: 100%;
        border: 0;
        background: transparent;
        text-align: left;
    }

    .br-ingredient-action-menu .br-ingredient-menu-delete,
    .br-ingredient-action-menu .br-ingredient-menu-delete i {
        color: var(--br-danger);
    }

    .br-ingredient-details-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------- */
/* Master Ingredients - mobile page actions                                   */
/* -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .br-master-ingredients-page-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem !important;
    }

    .br-master-ingredients-page-actions > .btn:first-child {
        grid-column: auto;
    }

    .br-master-ingredients-page-actions > .btn {
        min-height: 46px;
        padding: .65rem .65rem;
        gap: .48rem;
        border-radius: 12px;
        font-size: .86rem;
        font-weight: 850;
        line-height: 1.15;
        white-space: normal;
        text-align: center;
        box-shadow: 0 5px 14px rgba(18, 43, 34, .06);
    }

    .br-master-ingredients-page-actions > .btn i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 27px;
        width: 27px;
        height: 27px;
        margin-right: 0 !important;
        border-radius: 8px;
        color: var(--br-green-800);
        background: var(--br-green-050);
        font-size: .78rem;
    }

    .br-master-ingredients-page-actions > .br-btn-primary i {
        color: #fff;
        background: rgba(255, 255, 255, .16);
    }
}

@media (max-width: 350px) {
    .br-master-ingredients-page-actions {
        grid-template-columns: 1fr;
    }
}

/* Mobile ingredient search results                                            */
/* -------------------------------------------------------------------------- */

.br-ingredient-search-mobile-results {
    display: none;
}

.br-ingredient-search-details-hero {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--br-border);
}

.br-ingredient-search-details-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--br-green-800);
    background: var(--br-green-050);
}

.br-ingredient-search-details-hero h3 {
    margin: .08rem 0 .12rem;
    color: var(--br-ink);
    font-size: 1.1rem;
    font-weight: 900;
}

.br-ingredient-search-details-hero p {
    margin: 0;
    color: var(--br-muted);
    font-size: .84rem;
}

.br-ingredient-search-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.br-ingredient-search-detail-item {
    padding: .8rem;
    border: 1px solid var(--br-border);
    border-radius: 12px;
    background: #fbfcfa;
}

.br-ingredient-search-detail-item span,
.br-ingredient-search-nutrition-grid span {
    display: block;
    color: var(--br-muted);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.br-ingredient-search-detail-item strong {
    display: block;
    margin-top: .2rem;
    color: var(--br-ink);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.br-ingredient-search-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
    margin-top: 1rem;
}

.br-ingredient-search-nutrition-grid > div {
    padding: .75rem .55rem;
    border-radius: 12px;
    background: var(--br-green-050);
    text-align: center;
}

.br-ingredient-search-nutrition-grid strong {
    display: block;
    margin-top: .2rem;
    color: var(--br-green-950);
    font-size: 1rem;
}

.br-ingredient-search-nutrition-grid small {
    font-size: .68rem;
    font-weight: 700;
}

.br-ingredient-search-details-note {
    margin: 1rem 0 0;
    color: var(--br-muted);
    font-size: .8rem;
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .br-ingredient-search-desktop-results {
        display: none;
    }

    .br-ingredient-search-mobile-results {
        display: grid;
        gap: .65rem;
    }

    .br-ingredient-search-mobile-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .75rem;
        align-items: center;
        padding: .8rem;
        background: #fff;
        border: 1px solid var(--br-border);
        border-radius: 14px;
        box-shadow: var(--br-shadow-soft);
    }

    .br-ingredient-search-mobile-main {
        display: flex;
        align-items: center;
        gap: .7rem;
        min-width: 0;
    }

    .br-ingredient-search-mobile-icon,
    .br-ingredient-search-mobile-thumb {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .br-ingredient-search-mobile-icon {
        color: var(--br-green-800);
        background: var(--br-green-050);
    }

    .br-ingredient-search-mobile-thumb {
        object-fit: contain;
        padding: 4px;
        border: 1px solid #dce6dc;
        background: #f8fbf3;
    }

    .br-ingredient-search-mobile-copy {
        min-width: 0;
    }

    .br-ingredient-search-mobile-copy strong,
    .br-ingredient-search-mobile-copy span {
        display: block;
    }

    .br-ingredient-search-mobile-copy strong {
        color: var(--br-ink);
        font-size: .9rem;
        font-weight: 850;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .br-ingredient-search-mobile-copy span {
        margin-top: .18rem;
        color: var(--br-muted);
        font-size: .72rem;
    }

    .br-ingredient-search-mobile-actions {
        display: grid;
        grid-template-columns: auto auto;
        gap: .45rem;
        align-items: center;
    }

    .br-ingredient-search-mobile-actions .btn,
    .br-ingredient-search-mobile-use-form .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .35rem;
        min-height: 40px;
        padding: .55rem .7rem;
        white-space: nowrap;
        font-size: .75rem;
    }

    .br-ingredient-search-mobile-import-form {
        margin: 0;
    }


    .br-ingredient-search-mobile-macros {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .28rem .65rem;
        padding-top: .65rem;
        border-top: 1px solid var(--br-border);
        color: var(--br-muted);
        font-size: .72rem;
        line-height: 1.35;
    }

    .br-ingredient-search-mobile-macros span {
        white-space: nowrap;
    }

    .br-ingredient-search-mobile-macros strong {
        color: var(--br-ink);
        font-weight: 850;
    }

    .br-ingredient-search-mobile-row.is-mealdb {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .br-ingredient-search-mobile-use-form {
        margin: 0;
    }

    .br-usda-custom-fallback {
        text-align: center;
    }

    .br-page-heading + .card .row.g-2 > .col,
    .br-page-heading + .card .row.g-2 > .col-md-3,
    .br-page-heading + .card .row.g-2 > .col-auto {
        width: 100%;
        flex: 0 0 100%;
    }

    .br-page-heading + .card .row.g-2 > .col-auto .btn {
        width: 100%;
    }
}

@media (max-width: 479.98px) {
    .br-ingredient-search-mobile-row {
        grid-template-columns: 1fr;
    }

    .br-ingredient-search-mobile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .br-ingredient-search-mobile-actions .btn,
    .br-ingredient-search-mobile-import-form,
    .br-ingredient-search-mobile-import-form .btn,
    .br-ingredient-search-mobile-use-form,
    .br-ingredient-search-mobile-use-form .btn {
        width: 100%;
    }

    .br-ingredient-search-mobile-row.is-mealdb {
        grid-template-columns: 1fr;
    }

    .br-ingredient-search-nutrition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------------------------------------------------------------- */
/* Ingredient library - real-device mobile viewport containment                */
/* -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .br-ingredients-page-heading,
    .br-ingredients-page-heading > div,
    .br-ingredients-page-actions,
    .br-master-ingredients-page-actions,
    .br-ingredients-filter-form,
    .br-ingredients-filter-form > [class*="col-"],
    .br-ingredients-filter-actions,
    .br-ingredients-mobile-list,
    .br-ingredient-mobile-row {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .br-ingredients-page-actions,
    .br-master-ingredients-page-actions,
    .br-ingredients-filter-form,
    .br-ingredients-filter-actions,
    .br-ingredients-mobile-list {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .br-ingredients-filter-form .form-control,
    .br-ingredients-filter-form .form-select,
    .br-ingredients-filter-form [data-br-category-select],
    .br-ingredients-filter-form .br-category-select,
    .br-ingredients-filter-form .br-category-select-trigger {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .br-ingredient-mobile-row {
        overflow: visible;
    }

    .br-ingredient-mobile-main {
        flex: 1 1 0;
        width: auto;
        max-width: calc(100% - 54px);
        min-width: 0;
        overflow: hidden;
    }

    .br-ingredient-mobile-name {
        display: block;
        max-width: 100%;
        min-width: 0;
    }

    .br-ingredient-mobile-menu {
        flex: 0 0 42px;
        width: 42px;
        max-width: 42px;
        min-width: 42px;
    }
}


/* Ingredient source search - visible in-flight status */
.br-ingredient-search-status {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .9rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(15, 73, 57, .14);
    border-radius: 12px;
    background: #f7faf7;
    color: #173f32;
}

.br-ingredient-search-status[hidden] {
    display: none !important;
}

.br-ingredient-search-status-spinner {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: rgba(15, 73, 57, .09);
    color: #0f4939;
}

.br-ingredient-search-status-spinner i {
    animation: br-ingredient-search-pulse 1s ease-in-out infinite;
}

.br-ingredient-search-status-copy {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

.br-ingredient-search-status-copy strong {
    font-size: .88rem;
    line-height: 1.2;
}

.br-ingredient-search-status-copy > span {
    color: #68766f;
    font-size: .78rem;
    line-height: 1.35;
}

@keyframes br-ingredient-search-pulse {
    0%, 100% { transform: scale(1); opacity: .65; }
    50% { transform: scale(1.13); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .br-ingredient-search-status-spinner i {
        animation: none;
    }
}

@media (max-width: 620px) {
    .br-ingredient-search-status {
        margin-top: .7rem;
        padding: .72rem .78rem;
    }
}


/* Builder boolean/category controls use branded switches instead of checkboxes. */
.br-builder-switch-row,
.br-builder-category-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    margin: 0;
    padding: .68rem .75rem;
    border: 1px solid var(--br-border, rgba(15, 73, 57, .14));
    border-radius: 10px;
    background: var(--br-paper, #fff);
    color: var(--br-ink, #17392d);
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}

.br-builder-switch-row:hover,
.br-builder-category-switch:hover {
    border-color: rgba(15, 73, 57, .28);
}

.br-builder-category-switch > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .br-builder-category-switch {
        min-height: 46px;
    }
}


/* Compact Recipe Builder Settings on phones. Limit these rules to the Settings
   panel so ingredient, nutrition, and photo forms retain their own spacing. */
@media (max-width: 575.98px) {
    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-intro {
        gap: 9px;
        margin-bottom: 9px;
        padding: 12px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-intro h2 {
        font-size: 1.06rem;
        line-height: 1.22;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-intro p {
        margin-top: 4px;
        line-height: 1.4;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-timing {
        gap: 6px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-timing > span {
        padding: 6px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card > .card-header {
        min-height: 40px;
        padding: 10px 12px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card > .card-body {
        padding: 12px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-settings-group + .br-builder-settings-group {
        margin-top: 13px;
        padding-top: 12px;
        border-top: 1px solid var(--br-border, #dde2dd);
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-settings-group-heading {
        margin-bottom: 9px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-settings-group-heading h3 {
        margin: 2px 0;
        font-size: 1.05rem;
        line-height: 1.25;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-settings-group-heading p {
        margin: 2px 0 0;
        font-size: .77rem;
        line-height: 1.35;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card .row.g-3 {
        --bs-gutter-x: 9px;
        --bs-gutter-y: 11px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card .form-label {
        margin-bottom: 4px;
        font-size: .73rem;
        line-height: 1.2;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card :is(.form-control, .form-select) {
        min-height: 44px;
        padding: 8px 10px;
        font-size: .86rem;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card textarea.form-control {
        min-height: 90px;
        resize: vertical;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-time-fields .form-label {
        white-space: nowrap;
        font-size: .70rem;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card .mb-3 {
        margin-bottom: 11px !important;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-category-switch {
        min-height: 44px;
        gap: 5px;
        padding: 6px 7px;
        font-size: .72rem;
        line-height: 1.25;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-builder-category-switch > span:first-child {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-category-grid {
        --bs-gutter-x: 8px;
        --bs-gutter-y: 7px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-category-grid .br-toggle-switch {
        width: 38px;
        height: 24px;
        flex-basis: 38px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-category-grid .br-toggle-switch-thumb {
        width: 18px;
        height: 18px;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-category-grid .br-toggle-switch-input:checked + .br-toggle-switch-track .br-toggle-switch-thumb {
        transform: translateX(14px);
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-tag-list {
        gap: 6px !important;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-tag-list .btn {
        min-height: 34px;
        padding: 6px 9px;
        font-size: .76rem;
        line-height: 1.2;
    }

    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-editor-card hr {
        margin: 12px 0;
    }
}

/* Very narrow devices need enough room for category names and tap targets. */
@media (max-width: 345px) {
    .br-builder-tab-panel[data-builder-panel="settings"] .br-settings-category-grid > div {
        width: 100%;
    }
}

/* Touch devices cannot hover: never hide the ingredient delete affordance. */
.br-sf-ingredient-row .br-sf-remove-button {
    opacity: 1; color: #d13e43; background: #fff9f7;
    border: 1px solid #f3cccc; font-weight: 850;
}
.br-sf-ingredient-row .br-sf-remove-button:hover,
.br-sf-ingredient-row .br-sf-remove-button:focus-visible {
    opacity: 1; background: #fff0ef; color: #ae2029;
}

/* Builder section tabs: the same separate pills and count badges as the native apps. */
.br-builder-tabs {
    gap: 7px; padding: 4px 0; background: transparent; border: 0;
    border-radius: 0; box-shadow: none; backdrop-filter: none;
}
.br-builder-tabs .br-builder-tab {
    gap: 6px; min-height: 36px; border: 1px solid #cfdbd1; border-radius: 999px;
    background: #fff; color: #103b2d; padding: 7px 10px;
}
.br-builder-tabs .br-builder-tab.is-active {
    color: #fff; background: #14513f; border-color: #14513f;
}
.br-builder-tabs .br-builder-tab > span {
    display: inline-grid; place-items: center; border-radius: 999px;
    width: auto; min-width: 19px; height: 19px; background: #ebf5d9;
}
.br-builder-tabs .br-builder-tab.is-active > span { background: #fff; }

/* Recipe Builder: flat, always-visible match and delete icons, as on Android/iOS.
   Keep the invisible click targets and an accessible keyboard focus outline. */
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-resolve-button,
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-resolve-button:hover,
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-resolve-button:focus-visible {
    color: #c85c18;
    background: transparent;
    border: 0;
    box-shadow: none;
}
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-remove-button,
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-remove-button:hover,
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-remove-button:focus-visible {
    color: #dc3545;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
}
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-resolve-button:focus-visible,
[data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-remove-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Recipe Builder: reusable Add Ingredient dialog. The form lives in the
   modal, not in an expanding inline panel. */
.br-builder-add-ingredient-modal .modal-body .row.g-3 {
    --bs-gutter-y: 0.85rem;
}

.br-builder-add-ingredient-modal .form-label {
    margin-bottom: 0.35rem;
}

.br-builder-add-ingredient-modal .br-builder-add-ingredient-help {
    padding: 0.65rem 0.8rem;
    background: #f7f9f6;
    border: 1px solid var(--br-border);
    border-radius: 9px;
}

.br-builder-add-ingredient-modal .br-builder-add-ingredient-help > summary {
    color: var(--br-green-900);
    cursor: pointer;
    font-size: 0.77rem;
    font-weight: 750;
}

@media (max-width: 767.98px) {
    .br-builder-add-ingredient-modal .modal-body > .row > .col-md-3,
    .br-builder-add-ingredient-modal .br-add-ingredient-form .row.g-3 > .col-md-3 {
        width: 50%;
    }
}


/* Recipe Builder ingredient dialogs: spread nutrition help and produce-weight
   suggestions across the full dialog rather than stacking them in a third-width
   column. The same layout is shared by Add and Edit. */
.br-builder-add-ingredient-modal .br-builder-nutrition-weight-panel {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    background: #f7f9f6;
    border: 1px solid var(--br-border);
    border-radius: 10px;
}

.br-builder-add-ingredient-modal .br-builder-nutrition-weight-input,
.br-builder-add-ingredient-modal .br-builder-nutrition-weight-aside {
    min-width: 0;
}

.br-builder-add-ingredient-modal .br-builder-nutrition-weight-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
    min-height: 68px;
}

.br-builder-add-ingredient-modal .br-builder-nutrition-weight-aside .form-text {
    margin-top: 0;
    line-height: 1.45;
}

.br-builder-add-ingredient-modal .br-builder-nutrition-weight-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.5rem;
    row-gap: 0.15rem;
}

.br-builder-add-ingredient-modal .br-builder-nutrition-weight-suggestion .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    color: var(--br-green-900);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: normal;
}

.br-builder-add-ingredient-modal .br-builder-ingredient-optional-row {
    min-height: 44px;
    margin: 0;
}

@media (max-width: 575.98px) {
    .br-builder-add-ingredient-modal .br-builder-nutrition-weight-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .br-builder-add-ingredient-modal .br-builder-nutrition-weight-aside {
        min-height: 0;
    }
}

/* Recipe Builder Add/Edit Ingredient: keep both modal actions equally visible. */
.br-builder-add-ingredient-modal .modal-footer {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}
.br-builder-add-ingredient-modal .modal-footer > .br-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    margin: 0;
}
.br-builder-add-ingredient-modal .modal-footer > .br-btn-outline {
    background: #fff;
    color: var(--br-green-900);
    border: 1px solid var(--br-green-700);
}
.br-builder-add-ingredient-modal .modal-footer > .br-btn-outline:hover {
    background: var(--br-green-900);
    color: #fff;
}

/* Edit Ingredient modal: match Add Ingredient's outlined Cancel and equal-width
   footer actions. Target the stable modal ID in case the modal's extra CSS
   class was omitted by a previously published builder partial. */
.modal.br-popup-modal[id^="editIngredientModal-"] .modal-footer {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}
.modal.br-popup-modal[id^="editIngredientModal-"] .modal-footer > button.br-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    margin: 0;
}
.modal.br-popup-modal[id^="editIngredientModal-"] .modal-footer > button.br-btn-outline {
    color: var(--br-green-900);
    background-color: #fff;
    border: 1px solid var(--br-green-700);
}
.modal.br-popup-modal[id^="editIngredientModal-"] .modal-footer > button.br-btn-outline:hover {
    color: #fff;
    background-color: var(--br-green-900);
    border-color: var(--br-green-900);
}

/* Instruction delete is always visible on touch and desktop, like ingredient delete. */
[data-builder-panel="instructions"] .br-sf-step-row .br-sf-remove-button {
    color: #dc3545;
    background: transparent;
    border: 0;
    opacity: 1;
    font-size: 0.9rem;
}
[data-builder-panel="instructions"] .br-sf-step-row .br-sf-remove-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
/* Instruction sections use the same drag targets as ingredient groups. */
.is-reordering .br-sf-step-group.is-new-section {
    padding: 8px;
    border: 1px dashed var(--br-border-strong);
    border-radius: 10px;
}
.br-sf-step-group.is-new-section .instruction-sort-list {
    min-height: 46px;
}
.br-sf-step-group.is-new-section .br-sf-empty-group-drop-hint {
    padding: 12px 10px;
    color: var(--br-muted);
    font-size: 0.75rem;
}
.is-dragging-instruction .br-sf-step-group.is-drag-over {
    background: #fff7ed;
    outline: 1px solid var(--br-orange);
    border-radius: 10px;
}


/* Ingredient Artwork: compact phone layout; keep desktop styling unchanged.
   Scope the changes to the artwork editor to avoid affecting ingredient forms. */
@media (max-width: 767.98px) {
    .br-artwork-page-heading {
        gap: 10px;
        margin-bottom: 12px;
    }
    .br-artwork-page-heading .br-section-kicker {
        margin-bottom: 2px;
        font-size: 0.65rem;
    }
    .br-artwork-page-heading h1 {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
        line-height: 1.12;
    }
    .br-artwork-page-heading p {
        margin-top: 4px;
        font-size: 0.76rem;
        overflow-wrap: anywhere;
    }
    .br-artwork-page-heading > .btn {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    .br-artwork-admin-grid {
        gap: 10px;
    }
    .br-artwork-admin-grid > .card:first-child {
        max-width: none;
        width: 100%;
    }
    .br-artwork-admin-grid > .card > .card-header {
        padding: 9px 12px;
        font-size: 0.85rem;
    }
    .br-artwork-admin-grid > .card > .card-body {
        padding: 11px 12px;
    }
    /* Replace the full-width 1:1 preview with a small thumbnail and details. */
    .br-artwork-current-card > .card-body {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 5px 12px;
        align-items: center;
    }
    .br-artwork-current-card .br-artwork-current {
        width: 96px;
        height: 96px;
        aspect-ratio: auto;
        grid-row: 1 / span 2;
    }
    .br-artwork-current-card .br-artwork-letter {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
    .br-artwork-current-card > .card-body > .small {
        min-width: 0;
        margin: 0 !important;
        font-size: 0.75rem;
        overflow-wrap: anywhere;
        align-self: end;
    }
    .br-artwork-current-card > .card-body > form {
        margin: 0 !important;
        align-self: start;
    }
    .br-artwork-current-card > .card-body > form .btn {
        padding: 5px 8px;
        font-size: 0.73rem;
        text-align: left;
        white-space: normal;
    }
    /* Keep each source visible while removing the oversized stack spacing. */
    .br-artwork-source-card > .card-body.vstack {
        gap: 0 !important;
    }
    .br-artwork-source-card > .card-body.vstack > div {
        min-width: 0;
        padding-block: 8px;
    }
    .br-artwork-source-card > .card-body.vstack > div:first-child {
        padding-top: 0;
    }
    .br-artwork-source-card > .card-body.vstack > div:last-child {
        padding-bottom: 0;
    }
    .br-artwork-source-card > .card-body.vstack > hr {
        margin: 0 !important;
    }
    .br-artwork-source-card h2.h6 {
        margin-bottom: 5px;
        font-size: 0.88rem;
    }
    .br-artwork-source-card .small,
    .br-artwork-source-card .form-text {
        font-size: 0.73rem;
        line-height: 1.35;
    }
    .br-artwork-source-card .form-control {
        min-width: 0;
        min-height: 36px;
        padding: 6px 9px;
        font-size: 0.79rem;
    }
    .br-artwork-source-card .form-label {
        margin-bottom: 4px;
        font-size: 0.75rem;
    }
    .br-artwork-source-card .btn {
        min-height: 36px;
        padding: 6px 11px;
        font-size: 0.8rem;
    }
    .br-artwork-source-card .br-artwork-source-preview {
        width: 48px;
        height: 48px;
    }
    /* File picker + Upload in a single row. */
    .br-artwork-source-card .br-artwork-upload-form,
    .br-artwork-source-card .br-artwork-external-form {
        display: grid;
        gap: 7px;
        margin: 0;
    }
    .br-artwork-source-card .br-artwork-upload-form {
        grid-template-columns: minmax(0, 1fr) 40px auto;
    }
    .br-artwork-source-card .br-artwork-external-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .br-artwork-source-card .br-artwork-upload-form > div,
    .br-artwork-source-card .br-artwork-external-form > div {
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0;
    }
    .br-artwork-source-card .br-artwork-external-form > .col-md-7 {
        grid-column: 1 / -1;
    }
    .br-artwork-source-card .br-artwork-upload-form .btn,
    .br-artwork-source-card .br-artwork-external-form .btn {
        width: 100%;
        height: 100%;
    }
    .br-artwork-source-card #customPrompt {
        min-height: 64px;
        height: 64px;
        resize: vertical;
    }
    .br-artwork-source-card .br-ai-generation-progress {
        margin-top: 9px;
        padding: 9px;
    }
    .br-artwork-candidates-panel .card-body {
        font-size: 0.8rem;
    }
    /* Candidate thumbnails don't need another tall, square preview. */
    .br-artwork-candidates-panel .br-artwork-candidate-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }
    .br-artwork-candidates-panel .br-artwork-candidate {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .br-artwork-candidates-panel .br-artwork-candidate-image {
        aspect-ratio: auto;
        min-height: 92px;
    }
    .br-artwork-candidates-panel .br-artwork-candidate-body {
        min-width: 0;
        padding: 9px;
    }
}

/* Ingredient artwork header: compact navigation, mobile only. */
.br-artwork-back-mobile { display: none; }
.br-artwork-back-link > i { display: none; }
.br-artwork-back-link { align-items: center; gap: 6px; }

@media (max-width: 767.98px) {
    /* Put the back action beside the kicker, not in a full-width row. */
    .br-artwork-page-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        align-items: start;
        column-gap: 8px;
        row-gap: 2px;
        margin-bottom: 10px;
    }
    .br-artwork-page-heading > div {
        display: contents;
    }
    .br-artwork-page-heading .br-section-kicker {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        margin: 0;
    }
    .br-artwork-page-heading > .br-artwork-back-link {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        width: auto;
        min-width: 0;
        max-width: max-content;
        min-height: 30px;
        padding: 5px 9px;
        line-height: 1.2;
        font-size: 0.72rem;
        white-space: nowrap;
        border-radius: 8px;
    }
    .br-artwork-back-link > i { display: inline-block; }
    .br-artwork-back-full { display: none; }
    .br-artwork-back-mobile { display: inline; }
    .br-artwork-page-heading h1 {
        grid-column: 1 / -1;
        grid-row: 2;
        margin: 3px 0 0;
    }
    .br-artwork-page-heading p {
        grid-column: 1 / -1;
        grid-row: 3;
        margin: 1px 0 0;
    }
}

/* Artwork camera: match native outlined camera action without auto-uploading. */
.br-artwork-source-card .br-artwork-upload-form .br-artwork-camera-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
}


/* Ingredient artwork: consistent Reset Image action on web and native apps. */
.br-artwork-current-card > .card-body > form .br-artwork-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 11px;
    border: 1px solid #ced7ce;
    border-radius: 9px;
    background: #fff;
    color: #59645d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.br-artwork-current-card > .card-body > form .br-artwork-reset-btn:hover,
.br-artwork-current-card > .card-body > form .br-artwork-reset-btn:focus-visible {
    border-color: #9aae9e;
    background: #f1f6ef;
    color: #274e3b;
}

/* Read-only saved nutrition inside My/Master Ingredient Details. */
.br-ingredient-details-nutrition { display: grid; gap: .65rem; }
.br-ingredient-details-nutrition h4 {
    color: var(--br-ink); font-size: .91rem; font-weight: 800; margin: .45rem 0 0;
}
.br-ingredient-details-nutrition-status { font-size: .81rem; color: var(--br-muted); margin: 0; }
.br-ingredient-details-nutrient-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem;
}
.br-ingredient-details-nutrient-card {
    min-width: 0; display: grid; gap: .2rem; padding: .62rem .7rem;
    background: #fbfcfa; border: 1px solid var(--br-border); border-radius: 11px;
}
.br-ingredient-details-nutrient-card strong {
    font-size: .66rem; color: var(--br-muted); text-transform: uppercase;
    letter-spacing: .025em;
}
.br-ingredient-details-nutrient-card span { color: var(--br-ink); overflow-wrap: anywhere; font-size: .86rem; }
.br-ingredient-details-conversions {
    padding: .65rem .7rem; border: 1px solid var(--br-border);
    border-radius: 11px; background: #fbfcfa;
}
.br-ingredient-details-conversions p { margin: .2rem 0; color: var(--br-ink); font-size: .78rem; }

/* Ingredient details: dense, readable mobile layout for personal and master libraries. */
@media (max-width: 767.98px) {
    .br-ingredient-details-modal-body {
        gap: .7rem;
        padding: .7rem .75rem;
    }

    .br-ingredient-details-hero {
        gap: .65rem;
    }

    .br-ingredient-details-image {
        flex-basis: 52px;
        width: 52px;
        height: 52px;
        border-radius: 11px;
        font-size: 1.05rem;
    }

    .br-ingredient-details-kicker {
        margin-bottom: .12rem;
        font-size: .63rem;
    }

    .br-ingredient-details-heading h3 {
        margin-bottom: .2rem;
        font-size: 1.08rem;
    }

    .br-ingredient-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
    }

    .br-ingredient-details-grid > div {
        padding: .5rem .55rem;
        border-radius: 10px;
    }

    .br-ingredient-details-grid dt {
        margin-bottom: .12rem;
        font-size: .61rem;
        line-height: 1.2;
        letter-spacing: .05em;
    }

    .br-ingredient-details-grid dd {
        font-size: .83rem;
        line-height: 1.25;
    }

    .br-ingredient-details-notes {
        padding: .55rem .65rem;
        border-radius: 10px;
    }

    .br-ingredient-details-nutrition {
        gap: .45rem;
    }

    .br-ingredient-details-nutrition h4 {
        margin: .12rem 0 0;
        font-size: .85rem;
    }

    .br-ingredient-details-nutrient-grid {
        gap: .4rem;
    }

    .br-ingredient-details-nutrient-card {
        gap: .12rem;
        padding: .48rem .55rem;
        border-radius: 10px;
    }

    .br-ingredient-details-nutrient-card strong {
        font-size: .61rem;
        line-height: 1.15;
    }

    .br-ingredient-details-nutrient-card span {
        font-size: .82rem;
        line-height: 1.25;
    }

    .br-ingredient-details-conversions {
        padding: .45rem .55rem;
        border-radius: 10px;
    }

    .br-ingredient-details-conversions p {
        margin: .12rem 0;
        line-height: 1.3;
    }
}

/* Saved ingredient details: intentionally shorter than the viewport, with a fixed
   header/footer and independent scrolling body (personal and master libraries). */
#ingredientDetailsModal .modal-dialog-scrollable .modal-content {
    max-height: min(650px, 76dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#ingredientDetailsModal .modal-dialog-scrollable .br-ingredient-details-modal-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#ingredientDetailsModal .modal-dialog-scrollable .modal-header,
#ingredientDetailsModal .modal-dialog-scrollable .modal-footer {
    flex-shrink: 0;
}
@media (max-width: 767.98px) {
    #ingredientDetailsModal .modal-dialog-scrollable .modal-content {
        max-height: min(600px, 76dvh);
    }
}

/* Change library ingredient link from the recipe Edit Ingredient dialog. */
.br-builder-edit-ingredient-modal .br-edit-ingredient-link-action {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    width: fit-content;
    margin-top: .4rem;
    padding: 0;
    color: var(--br-green-900);
    font-size: .77rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.br-builder-edit-ingredient-modal .br-edit-ingredient-link-action:hover,
.br-builder-edit-ingredient-modal .br-edit-ingredient-link-action:focus-visible {
    color: var(--br-orange);
    text-decoration: underline;
}

/* Recipe Builder: AI tag suggestions are a review step, not automatic saving. */
.br-settings-ai-tags-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}
.br-settings-ai-tag-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    white-space: nowrap;
}
.br-settings-ai-tag-button[aria-busy="true"] { opacity: .7; cursor: progress; }
.br-settings-ai-suggestion-panel {
    border: 1px solid #cfddd5;
    border-radius: 10px;
    background: #f7faf7;
    padding: 12px;
    margin: 9px 0 14px;
}
.br-settings-ai-suggestion-panel[hidden] { display: none; }
.br-settings-ai-tag-message { margin: 0 0 8px; font-size: .87rem; }
.br-settings-ai-suggestion-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.br-settings-ai-suggestion-options:empty { display: none; }
.br-settings-ai-tag-choice {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    border: 1px solid #b6cec1;
    border-radius: 999px;
    background: #fff;
    padding: 7px 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
}
.br-settings-ai-tag-choice .form-check-input { margin: 0; flex: none; }
.br-settings-ai-credit-note { font-weight: 600; }
@media (max-width: 480px) {
    .br-settings-ai-tags-heading { align-items: flex-start; }
    .br-settings-ai-tag-button { width: 100%; }
    .br-settings-ai-suggestion-panel { padding: 10px; }
}

/* Recipe Builder: review missing ingredient weights in one balanced dialog. */
.br-builder-weights-banner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem; padding: .85rem 1rem;
    margin: .75rem 0 1rem; border: 1px solid #dfd7be;
    border-radius: 12px; background: #faf7ed;
}
.br-builder-weights-banner-copy, .br-builder-weights-banner-actions {
    display: flex; align-items: center; flex-wrap: wrap; gap: .55rem;
}
.br-builder-weights-banner-copy { font-size: .9rem; color: #523f1d; }
.br-builder-weights-banner-actions .btn { white-space: nowrap; }
.br-weight-fix-body { padding: 1rem 1.15rem; }
.br-weight-fix-intro { margin: 0 0 1rem; color: #465650; }
.br-weight-fix-toolbar { display: flex; gap: .65rem; flex-wrap: wrap;
    align-items: center; margin-bottom: 1rem; }
.br-weight-fix-toolbar span { color: #5b625e; font-size: .83rem; }
.br-weight-fix-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.br-weight-fix-item { border: 1px solid #dee4df; border-radius: 12px;
    padding: .9rem; min-width: 0; background: #fbfbf8; }
.br-weight-fix-name { display: flex; justify-content: space-between; align-items: flex-start;
    gap: .75rem; line-height: 1.4; }
.br-weight-fix-name strong { color: #173b2f; overflow-wrap: anywhere; }
.br-weight-fix-name small { display: block; margin-top: .2rem; color: #69766f; }
.br-weight-fix-amount { flex-shrink: 0; font-weight: 700; color: #285345; }
.br-weight-fix-fields { display: flex; align-items: end; gap: .6rem; margin-top: .7rem; }
.br-weight-fix-input { flex: 1; min-width: 0; }
.br-weight-fix-input .form-label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: .25rem; }
.br-weight-fix-edit { flex-shrink: 0; min-height: 38px; }
.br-weight-fix-note { color: #56625a; font-size: .8rem; margin: .55rem 0 0; }
.br-weight-fix-suggestion { display: flex; align-items: baseline; gap: .4rem;
    flex-wrap: wrap; margin-top: .55rem; font-size: .78rem; color: #657169; }
.br-weight-fix-suggestion button { font-weight: 600; }
@media (max-width: 860px) {
    .br-weight-fix-items { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .br-builder-weights-banner-actions, .br-builder-weights-banner-actions .btn { width: 100%; }
    .br-weight-fix-fields { align-items: stretch; flex-direction: column; }
    .br-weight-fix-edit { align-self: stretch; }
}
.br-sf-ingredient-row[hidden], .br-sf-ingredient-group[hidden] { display: none !important; }
.br-weight-fix-global { margin-top: .7rem; border-top: 1px solid #dbe4dc; padding-top: .6rem; }
.br-weight-fix-global summary { font-size: .8rem; color: #1c513e; font-weight: 700; cursor: pointer; }
.br-weight-fix-global .form-label { font-size: .78rem; font-weight: 700; margin: .5rem 0 .2rem; }
.br-weight-fix-global-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 500px) { .br-weight-fix-global-fields { grid-template-columns: minmax(0, 1fr); } }

/* Optional AI estimate review in the recipe-scoped weight editor. */
.br-weight-ai-button { white-space: nowrap; }
.br-weight-ai-status { font-size: .85rem; margin: -.35rem 0 .85rem; padding: .65rem .8rem;
    background: #f3f6f3; border: 1px solid #d8e4dc; border-radius: .6rem; color: #214c3c; }
.br-weight-ai-status.is-warning { background: #fff8ea; border-color: #e9d3a9; color: #624b22; }
.br-weight-ai-row-message { font-size: .8rem; margin: .4rem 0 0; color: #496153;
    padding: .4rem .55rem; border-radius: .4rem; background: #f0f5ee; }
.br-weight-ai-row-message::before { content: "AI estimate · "; font-weight: 700; }
@media (max-width: 480px) { .br-weight-ai-button { width: 100%; } }

/* Recipe Builder weight review: the form wraps BOTH the body and footer.
   A Bootstrap scrollable dialog only constrains direct children of the modal
   content, so without a flex-constrained form the footer gets clipped. */
#recipeMissingWeightsModal .modal-dialog-scrollable .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

#recipeMissingWeightsModal form[data-recipe-weight-form] {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

#recipeMissingWeightsModal form[data-recipe-weight-form] > .br-weight-fix-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

#recipeMissingWeightsModal form[data-recipe-weight-form] > .modal-footer {
    flex: 0 0 auto;
}

/* Recipe Builder, phone layout: keep the editing tools visible without
   letting utility actions consume more space than the ingredient list. */
@media (max-width: 575.98px) {
    .br-builder-tabs {
        gap: 4px;
        margin: 6px 0 9px;
        padding-block: 2px;
        scrollbar-width: thin;
    }

    .br-builder-tabs .br-builder-tab {
        min-height: 34px;
        gap: 4px;
        padding: 5px 8px;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .br-builder-tabs .br-builder-tab > span {
        min-width: 17px;
        height: 17px;
        padding-inline: 4px;
        font-size: 0.6rem;
    }

    [data-builder-panel="ingredients"] .br-sf-editor {
        padding-top: 3px;
        padding-bottom: 14px;
    }

    [data-builder-panel="ingredients"] .br-sf-section-header {
        flex-wrap: wrap;
        align-items: center;
        gap: 7px 10px;
        margin-bottom: 7px;
    }

    [data-builder-panel="ingredients"] .br-sf-section-header > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    [data-builder-panel="ingredients"] .br-sf-section-header h2 {
        font-size: 1.12rem;
        line-height: 1.2;
    }

    /* The edit hint is helpful on desktop but redundant on phones, where the
       ingredient rows themselves already look and behave like buttons. */
    [data-builder-panel="ingredients"] .br-sf-section-header > div:first-child > p {
        display: none;
    }

    [data-builder-panel="ingredients"] .br-sf-section-header > .br-sf-reorder-toggle {
        order: 1;
        min-height: 34px;
        padding: 5px 3px;
        white-space: nowrap;
    }

    /* Put source-repair actions on their own short row rather than squeezing
       them between the heading and Reorder into several wrapped lines. */
    [data-builder-panel="ingredients"] .br-sf-section-header > form {
        order: 2;
        flex: 1 1 100%;
        margin: 0;
    }

    [data-builder-panel="ingredients"] .br-sf-section-header > form > .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        width: 100%;
        min-height: 36px;
        padding: 6px 9px;
        font-size: 0.74rem;
        line-height: 1.2;
        white-space: normal;
    }

    [data-builder-panel="ingredients"] .br-builder-weights-banner {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        margin: 6px 0 9px;
        padding: 9px 10px;
        border-radius: 10px;
    }

    [data-builder-panel="ingredients"] .br-builder-weights-banner-copy {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 6px;
        row-gap: 2px;
        font-size: 0.77rem;
        line-height: 1.25;
    }

    [data-builder-panel="ingredients"] .br-builder-weights-banner-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    [data-builder-panel="ingredients"] .br-builder-weights-banner-actions > .btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 6px 7px;
        font-size: 0.72rem;
        font-weight: 750;
        line-height: 1.15;
        white-space: normal;
        text-align: center;
    }

    [data-builder-panel="ingredients"] .br-sf-step-group-title {
        margin-bottom: 2px;
        font-size: 0.78rem;
    }

    [data-builder-panel="ingredients"] .br-sf-ingredient-row {
        min-height: 50px;
    }

    [data-builder-panel="ingredients"] .br-sf-ingredient-row .br-sf-row-main {
        min-height: 50px;
        padding: 5px 34px 5px 2px;
    }

    [data-builder-panel="ingredients"] .br-sf-ingredient-row-unlinked .br-sf-row-main {
        padding-right: 74px;
    }

    [data-builder-panel="ingredients"] .br-sf-food-icon {
        flex-basis: 29px;
        width: 29px;
        height: 29px;
        margin-right: 8px;
    }

    [data-builder-panel="ingredients"] .br-sf-primary-line {
        gap: 3px 5px;
        line-height: 1.3;
    }

    [data-builder-panel="ingredients"] .br-sf-amount,
    [data-builder-panel="ingredients"] .br-sf-item-name {
        font-size: 0.78rem;
    }

    [data-builder-panel="ingredients"] .br-sf-secondary-line {
        gap: 2px 6px;
        margin-top: 1px;
        font-size: 0.65rem;
        line-height: 1.25;
    }

    [data-builder-panel="ingredients"] .br-sf-secondary-line > span + span::before {
        margin-right: 6px;
    }

    [data-builder-panel="ingredients"] .br-sf-resolve-button {
        width: 34px;
        height: 38px;
    }

    [data-builder-panel="ingredients"] .br-sf-remove-button {
        width: 30px;
        height: 38px;
    }
}

@media (max-width: 350px) {
    [data-builder-panel="ingredients"] .br-builder-weights-banner-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* Recipe Builder missing-weight modal: compact, usable phone layout.
   This is intentionally modal-scoped so desktop and other popups keep their styling. */
.br-weight-action-mobile,
.br-weight-fix-toolbar-credit { display: none; }
.br-weight-fix-guidance { margin: -.45rem 0 .8rem; color: #58675e; font-size: .81rem; }
.br-weight-fix-guidance summary { color: #21513f; font-weight: 700; cursor: pointer; }
.br-weight-fix-guidance summary .fa-solid { margin-right: .25rem; }
.br-weight-fix-guidance p { margin: .35rem 0 0; }
#recipeMissingWeightsModal .br-weight-fix-toolbar > button > span {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

@media (max-width: 575.98px) {
    /* Center a shorter dialog inside the phone's actual visible viewport.
       Bootstrap's centered dialog normally has a viewport-sized min-height;
       reset that here or the modal can spill below the screen. */
    #recipeMissingWeightsModal .modal-dialog.modal-dialog-scrollable {
        width: calc(100% - 12px);
        max-width: none;
        min-height: 0;
        height: min(680px, 82vh);
        height: min(680px, 82dvh);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        margin: max(10px, calc((100vh - min(680px, 82vh)) / 2)) auto;
        margin: max(10px, calc((100dvh - min(680px, 82dvh)) / 2)) auto;
        align-items: stretch;
    }

    #recipeMissingWeightsModal .modal-dialog-scrollable .modal-content {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 13px;
        overflow: hidden;
    }

    /* The form wraps both the ingredient content and the Save footer. Give
       it a real shrink boundary; only the middle section may scroll. */
    #recipeMissingWeightsModal form[data-recipe-weight-form] {
        flex: 1 1 0%;
        min-height: 0;
        overflow: hidden;
    }

    #recipeMissingWeightsModal form[data-recipe-weight-form] > .br-weight-fix-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #recipeMissingWeightsModal form[data-recipe-weight-form] > .modal-footer {
        flex: 0 0 auto;
    }

    #recipeMissingWeightsModal .br-popup-modal-header {
        flex: 0 0 auto;
        padding: .58rem .75rem;
    }

    #recipeMissingWeightsModal .br-popup-modal-heading .br-section-kicker {
        font-size: .64rem;
        line-height: 1.2;
    }

    #recipeMissingWeightsModal .br-popup-modal-heading .modal-title {
        font-size: 1.05rem;
        line-height: 1.2;
    }

    #recipeMissingWeightsModal .br-weight-fix-body {
        padding: .65rem .7rem .7rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-intro {
        font-size: .8rem;
        line-height: 1.35;
        margin: 0 0 .3rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-guidance {
        margin: 0 0 .65rem;
        font-size: .75rem;
        line-height: 1.3;
    }

    #recipeMissingWeightsModal .br-weight-fix-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 7px;
        margin: 0 0 .3rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-toolbar > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .35rem;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        margin: 0;
        padding: .45rem .35rem;
        font-size: .74rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
    }

    #recipeMissingWeightsModal .br-weight-fix-toolbar .br-weight-fix-tool-note,
    #recipeMissingWeightsModal .br-weight-action-desktop { display: none; }
    #recipeMissingWeightsModal .br-weight-action-mobile { display: inline; }
    #recipeMissingWeightsModal .br-weight-fix-toolbar-credit {
        display: block;
        margin: 0 0 .45rem;
        color: #657067;
        font-size: .7rem;
        line-height: 1.3;
    }

    #recipeMissingWeightsModal .br-weight-ai-status {
        margin: 0 0 .5rem;
        padding: .45rem .55rem;
        font-size: .75rem;
        line-height: 1.35;
        border-radius: .5rem;
    }
    #recipeMissingWeightsModal .br-weight-ai-status[hidden],
    #recipeMissingWeightsModal .br-weight-ai-row-message[hidden] { display: none; }

    #recipeMissingWeightsModal .br-weight-fix-items {
        grid-template-columns: minmax(0, 1fr);
        gap: .5rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-item {
        border-radius: 9px;
        padding: .58rem .65rem .65rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-name {
        align-items: baseline;
        gap: .45rem;
        font-size: .85rem;
        line-height: 1.25;
    }

    #recipeMissingWeightsModal .br-weight-fix-name small {
        display: block;
        margin: .07rem 0 0;
        font-size: .72rem;
        line-height: 1.2;
    }

    #recipeMissingWeightsModal .br-weight-fix-amount {
        font-size: .8rem;
        white-space: nowrap;
    }

    #recipeMissingWeightsModal .br-weight-fix-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: .45rem;
        margin-top: .45rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-input { min-width: 0; }

    #recipeMissingWeightsModal .br-weight-fix-input .form-label {
        font-size: .72rem;
        line-height: 1.2;
        margin-bottom: .2rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-input .form-control {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: .45rem .55rem;
        font-size: 1rem; /* iPhone: prevent focus zoom */
    }

    #recipeMissingWeightsModal .br-weight-fix-edit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .35rem;
        align-self: end;
        width: auto;
        min-width: 80px;
        min-height: 40px;
        padding: .35rem .6rem;
        font-size: .78rem;
        white-space: nowrap;
    }

    #recipeMissingWeightsModal .br-weight-fix-note,
    #recipeMissingWeightsModal .br-weight-fix-suggestion {
        margin: .38rem 0 0;
        font-size: .72rem;
        line-height: 1.32;
    }

    #recipeMissingWeightsModal .br-weight-ai-row-message {
        margin-top: .4rem;
        padding: .35rem .45rem;
        font-size: .72rem;
    }

    #recipeMissingWeightsModal .br-weight-fix-global {
        margin-top: .5rem;
        padding-top: .45rem;
    }
    #recipeMissingWeightsModal .br-weight-fix-global-fields { gap: .35rem; }

    #recipeMissingWeightsModal form[data-recipe-weight-form] > .modal-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
        gap: .5rem;
        padding: .5rem .7rem calc(.5rem + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #e3e9e3;
    }

    #recipeMissingWeightsModal form[data-recipe-weight-form] > .modal-footer > .btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        margin: 0;
        padding: .4rem .35rem;
        font-size: .8rem;
        line-height: 1.2;
    }
}

@media (max-width: 350px) {
    #recipeMissingWeightsModal .br-weight-fix-toolbar > button { font-size: .7rem; gap: .25rem; }
    #recipeMissingWeightsModal .br-weight-fix-body { padding-inline: .55rem; }
    #recipeMissingWeightsModal .br-weight-fix-item { padding-inline: .5rem; }
}


/* Recipe print preview: measured, real-size sheets (Letter/A4) and page breaks. */
.br-print-preview-shell {
    padding: 34px 24px 60px;
    overflow-x: auto;
}
.br-print-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}
/* The one authoritative markup remains measurable, but is never shown/printed. */
.br-print-source-wrap {
    position: absolute !important;
    left: -100000px !important;
    top: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.br-print-sheet.br-print-page {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 8.5in;
    height: 11in;
    min-height: 11in;
    margin: 0;
    padding: 0.42in;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 18px rgba(22, 38, 32, 0.09);
}
.br-print-sheet.br-print-page.is-a4 {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    padding: 10mm;
}
.br-print-page-content {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: visible;
}
.br-print-page-footer {
    box-sizing: border-box;
    flex: 0 0 0.2in;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding-top: 3px;
    color: #727e78;
    font-size: 0.55rem;
}
/* Do not hide content simply because this is a long recipe. Split into sheets. */
.br-print-sheet.br-print-page .br-print-section {
    break-inside: auto;
}
@media print {
    body.br-printing-recipe .br-print-source-wrap {
        display: none !important;
    }
    body.br-printing-recipe .br-print-pages {
        display: block !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.br-printing-recipe .br-print-sheet.br-print-page,
    body.br-printing-recipe .br-print-sheet.br-print-page.is-letter {
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        width: 8.5in !important;
        min-height: 11in !important;
        height: 11in !important;
        max-height: 11in !important;
        margin: 0 !important;
        padding: 0.42in !important;
        overflow: hidden !important;
        background: #fff !important;
        box-shadow: none !important;
        break-after: page;
        page-break-after: always;
    }
    body.br-printing-recipe .br-print-sheet.br-print-page.is-a4 {
        width: 210mm !important;
        min-height: 297mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        padding: 10mm !important;
    }
    body.br-printing-recipe .br-print-sheet.br-print-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }
    body.br-printing-recipe .br-print-page-content {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
    body.br-printing-recipe .br-print-page-footer {
        flex: 0 0 0.2in !important;
    }
}

/* Explicitly honor section toggles in the on-screen paginated preview. */
.br-print-sheet [hidden] { display: none !important; }
.br-print-hero:has(> .br-print-hero-image[hidden]) { grid-template-columns: minmax(0, 1fr); }

/* ========================================================================== */
/* Recipe detail readability: screen only. Preserve print/PDF typography.     */
/* ========================================================================== */
@media screen {
    /* Summary and recipe metadata */
    .br-rd-owner { font-size: 0.88rem; }
    .br-rd-tags span,
    .br-rd-owner-status span {
        min-height: 29px;
        font-size: 0.78rem;
    }
    .br-rd-description {
        color: #53635b;
        font-size: 1rem;
        line-height: 1.6;
    }
    .br-rd-time-grid span { font-size: 0.77rem; }
    .br-rd-time-grid strong { font-size: 0.88rem; }
    .br-rd-community > span,
    .br-rd-community button,
    .br-rd-save-recipe,
    .br-rd-share-action,
    .br-rd-community-stat { font-size: 0.88rem; }
    .br-rd-interaction-count { font-size: 0.75rem; }
    .br-rd-rating-star { font-size: 0.9rem; }
    .br-rd-rating-copy { font-size: 0.83rem; }
    .br-rd-rating-copy > small { font-size: 0.76rem; }

    /* Section headings and interactive labels */
    .br-rd-card-heading h2,
    .br-rd-section-heading h2 { font-size: 1.17rem; }
    .br-rd-card-heading > a,
    .br-rd-nutrition-link { font-size: 0.83rem; }
    .br-rd-section-heading p,
    .br-rd-serving-control > span { font-size: 0.86rem; }
    .br-rd-convert-units-button { font-size: 0.84rem; }
    .br-rd-unit-menu strong { font-size: 0.88rem; }
    .br-rd-unit-menu small { font-size: 0.77rem; }
    .br-rd-edit-section { font-size: 0.84rem; }

    /* Ingredient quantities, names and optional preparation notes */
    .br-rd-ingredient-primary {
        font-size: 1rem;
        line-height: 1.48;
    }
    .br-rd-ingredient-secondary {
        color: #65776e;
        font-size: 0.84rem;
        line-height: 1.4;
    }
    .br-rd-ingredient-group h3,
    .br-rd-instruction-group h3 { font-size: 0.85rem; }

    /* Steps: the text readers need to follow while cooking */
    .br-rd-step > strong { font-size: 0.93rem; }
    .br-rd-step p {
        font-size: 1rem;
        line-height: 1.65;
    }
    .br-rd-step > span { font-size: 0.84rem; }

    /* Nutrition and secondary detail blocks */
    .br-rd-calories span { font-size: 0.83rem; }
    .br-rd-nutrition-list > div {
        font-size: 0.91rem;
        line-height: 1.4;
    }
    .br-rd-serving-note { font-size: 0.79rem; }
    .br-rd-full-nutrition-row span,
    .br-rd-full-nutrition-row strong { font-size: 0.91rem; }
    .br-rd-full-nutrition-row small { font-size: 0.75rem; }
    .br-rd-note-actions > span,
    .br-rd-batch-label { font-size: 0.8rem; }
    .br-rd-empty { font-size: 0.94rem; }
}


/* ========================================================================== */
/* Recipe print readability: page preview AND actual printed Letter/A4 sheets. */
/* Keep the same type metrics in both modes so measured pagination stays true.  */
/* ========================================================================== */
.br-print-sheet .br-print-brand strong { font-size: 0.82rem; }
.br-print-sheet .br-print-brand span { font-size: 0.62rem; }
.br-print-sheet .br-print-recipe-link {
    font-size: 0.66rem;
    line-height: 1.4;
}
/* Sizes calibrated against Samsung Food's uploaded Firefox Letter PDF.
   Firefox in this print layout emits 11.25 pt per 1rem. Matching target:
   title 21.6 pt, section headings 13.2 pt, primary reading text 9.6 pt,
   supporting notes and nutrition 8.4 pt. Keep preview and print identical. */
.br-print-sheet .br-print-owner {
    font-size: 0.747rem; /* 8.4 pt */
    line-height: 1.35;
}
.br-print-sheet .br-print-hero-copy h1 {
    font-size: 1.92rem; /* 21.6 pt */
    line-height: 1.12;
}
.br-print-sheet .br-print-hero-copy p {
    font-size: 0.85333rem; /* 9.6 pt */
    line-height: 1.55;
}
.br-print-sheet .br-print-section h2 { font-size: 1.17333rem; /* 13.2 pt */ }
.br-print-sheet .br-print-section-title > span { font-size: 0.74667rem; /* 8.4 pt */ }
.br-print-sheet .br-print-ingredient-grid { gap: 13px 18px; }
.br-print-sheet .br-print-ingredient-line {
    font-size: 0.85333rem; /* 9.6 pt */
    line-height: 1.38;
}
.br-print-sheet .br-print-ingredient-note {
    color: #5b6d63;
    font-size: 0.74667rem; /* 8.4 pt */
    line-height: 1.35;
}
.br-print-sheet .br-print-instructions { gap: 14px; }
.br-print-sheet .br-print-instructions h3 { font-size: 0.79rem; }
.br-print-sheet .br-print-instructions article strong {
    font-size: 0.85333rem; /* 9.6 pt */
    line-height: 1.4;
}
.br-print-sheet .br-print-instructions article p {
    font-size: 0.85333rem; /* 9.6 pt */
    line-height: 1.55;
}
.br-print-sheet .br-print-instructions article small { font-size: 0.74667rem; /* 8.4 pt */ }
.br-print-sheet .br-print-nutrition-grid > div {
    font-size: 0.74667rem; /* 8.4 pt */
    line-height: 1.45;
    padding: 6px 0;
}
.br-print-sheet .br-print-rating-row { font-size: 0.75rem; }
.br-print-sheet .br-print-notes p { font-size: 0.75rem; }
.br-print-sheet .br-print-muted { font-size: 0.68rem; }
.br-print-sheet .br-print-page-footer { font-size: 0.66rem; }
