.meal-composer-shell {
    --meal-ink: #17352f;
    --meal-muted: #5c6f69;
    --meal-green: #075e54;
    --meal-green-hover: #0b776b;
    --meal-green-soft: #e8f3ef;
    --meal-saffron: #f2b544;
    --meal-canvas: #f8f5ed;
    --meal-surface: #fff;
    --meal-border: #ddd9cd;
    width: min(100% - 32px, 1240px);
    margin-inline: auto;
    padding: clamp(32px, 5vw, 64px) 0 80px;
    color: var(--meal-ink);
}

.meal-composer-shell * {
    box-sizing: border-box;
}

.meal-composer-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
}

.meal-composer-header h1 {
    max-width: 16ch;
    margin: 0;
    color: var(--meal-ink);
    font-family: Manrope, sans-serif;
    font-size: clamp(2rem, 4vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
    text-wrap: balance;
}

.meal-composer-header p {
    max-width: 58ch;
    margin: 0;
    color: var(--meal-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.meal-family-picker {
    position: relative;
    margin-bottom: 24px;
}

.meal-family-picker__label {
    display: block;
    margin-bottom: 9px;
    color: var(--meal-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.meal-family-rail {
    display: flex;
    gap: 8px;
    padding: 1px 2px 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: #9aaba5 transparent;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.meal-family-link {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    color: #38524b;
    background: var(--meal-surface);
    border: 1px solid var(--meal-border);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: color 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.meal-family-link:hover {
    color: var(--meal-green);
    background: #f2f6f3;
    border-color: #a9c7bf;
}

.meal-family-link:active {
    transform: scale(0.97);
}

.meal-family-link[aria-current="page"] {
    color: #fff;
    background: var(--meal-green);
    border-color: var(--meal-green);
}

.meal-alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    color: #7d3025;
    background: #fbe8e3;
    border: 1px solid #edc5bc;
    border-radius: 12px;
    font-weight: 700;
}

.meal-builder {
    position: relative;
}

.meal-builder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: clamp(24px, 4vw, 52px);
    align-items: start;
}

.meal-editor {
    min-width: 0;
    overflow: hidden;
    background: var(--meal-surface);
    border: 1px solid var(--meal-border);
    border-radius: 16px;
}

.meal-base-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    color: #fff;
    background: var(--meal-green);
}

.meal-base-strip__name {
    display: block;
    margin-bottom: 2px;
    font-size: 1.15rem;
    font-weight: 800;
}

.meal-base-strip__detail {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
}

.meal-base-strip__price {
    flex: 0 0 auto;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.meal-editor-section {
    padding: clamp(20px, 3vw, 28px);
}

.meal-editor-section + .meal-editor-section,
.meal-editor-section + .meal-optional-section,
.meal-optional-section + .meal-optional-section {
    border-top: 1px solid var(--meal-border);
}

.meal-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.meal-step-number {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    color: var(--meal-green);
    background: var(--meal-green-soft);
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.meal-section-heading h2,
.meal-optional-section summary h2 {
    margin: 0;
    color: var(--meal-ink);
    font-family: Manrope, sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.meal-section-heading p,
.meal-optional-section summary p {
    margin: 4px 0 0;
    color: var(--meal-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    text-wrap: pretty;
}

.meal-protein-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.meal-choice-label {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    min-height: 112px;
    align-items: start;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--meal-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}

.meal-choice-label:hover {
    border-color: #a9c7bf;
}

.meal-choice-label:active {
    transform: scale(0.985);
}

.meal-choice-label.is-selected {
    background: var(--meal-green-soft);
    border-color: #87b8ac;
    box-shadow: inset 0 0 0 1px #87b8ac;
}

.meal-choice-main {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
}

.meal-choice-main input,
.meal-extra-name input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--meal-green);
}

.meal-choice-name {
    color: var(--meal-ink);
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.35;
    text-wrap: pretty;
}

.meal-choice-price {
    color: var(--meal-green);
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.meal-choice-quantity {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--meal-muted);
    font-size: 0.76rem;
    opacity: 0.42;
    pointer-events: none;
    transition: opacity 160ms ease-out;
}

.meal-choice-label.is-selected .meal-choice-quantity {
    opacity: 1;
    pointer-events: auto;
}

.meal-stepper {
    display: inline-flex;
    max-width: 100%;
    align-items: stretch;
    overflow: hidden;
    background: #fff;
    border: 1px solid #9dbab3;
    border-radius: 9px;
}

.meal-stepper-button {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--meal-green);
    background: #fff;
    border: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: color 150ms ease-out, background-color 150ms ease-out, transform 150ms ease-out;
}

.meal-stepper-button:hover:not(:disabled) {
    color: #fff;
    background: var(--meal-green);
}

.meal-stepper-button:active:not(:disabled) {
    transform: scale(0.92);
}

.meal-stepper-button:disabled {
    color: #9aa9a4;
    background: #f0f1ed;
    cursor: not-allowed;
}

.meal-stepper .meal-stepper-input {
    display: block;
    width: 42px;
    min-width: 42px;
    height: 38px;
    margin: 0;
    padding: 0 3px;
    color: var(--meal-ink) !important;
    background: #fff !important;
    border: 0;
    border-right: 1px solid #cfdbd7;
    border-left: 1px solid #cfdbd7;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
    opacity: 1 !important;
    appearance: textfield;
    -moz-appearance: textfield;
    font-variant-numeric: tabular-nums;
}

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

.meal-included-select {
    width: 100%;
    min-height: 48px;
    padding: 10px 42px 10px 13px;
    color: var(--meal-ink);
    background-color: #fff;
    border: 1px solid #9dbab3;
    border-radius: 10px;
    font-size: 0.94rem;
    font-weight: 700;
}

.meal-optional-section {
    background: #fff;
}

.meal-optional-section summary {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    padding: 17px clamp(20px, 3vw, 28px);
    cursor: pointer;
    list-style: none;
    transition: background-color 150ms ease-out;
}

.meal-optional-section summary::-webkit-details-marker {
    display: none;
}

.meal-optional-section summary:hover {
    background: #faf9f4;
}

.meal-optional-section summary::after {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--meal-green);
    background: var(--meal-green-soft);
    border-radius: 9px;
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free";
    font-size: 0.88rem;
    font-weight: 900;
    content: "\f078";
    transition: transform 170ms ease-out;
}

.meal-optional-section[open] summary::after {
    transform: rotate(180deg);
}

.meal-optional-content {
    padding: 0 clamp(20px, 3vw, 28px) 24px;
}

.meal-extra-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.meal-extra-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 54px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--meal-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.meal-extra-row:hover {
    border-color: #a9c7bf;
}

.meal-extra-row.is-selected {
    background: var(--meal-green-soft);
    border-color: #87b8ac;
    box-shadow: inset 0 0 0 1px #87b8ac;
}

.meal-extra-name {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 8px;
    color: var(--meal-ink);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.35;
    cursor: pointer;
}

.meal-extra-price {
    color: var(--meal-green);
    font-size: 0.74rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.meal-extra-quantity {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--meal-muted);
    font-size: 0.74rem;
}

.meal-empty-option {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    color: var(--meal-muted);
    background: #f4f4ef;
    border-radius: 10px;
    font-size: 0.84rem;
}

.meal-summary {
    position: sticky;
    top: 104px;
    overflow: hidden;
    background: var(--meal-surface);
    border: 1px solid var(--meal-border);
    border-radius: 16px;
    box-shadow: 0 16px 38px rgba(23, 53, 47, 0.09);
}

.meal-summary__head {
    padding: 20px 20px 17px;
    color: #fff;
    background: var(--meal-green);
}

.meal-summary__head h2 {
    margin: 0 0 4px;
    color: #fff;
    font-family: Manrope, sans-serif;
    font-size: 1.08rem;
    font-weight: 800;
}

.meal-summary__head p {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.78rem;
}

.meal-summary__selection {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 8px 20px;
}

.meal-summary__row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #ece9df;
}

.meal-summary__row:last-child {
    border-bottom: 0;
}

.meal-summary__row dt {
    color: var(--meal-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.meal-summary__row dd {
    margin: 0;
    color: var(--meal-ink);
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.45;
    text-align: right;
    overflow-wrap: anywhere;
}

.meal-checkout {
    padding: 17px 20px 20px;
    background: #f7f6f0;
    border-top: 1px solid var(--meal-border);
}

.meal-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.meal-quantity-row label {
    color: var(--meal-ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.meal-total-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.meal-total-label {
    color: var(--meal-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.meal-total {
    color: var(--meal-green);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.meal-submit {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    color: #fff;
    background: var(--meal-green);
    border: 0;
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 160ms ease-out, box-shadow 160ms ease-out, transform 160ms ease-out;
}

.meal-submit:hover:not(:disabled) {
    background: var(--meal-green-hover);
    box-shadow: 0 9px 22px rgba(7, 94, 84, 0.22);
}

.meal-submit:active:not(:disabled) {
    transform: scale(0.975);
}

.meal-submit:disabled {
    color: #70817c;
    background: #d8dfdc;
    cursor: not-allowed;
}

.meal-mobile-checkout {
    display: none;
}

.meal-family-link:focus-visible,
.meal-choice-label:has(input:focus-visible),
.meal-extra-row:has(input:focus-visible),
.meal-stepper-button:focus-visible,
.meal-included-select:focus-visible,
.meal-optional-section summary:focus-visible,
.meal-submit:focus-visible {
    outline: 3px solid rgba(242, 181, 68, 0.78);
    outline-offset: 3px;
}

@media (min-width: 1120px) {
    .meal-protein-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 899.98px) {
    .meal-builder-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 20px;
    }

    .meal-protein-grid,
    .meal-extra-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .meal-composer-shell {
        width: min(100% - 24px, 1240px);
        padding: 26px 0 calc(168px + env(safe-area-inset-bottom));
    }

    .meal-composer-header {
        display: block;
        margin-bottom: 20px;
    }

    .meal-composer-header h1 {
        max-width: 12ch;
        font-size: clamp(1.85rem, 10vw, 2.55rem);
    }

    .meal-composer-header p {
        margin-top: 10px;
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .meal-family-picker {
        margin-right: -12px;
        margin-bottom: 18px;
    }

    .meal-family-rail {
        padding-right: 12px;
    }

    .meal-builder-grid {
        display: block;
    }

    .meal-editor {
        border-radius: 14px;
    }

    .meal-base-strip {
        padding: 15px 16px;
    }

    .meal-base-strip__name {
        font-size: 1rem;
    }

    .meal-editor-section {
        padding: 19px 16px;
    }

    .meal-protein-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .meal-choice-label {
        display: flex;
        min-height: 118px;
        flex-direction: column;
        gap: 7px;
        padding: 12px;
    }

    .meal-choice-price {
        margin-left: 27px;
    }

    .meal-choice-quantity {
        width: 100%;
        margin-top: auto;
    }

    .meal-choice-quantity > span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .meal-choice-quantity .meal-stepper {
        width: 100%;
    }

    .meal-choice-quantity .meal-stepper-button {
        flex: 1 1 0;
        width: auto;
    }

    .meal-optional-section summary {
        min-height: 72px;
        padding: 15px 16px;
    }

    .meal-optional-content {
        padding: 0 16px 19px;
    }

    .meal-extra-list {
        grid-template-columns: 1fr;
    }

    .meal-summary {
        position: static;
        margin-top: 14px;
        border-radius: 14px;
        box-shadow: none;
    }

    .meal-summary__head {
        display: none;
    }

    .meal-summary__selection {
        padding: 8px 16px;
    }

    .meal-checkout {
        padding: 13px 16px 16px;
    }

    .meal-checkout .meal-quantity-row {
        margin-bottom: 0;
    }

    .meal-checkout .meal-total-row,
    .meal-checkout > .meal-submit {
        display: none;
    }

    .meal-mobile-checkout {
        position: fixed;
        z-index: 55;
        right: 8px;
        bottom: calc(71px + env(safe-area-inset-bottom));
        left: 8px;
        display: grid;
        grid-template-columns: minmax(108px, 0.7fr) minmax(0, 1.3fr);
        gap: 9px;
        align-items: center;
        padding: 9px;
        background: #fff;
        border: 1px solid var(--meal-border);
        border-radius: 14px;
        box-shadow: 0 12px 36px rgba(23, 53, 47, 0.2);
    }

    .meal-mobile-total {
        min-width: 0;
        padding-left: 5px;
    }

    .meal-mobile-total span {
        display: block;
        margin-bottom: 2px;
        color: var(--meal-muted);
        font-size: 0.66rem;
        font-weight: 700;
    }

    .meal-mobile-total strong {
        display: block;
        overflow: hidden;
        color: var(--meal-green);
        font-size: 1rem;
        font-weight: 800;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .meal-mobile-checkout .meal-submit {
        min-height: 48px;
        padding-inline: 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 374.98px) {
    .meal-protein-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .meal-family-link,
    .meal-choice-label,
    .meal-choice-quantity,
    .meal-stepper-button,
    .meal-extra-row,
    .meal-optional-section summary::after,
    .meal-submit {
        transition-duration: 0.01ms;
    }
}
