/* Tailwind-inspired TablePress styling */
.tablepress {
    --tbl-radius: 0.75rem;
    --tbl-shadow: 0 35px 60px -25px rgba(15, 23, 42, 0.35);
    --tbl-surface: rgb(248 250 252);
    --tbl-surface-alt: rgb(241 245 249);
    --tbl-text: rgb(15 23 42);
    --tbl-muted: rgb(71 85 105);
    --tbl-border: rgba(148, 163, 184, 0.4);
    --tbl-accent: rgb(37 99 235);
    --tbl-accent-soft: rgba(37, 99, 235, 0.12);
    --tbl-head-gradient: linear-gradient(135deg, rgba(37, 99, 235, 0.94), rgba(79, 70, 229, 0.94));
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--tbl-text);
    background-color: var(--tbl-surface);
    border-radius: var(--tbl-radius);
    box-shadow: var(--tbl-shadow);
    overflow: hidden;
}

.tablepress caption {
    padding: 0.75rem 1rem 0;
    font-size: 0.8125rem;
    color: var(--tbl-muted);
    text-align: left;
}

.tablepress caption a {
    color: var(--tbl-accent);
    font-weight: 600;
    text-decoration: none;
}

.tablepress caption a:hover,
.tablepress caption a:focus-visible {
    text-decoration: underline;
}

.tablepress thead tr {
    background-image: var(--tbl-head-gradient);
}

.tablepress thead th {
    padding: 1.25rem 1.5rem;
    font-size: clamp(1.125rem, 2vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgb(248 250 252);
    text-align: left;
    border: none;
}

.tablepress tbody td {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--tbl-border);
    background-color: var(--tbl-surface);
    color: var(--tbl-text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tablepress tbody tr:nth-child(even) td {
    background-color: var(--tbl-surface-alt);
}

.tablepress tbody tr:hover td {
    background-color: var(--tbl-accent-soft);
}

.tablepress tbody td:first-child {
    font-weight: 600;
    color: var(--tbl-text);
}

.tablepress tbody td:nth-child(2),
.tablepress tbody td:nth-child(4) {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.tablepress tbody td[colspan] {
    font-weight: 500;
    color: var(--tbl-muted);
}

.tablepress tbody a {
    color: var(--tbl-accent);
    font-weight: 600;
    text-decoration: none;
}

.tablepress tbody a:hover,
.tablepress tbody a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .tablepress {
        font-size: 0.875rem;
        line-height: 1.45;
        table-layout: fixed;
        max-width: 100%;
    }

    .tablepress thead th {
        font-size: clamp(1rem, 4vw, 1.125rem);
        padding: 0.9rem 1rem;
        line-height: 1.35;
        word-break: break-word;
        overflow-wrap: anywhere;
        min-width: 0;
    }

    .tablepress tbody td {
        padding: 0.75rem 1rem;
        line-height: 1.45;
        word-break: break-word;
        overflow-wrap: anywhere;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .tablepress {
        font-size: 0.8125rem;
        border-radius: 0.5rem;
    }

    .tablepress caption {
        padding-inline: 0.75rem;
        font-size: 0.75rem;
    }

    .tablepress thead th,
    .tablepress tbody td {
        padding-inline: 0.75rem;
        display: block;
        width: 100%;
        text-align: left;
    }

    .tablepress tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.35rem;
        padding-block: 0.75rem;
        padding-inline: 0.75rem;
    }

    .tablepress tbody td + td {
        border-top: 1px solid rgba(148, 163, 184, 0.25);
        padding-top: 0.5rem;
        margin-top: 0.35rem;
    }

    .tablepress tbody td[colspan] {
        border-top: none;
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }

    .tablepress tbody td {
        border-top: none;
        padding-block: 0.35rem;
    }

    .tablepress tbody td::before {
        content: attr(data-column-title);
        display: block;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--tbl-muted);
        margin-bottom: 0.15rem;
    }

    .tablepress tbody td[colspan]::before {
        content: '';
        display: none;
    }

    .tablepress tbody td:not([data-column-title])::before {
        content: '';
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    .tablepress {
        --tbl-shadow: 0 20px 45px -20px rgba(15, 23, 42, 0.7);
        --tbl-surface: rgba(15, 23, 42, 0.85);
        --tbl-surface-alt: rgba(30, 41, 59, 0.85);
        --tbl-text: rgb(226 232 240);
        --tbl-muted: rgb(148 163 184);
        --tbl-border: rgba(71, 85, 105, 0.55);
        --tbl-accent: rgb(96 165 250);
        --tbl-accent-soft: rgba(59, 130, 246, 0.2);
        --tbl-head-gradient: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(129, 140, 248, 0.8));
    }

    .tablepress thead th {
        color: rgb(224 231 255);
    }

    .tablepress tbody td[colspan] {
        color: rgb(165 180 195);
    }
}
