/* ===== OBC table theme (clean) =========================================== */
:root {
    /* Grid + fills */
    --obc-grid: #e5e7eb;
    /* borders */
    --obc-head-bg: #f8fafc;
    /* header bg */
    --obc-stripe: #fafbfc;
    /* zebra even rows */

    --obc-highlight: #e2e8f0;
    /* slate-200 */
    --obc-highlight-accent: #94a3b8;
    /* slate-400 */

    /* Typography controls */
    --obc-table-font: 0.875rem;
    /* 1rem = body; try 0.875rem (≈14px) */
    --obc-sup-scale: 0.78;
    /* 0.65–0.75 printy; 0.75–0.85 screeny */
}



/* ===== Base table ======================================================== */
.obc-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
    background: #fff;
    border: 1px solid var(--obc-grid);
    font-size: var(--obc-table-font);
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    /* nicer number columns */
}

/* Head cells */
.obc-table thead th {
    background: var(--obc-head-bg);
    border-bottom: 1px solid var(--obc-grid);
    border-left: 1px solid var(--obc-grid);
    padding: .5rem .6rem;
    text-align: left;
    font-weight: 600;
}

/* Body cells */
.obc-table td {
    border-top: 1px solid var(--obc-grid);
    border-left: 1px solid var(--obc-grid);
    padding: .45rem .6rem;
    vertical-align: top;
    background: #fff;
    /* ensures zebra override works cleanly */
}

/* Rightmost / last row borders */
.obc-table th:last-child,
.obc-table td:last-child {
    border-right: 1px solid var(--obc-grid);
}

.obc-table tr:last-child td {
    border-bottom: 1px solid var(--obc-grid);
}

/* Zebra striping (even rows) */
.obc-table tbody tr:nth-child(even) td {
    background: var(--obc-stripe);
}

/* ===== Disable sticky header/first column completely ==================== */
/* (This also wins over any inline sticky in base.html) */
.obc-table thead th,
.obc-table>tbody>tr:first-child>th,
.obc-table>tbody>tr:first-child>td,
.obc-sticky-col th:first-child,
.obc-sticky-col td:first-child {
    position: static !important;
    top: auto !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
}

/* ===== Superscripts (proportional, tight, robust) ======================== */
.obc-table sup,
[data-superscript-notes] sup,
caption sup {
    font-size: calc(1em * var(--obc-sup-scale)) !important;
    /* relative to table text */
    line-height: 0 !important;
    vertical-align: super !important;
    position: relative;
    top: -0.06em;
    /* tweak -0.04em … -0.10em to taste for your font */
    margin-left: 0 !important;
    /* no visual gap before '(' */
    white-space: nowrap;
}

/* If nested <sup><sup>…</sup></sup> slipped in, cancel compounding */
.obc-table sup sup {
    font-size: 1em !important;
    top: 0 !important;
    vertical-align: baseline !important;
}

/* ===== Click highlight =================================================== */
/* Row/col fill */
.obc-table tr.is-row td,
.obc-table td.is-col,
.obc-table th.is-col {
    background: var(--obc-highlight) !important;
}

/* Focused cell accent ring */
.obc-table td.is-hit,
.obc-table th.is-hit {
    box-shadow: inset 0 0 0 2px var(--obc-highlight-accent);
    position: relative;
    z-index: 1;
    transition: box-shadow .15s ease;
}

/* ===== Small screens ===================================================== */
@media (max-width: 640px) {
    .obc-table {
        font-size: .92rem;
    }

    .obc-table th,
    .obc-table td {
        padding: .4rem .5rem;
    }
}


/* Clicked cell: subtle, elegant ring */
.obc-table td.is-hit,
.obc-table th.is-hit {
    /* keep the row/col background you already use */
    background: var(--obc-highlight) !important;

    /* crisp inset ring in your accent */
    box-shadow:
        inset 0 0 0 1px var(--obc-highlight-accent);

    position: relative;
    z-index: 1;
    /* sit above neighbors */
    transition: box-shadow .15s ease, background-color .15s ease;
}