.trace-dish-card {
    appearance: none;
    width: 100%;
    padding: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.trace-dish-card:hover,
.trace-dish-card:focus-visible {
    transform: translateY(-3px);
    border-color: #86efac;
    box-shadow: 0 14px 30px rgba(21, 128, 61, .12);
    outline: none;
}

.trace-dish-card .body {
    display: grid;
    gap: 7px;
}

.trace-dish-name {
    color: #173824;
    font-size: 16px;
}

.trace-dish-card .body > span:not(.trace-dish-action) {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.trace-dish-action {
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    color: #15803d;
    font-size: 12px;
    font-weight: 900;
}

.trace-lot-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    text-align: left;
}

.trace-lot-table th,
.trace-lot-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.trace-lot-table th {
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
}

.trace-lot-table small {
    color: #6b7280;
}

.trace-empty {
    padding: 22px !important;
    color: #6b7280;
    text-align: center;
}

.trace-dish-modal .modal-dialog {
    width: min(920px, 100%);
    overflow: visible;
}

.trace-dish-modal .modal-body {
    max-height: calc(90vh - 92px);
    overflow: auto;
}

.trace-modal-intro {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: #f7faf7;
}

.trace-modal-intro img {
    width: 150px;
    height: 105px;
    border-radius: 13px;
    object-fit: cover;
}

.trace-modal-intro p {
    margin: 0;
    color: #4b5563;
    line-height: 1.65;
}

.trace-ingredients-title {
    margin: 22px 0 12px;
    color: #173824;
}

.trace-ingredient-list {
    display: grid;
    gap: 12px;
}

.trace-ingredient-card {
    position: relative;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: #fff;
    outline: none;
}

.trace-ingredient-card:focus-visible {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .14);
}

.trace-ingredient-card > img {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
}

.trace-ingredient-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.trace-ingredient-main strong {
    color: #173824;
}

.trace-ingredient-main span,
.trace-hover-hint {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.45;
}

.trace-hover-hint {
    color: #15803d;
    font-weight: 800;
    white-space: nowrap;
}

.trace-ingredient-popover {
    position: absolute;
    right: 12px;
    bottom: calc(100% - 4px);
    z-index: 5;
    width: min(390px, calc(100vw - 70px));
    padding: 15px;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 70, 35, .2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(7px);
    transition: .18s ease;
}

.trace-ingredient-card:hover .trace-ingredient-popover,
.trace-ingredient-card:focus-within .trace-ingredient-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.trace-ingredient-popover > strong {
    color: #14532d;
}

.trace-ingredient-popover p {
    margin: 9px 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.6;
}

.trace-document-links {
    display: grid;
    gap: 7px;
}

.trace-document-links a {
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.trace-no-document {
    color: #92400e;
    font-size: 12px;
}

@media (max-width: 700px) {
    .trace-dishes .meal-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .trace-modal-intro {
        grid-template-columns: 1fr;
    }

    .trace-modal-intro img {
        width: 100%;
        height: 180px;
    }

    .trace-ingredient-card {
        grid-template-columns: 58px 1fr;
    }

    .trace-ingredient-card > img {
        width: 58px;
        height: 58px;
    }

    .trace-hover-hint {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
    }

    .trace-ingredient-popover {
        right: 0;
        left: 0;
        width: 100%;
    }
}
