.zzz-materials__block { margin-bottom: 4px; }

.zzz-materials__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
}
.zzz-materials__title--kind { margin-top: 16px; }
.zzz-materials__sub {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--zzz-text-muted, #6b7280);
}

.zzz-section__content ul.zzz-mat-grid,
ul.zzz-mat-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.zzz-section__content ul.zzz-mat-grid > li.zzz-mat,
ul.zzz-mat-grid > li.zzz-mat {
    display: block;
    list-style: none;
    margin: 0;
    padding-left: 6px;
}
ul.zzz-mat-grid > li.zzz-mat::marker { content: ''; }
ul.zzz-mat-grid > li.zzz-mat::before { content: none; }

.zzz-mat {
    --mat-c: #9ca3af;
    --mat-bg: color-mix(in srgb, var(--mat-c) 12%, #fff);
    position: relative;
    min-width: 92px;
    width: auto;
    padding: 8px 6px 6px;
    border: 2px solid var(--mat-c);
    border-radius: 12px;
    background: var(--mat-bg);
    text-align: center;
    box-sizing: border-box;
    cursor: default;
    outline: none;
}
.zzz-mat--rs { --mat-c: #d9a441; }
.zzz-mat--ra { --mat-c: #9b5de5; }
.zzz-mat--rb { --mat-c: #3b82f6; }
.zzz-mat--rc { --mat-c: #22c55e; }
.zzz-mat--exp { --mat-c: #9ca3af; }

.zzz-mat__frame {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 5px;
}
.zzz-mat__icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.zzz-mat__icon--text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--zzz-text-muted, #6b7280);
    border-radius: 12px;
    background: rgba(255, 255, 255, .6);
}
.zzz-mat__qty {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.zzz-mat::after {
    content: attr(data-name);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    max-width: 220px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(17, 24, 39, .92);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
    width: max-content;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
    z-index: 5;
}
.zzz-mat:hover::after,
.zzz-mat:focus::after,
.zzz-mat:focus-within::after,
.zzz-mat:focus-visible::after { opacity: 1; }
.zzz-mat:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--mat-c); }

.zzz-materials__details {
    margin-top: 14px;
    border-top: 1px dashed var(--zzz-border, #e5e7eb);
    padding-top: 10px;
}
.zzz-materials__details > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.zzz-materials__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.zzz-materials__table th {
    width: 9.5em;
    text-align: left;
    vertical-align: top;
    padding: 8px 8px 8px 0;
    font-weight: 600;
    line-height: 1.35;
    border-bottom: 1px solid var(--zzz-border, #e5e7eb);
}
.zzz-materials__table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--zzz-border, #e5e7eb);
}
.zzz-mat-grid--phase { gap: 6px; }
.zzz-mat-grid--phase .zzz-mat { min-width: 66px; padding: 5px 4px 4px; border-radius: 10px; }
.zzz-mat-grid--phase .zzz-mat__frame { width: 44px; height: 44px; margin-bottom: 3px; }
.zzz-mat-grid--phase .zzz-mat__qty { font-size: 11.5px; }

@media (max-width: 767px) {
    .zzz-mat { min-width: 74px; padding: 6px 5px 5px; }
    .zzz-mat__frame { width: 50px; height: 50px; }
    .zzz-mat__qty { font-size: 12px; }
    .zzz-materials__table th { width: 6.5em; font-size: 12px; padding-right: 6px; }
    .zzz-mat-grid--phase .zzz-mat { min-width: 58px; }
    .zzz-mat-grid--phase .zzz-mat__frame { width: 38px; height: 38px; }
}

.zzz-mat > a.zzz-mat__link { display: block; color: inherit; text-decoration: none; outline: none; }
.zzz-mat:has(> a.zzz-mat__link:focus-visible) { box-shadow: 0 0 0 2px var(--preset-color-accent, #e07020); }
