/* ============================================
   SUBSTANCE TABLE — classification tables
   for acids, alkalis, chemicals
   ============================================ */

.tp-substance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 8px;
}

.tp-substance-table thead th {
    padding: 14px 18px;
    background: var(--tp-green-dark);
    color: var(--tp-white);
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.tp-substance-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--tp-cream-warm);
    color: var(--tp-text);
}

.tp-substance-table tbody tr {
    transition: background 0.2s;
}

.tp-substance-table tbody tr:hover {
    background: var(--tp-cream);
}

/* Octagonal class badge (hazard class I, II, III) */
.tp-class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-family: 'Unbounded', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--tp-white);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.tp-class-badge--1 { background: var(--tp-hazard-1); }
.tp-class-badge--2 { background: var(--tp-hazard-2); }
.tp-class-badge--3 { background: var(--tp-green-main); }

/* Precursor tag (inline label) */
.tp-precursor-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(232, 213, 47, 0.15);
    color: var(--tp-precursor-text);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   RESPONSIVE — ≤768px
   ============================================ */
@media (max-width: 768px) {
    .tp-substance-table {
        font-size: 13px;
    }

    .tp-substance-table thead th {
        padding: 10px 12px;
        font-size: 10px;
    }

    .tp-substance-table tbody td {
        padding: 10px 12px;
    }

    .tp-class-badge {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .tp-precursor-tag {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* Extra small — stack table */
@media (max-width: 480px) {
    .tp-substance-table thead {
        display: none;
    }

    .tp-substance-table tbody tr {
        display: block;
        padding: 12px;
        border-bottom: 1px solid var(--tp-cream-warm);
        margin-bottom: 8px;
        background: var(--tp-cream);
    }

    .tp-substance-table tbody td {
        display: block;
        padding: 4px 0;
        border-bottom: none;
    }

    .tp-substance-table tbody td:first-child {
        font-weight: 600;
        color: var(--tp-green-dark);
        margin-bottom: 4px;
    }
}
