﻿.group-container {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.group-card {
    border: 1px solid var(--rz-border-color, #dcdcdc);
    border-radius: 8px;
    padding: 1rem;
    background: var(--rz-background, #fff);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

    .group-card:focus {
        outline: 2px solid var(--rz-secondary, #6200ee);
        outline-offset: 2px;
    }

.group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.new-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist-item {
    border: 1px solid var(--rz-border-color, #dcdcdc);
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    background: var(--rz-card-background, #fafafa);
    position: relative;
}

.checklist-item.checklist-item-missing-product {
    border-color: #dc2626;
    background: #fef2f2;
}

    .checklist-item:focus {
        outline: 2px solid var(--rz-secondary, #6200ee);
        outline-offset: 2px;
    }

.item-main {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
}

    .item-main .item-name {
        flex: 1 1 200px;
    }

    .item-main .item-desc {
        flex: 1 1 240px;
    }

.item-product {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    color: var(--rz-text-color, #4a4a4a);
    background: transparent;
    cursor: grab;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    opacity: 0;
}

.group-handle {
    margin-right: 0.5rem;
}

.item-handle {
    margin-right: 0.5rem;
}

.group-card:hover .group-handle,
.group-card:focus-within .group-handle,
.checklist-item:hover .item-handle,
.checklist-item:focus-within .item-handle {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
    background: var(--rz-base-200, rgba(0, 0, 0, 0.08));
}

.group-card.dragging,
.checklist-item.dragging {
    opacity: 0.6;
}

.group-card.drop-target-before::before,
.group-card.drop-target-after::after,
.checklist-item.drop-target-before::before,
.checklist-item.drop-target-after::after {
    content: "";
    position: absolute;
    left: -1rem;
    right: -1rem;
    height: 4px;
    background: var(--rz-primary, #6200ee);
    border-radius: 2px;
    opacity: 0.4;
}

.group-card.drop-target-before::before,
.checklist-item.drop-target-before::before {
    top: -0.5rem;
}

.group-card.drop-target-after::after,
.checklist-item.drop-target-after::after {
    bottom: -0.5rem;
}

.group-drop-placeholder,
.item-drop-placeholder {
    border: 2px dashed var(--rz-primary, #6200ee);
    border-radius: 8px;
    background: rgba(98, 0, 238, 0.08);
}

.group-drop-placeholder {
    height: 64px;
    grid-column: 1 / -1;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    .recipe-safety-dialog {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .recipe-safety-dialog__section,
    .recipe-safety-dialog__print-chunk,
    .recipe-safety-dialog__chart-panel {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .recipe-safety-dialog__content {
        gap: 1rem;
    }
}

.item-drop-placeholder {
    height: 52px;
    margin: 0.25rem 0;
}

.media-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.media-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.youtube-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .item-main, .item-product, .new-item-row, .youtube-input {
        flex-direction: row;
        align-items: stretch;
    }
}
.recipe-safety-dialog {
    width: min(calc(100vw - 2rem), 880px);
    max-width: 880px;
    margin: 0 auto;
}

.recipe-safety-dialog__toolbar {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.recipe-safety-dialog__meta {
    color: #555;
    font-weight: 500;
}

.recipe-safety-dialog__content {
    width: 100%;
}

.recipe-safety-dialog__section {
    padding: 1rem;
}

.detail-group-card__hint {
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color);
}

.recipe-safety-dialog__table-scroll {
    overflow-x: auto;
}

.recipe-safety-dialog__additive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 320px;
}

    .recipe-safety-dialog__additive-table th,
    .recipe-safety-dialog__additive-table td {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid #eaeaea;
        text-align: left;
        vertical-align: top;
    }

    .recipe-safety-dialog__additive-table th {
        background: #f7f7f7;
        font-weight: 600;
    }

    .recipe-safety-dialog__additive-table tr:last-child td {
        border-bottom: none;
    }

.recipe-safety-dialog__macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.recipe-safety-dialog__chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.recipe-safety-dialog__chart-panel {
    background: #f7f7f7;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recipe-safety-dialog__chart-title {
    font-weight: 600;
}

.recipe-safety-dialog__macro-table {
    background: #f7f7f7;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-safety-dialog__macro-title {
    font-weight: 600;
}

.recipe-safety-dialog__macro-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .recipe-safety-dialog__macro-table th,
    .recipe-safety-dialog__macro-table td {
        padding: 0.4rem 0;
    }

    .recipe-safety-dialog__macro-table th {
        text-align: left;
        color: #424242;
        font-weight: 600;
        padding-right: 0.5rem;
    }

    .recipe-safety-dialog__macro-table td {
        text-align: right;
        color: #1c1c1c;
    }

        .recipe-safety-dialog__macro-table td:last-child {
            width: 3.25rem;
            text-align: left;
            padding-left: 0.5rem;
            color: #616161;
        }

.recipe-safety-dialog__macro-table table tbody tr:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.recipe-safety-dialog__macro-table table tbody tr:last-child {
    border-bottom: none;
}

.recipe-safety-dialog--export {
    background: #ffffff;
    width: 210mm;
    max-width: 210mm;
    margin: 0 auto;
    padding: 0;
}

.recipe-safety-dialog--export .recipe-safety-dialog__toolbar {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.recipe-safety-dialog--export .recipe-safety-dialog__actions {
    display: none !important;
}

.recipe-safety-dialog--export .recipe-safety-dialog__section,
.recipe-safety-dialog--export .detail-groups__block {
    break-inside: avoid;
    page-break-inside: avoid;
}

.rezept-container--export {
    box-shadow: none;
    width: 210mm;
    max-width: 210mm;
    margin: 0 auto;
}

.rezept-container--export .rezept-inhalt {
    padding: 1.25rem 1.5rem;
}

@media (max-width: 600px) {
    .recipe-safety-dialog__toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .recipe-safety-dialog {
        width: 100%;
        max-width: none;
    }
}

.rezept-kopf {
    position: relative;
}

.recipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recipe-print-button {
    border: none;
    background: #1f2937;
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.recipe-print-button:hover,
.recipe-print-button:focus {
    background: #111827;
    transform: translateY(-1px);
}

.recipe-edit-button {
    border-radius: 999px;
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: #e5e7eb;
    color: #1f2937;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.recipe-edit-button:hover,
.recipe-edit-button:focus {
    background: #d1d5db;
}

.safety-button {
    border: none;
    background: #fff3cd;
    color: #8a6d3b;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.safety-button:hover,
.safety-button:focus {
    background: #ffe082;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.ingredient-group {
    margin-bottom: 1.5rem;
}

.ingredient-group__title {
    margin-bottom: 0.5rem;
}

.ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    background: #fafafa;
}

.ingredient-item {
    position: relative;
    padding: 0.2rem 0.9rem;  
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

    .ingredient-item:hover,
    .ingredient-item:focus-within {
        background: #f0f0f0;
    }

.ingredient-item__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.ingredient-item__name {
    font-weight: 600;
    font-size: 1.05rem;
}

.ingredient-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
}

.ingredient-item__product-name {
    font-weight: 600;
    color: #2f4858;
}

.ingredient-item__product-quantity,
.ingredient-item__quantity {
    font-size: 0.9rem;
    color: #555;
    min-width: 80px;
}

.ingredient-item__description {
    font-size: 0.9rem;
    color: #555;
}

.ingredient-item__summary {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 30;
}

.ingredient-item:hover .ingredient-item__summary,
.ingredient-item:focus-within .ingredient-item__summary {
    opacity: 1;
    visibility: visible;
}

.media-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-top: 1rem;
}

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.thumb-wrapper {
    flex-shrink: 0;
}


.labeling-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.labeling-section__block h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.labeling-section__subheader {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.labeling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.35rem 0.75rem;
}

.labeling-grid__item {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
}

.labeling-grid__description {
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color);
}

.detail-groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-groups__block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-groups__title {
    font-weight: 600;
}

.labeling-grid__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.labeling-grid__chip {
    font-size: 0.8rem;
}

.additive-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.additive-detail-card {
    border: 1px solid var(--rz-base-300);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--rz-base-0);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.additive-detail-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.additive-detail-card__chips,
.additive-detail-card__standards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.additive-detail-card__chip,
.additive-detail-card__code {
    font-size: 0.8rem;
}

.additive-detail-card__products {
    font-size: 0.9rem;
    color: var(--rz-text-secondary-color);
}

@media (min-width: 768px) {
    .labeling-section {
        flex-direction: row;
    }
}


.labeling-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.labeling-section__block h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.labeling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.35rem 0.75rem;
}

.labeling-grid__item {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
}

.labeling-grid__description {
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color);
}

.labeling-grid__products {
    font-size: 0.85rem;
    color: var(--rz-text-secondary-color);
}

.additive-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.additive-detail-card {
    border: 1px solid var(--rz-base-300);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--rz-base-0);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.additive-detail-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.additive-detail-card__products {
    font-size: 0.9rem;
    color: var(--rz-text-secondary-color);
}

@media (min-width: 768px) {
    .labeling-section {
        flex-direction: row;
    }
}
