/* Fabric calculator (yardage breakdown) modal — opened from the editor
   topbar's "Materials" button. */

.materials-card {
    max-width: 720px;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.25rem;
}

.materials-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}
.materials-header h2 {
    margin: 0;
    font-family: var(--font-heading, var(--font-body));
    font-size: 1.3rem;
}

.materials-meta {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    font-size: .9rem;
    color: var(--text-soft);
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .8rem;
}

.materials-waste {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .9rem;
    color: var(--text-soft);
    margin-bottom: 1rem;
}
.materials-waste input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.materials-empty {
    color: var(--text-soft);
    text-align: center;
    padding: 2rem 0;
}

.materials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.materials-table th,
.materials-table td {
    padding: .55rem .4rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.materials-table th {
    font-weight: 600;
    color: var(--text-soft);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.materials-table td.num,
.materials-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.materials-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    border-bottom: none;
}

.materials-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, .15);
    background-color: #ccc;
    background-size: cover;
    background-position: center;
}

.materials-label {
    font-family: monospace;
    font-size: .85rem;
}

.materials-note {
    margin-top: 1rem;
    font-size: .82rem;
    color: var(--text-soft);
    line-height: 1.5;
    padding: .6rem .8rem;
    background: rgba(17, 112, 207, 0.06);
    border-radius: 8px;
    border-left: 3px solid #1170cf;
}

@media (max-width: 540px) {
    .materials-card { padding: .9rem; }
    .materials-table th,
    .materials-table td { padding: .4rem .25rem; font-size: .85rem; }
    /* Drop the area-cm² column on tiny screens */
    .materials-table th:nth-child(4),
    .materials-table td:nth-child(4) { display: none; }
    .materials-meta { gap: .6rem; }
}
