.serving-calc-page {
    max-width: 100%;
}

.serving-calc-tool {
    max-width: 42rem;
    position: relative;
}

.serving-calc-search-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    margin-top: 0.25rem;
    max-height: 16rem;
    overflow: auto;
    background: #fff;
    border: 1px solid #d8ddd6;
    border-radius: 0.35rem;
    box-shadow: 0 0.35rem 1rem rgba(40, 50, 40, 0.12);
}

.serving-calc-search-results[hidden] {
    display: none !important;
}

.serving-calc-search-results button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eef2ec;
    background: transparent;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
}

.serving-calc-search-results button:hover,
.serving-calc-search-results button:focus {
    background: #f3f7f1;
    outline: none;
}

.serving-calc-selected__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #c9d2c6;
    border-radius: 0.5rem;
    background: #f7faf5;
}

.serving-calc-selected__name {
    font-weight: 600;
    margin: 0;
}

.serving-calc-controls[hidden] {
    display: none !important;
}

.serving-calc-multipliers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.serving-calc-output {
    border: 1px solid #e4ebe2;
    border-radius: 0.5rem;
    background: #fafcf9;
    padding: 0.85rem 1rem;
    min-height: 4rem;
}

.serving-calc-ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.serving-calc-ingredient-list li {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) 1fr;
    gap: 0.65rem 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eef2ec;
}

.serving-calc-ingredient-list li:last-child {
    border-bottom: 0;
}

.serving-calc-ingredient-list__amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #3d4a3d;
}

.serving-calc-ingredient-list__name {
    color: #2c332c;
}

.serving-calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

@media print {
    .serving-calc-search,
    .serving-calc-search-results,
    .serving-calc-controls,
    .serving-calc-actions,
    .js-start-serving-calc,
    header,
    .footer,
    nav {
        display: none !important;
    }

    .serving-calc-output {
        border: 0;
        background: transparent;
        padding: 0;
    }
}
