/* =================================================================
   tools/ascii-table.css
   Auto-extracted from math.css (2026-05-11).
   Loaded via config/js-manifest.php → templates/partials/head-styles.php.
   ================================================================= */

/* ─── ASCII Table ──────────────────────────────────────── */
.math-ascii-table-wrap {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--math-border);
    border-radius: var(--math-radius-md);
    margin: 12px 0;
}

.math-ascii-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.math-ascii-table th {
    background: var(--math-surface-alt);
    color: var(--math-text-soft);
    padding: 8px 12px;
    font-weight: 600;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid var(--math-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.math-ascii-table th,
.math-ascii-table td {
    vertical-align: middle;
}

.math-ascii-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--math-border-light);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.math-ascii-col-dec,
.math-ascii-col-hex,
.math-ascii-col-oct,
.math-ascii-col-bin,
.math-ascii-col-char {
    text-align: center;
    white-space: nowrap;
}

.math-ascii-col-dec {
    width: 10%;
}

.math-ascii-col-hex {
    width: 10%;
}

.math-ascii-col-oct {
    width: 10%;
}

.math-ascii-col-bin {
    width: 18%;
}

.math-ascii-col-char {
    width: 14%;
}

.math-ascii-col-name {
    text-align: left;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    color: var(--math-text-soft);
}

.math-ascii-table tr:hover {
    background: var(--math-step-highlight);
}

.math-ascii-char {
    font-size: 16px;
    font-weight: 700;
    color: var(--math-primary);
}

/* Mobile: convert table rows to cards ─────────────────── */
@media (max-width: 640px) {
    .math-ascii-table-wrap {
        max-height: 560px;
        border: none;
        border-radius: 0;
        margin: 8px 0;
        padding: 0;
    }

    .math-ascii-table {
        display: block;
        width: 100%;
        table-layout: auto;
        font-size: 12px;
        border: none;
    }

    .math-ascii-table thead {
        display: none;
    }

    .math-ascii-table tbody {
        display: block;
        width: 100%;
    }

    .math-ascii-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
        border: 1px solid var(--math-border);
        border-radius: 10px;
        background: var(--math-surface);
        width: 100%;
        box-sizing: border-box;
    }

    .math-ascii-table tr:hover {
        background: var(--math-surface);
    }

    .math-ascii-table td {
        display: flex;
        align-items: center;
        padding: 0;
        border: none;
        line-height: 1.2;
        min-width: 0;
        box-sizing: border-box;
    }

    .math-ascii-col-char {
        order: 1;
        flex: 0 0 52px;
        justify-content: center;
        height: 48px;
        background: var(--math-primary-soft);
        border-radius: 8px;
        font-size: 18px !important;
        font-weight: 700;
        color: var(--math-primary) !important;
        font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    }

    .math-ascii-col-name {
        order: 2;
        flex: 1 1 calc(100% - 68px);
        min-width: 0;
        font-size: 13px;
        font-weight: 600;
        color: var(--math-text) !important;
        font-family: 'Manrope', sans-serif !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }

    .math-ascii-col-dec { order: 3; }
    .math-ascii-col-hex { order: 4; }
    .math-ascii-col-oct { order: 5; }
    .math-ascii-col-bin { order: 6; }

    .math-ascii-col-dec,
    .math-ascii-col-hex,
    .math-ascii-col-oct,
    .math-ascii-col-bin {
        flex: 1 1 calc(50% - 4px);
        font-size: 12px;
        font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
        color: var(--math-text);
        gap: 6px;
        padding: 4px 8px;
        background: var(--math-surface-alt);
        border-radius: 6px;
        text-align: left;
    }

    .math-ascii-col-bin {
        flex: 1 1 100%;
    }

    .math-ascii-col-dec::before,
    .math-ascii-col-hex::before,
    .math-ascii-col-oct::before,
    .math-ascii-col-bin::before {
        flex: 0 0 auto;
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--math-text-muted);
        font-family: 'Manrope', sans-serif;
    }

    .math-ascii-col-dec::before { content: 'Dec'; }
    .math-ascii-col-hex::before { content: 'Hex'; }
    .math-ascii-col-oct::before { content: 'Oct'; }
    .math-ascii-col-bin::before { content: 'Bin'; }
}

