/*
 * Shared XBRL report layout rules.
 *
 * This file is the canonical source for structural report styling shared by
 * Luca Viewer, HTML/PDF exports, and the stylesheet embedded in iXBRL files.
 * Theme stylesheets may define colours and typography, but must not be relied
 * on for the accounting-value layout below.
 */

.luca-underline,
.luca-underline-two {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    min-height: calc(1.2em + 4px);
    height: auto;
    line-height: 1.2;
    padding-top: 2px;
    padding-bottom: 2px;
}

.luca-currency {
    display: grid !important;
    grid-template-columns: 1.5em minmax(0, 1fr);
    column-gap: 0;
    align-items: center;
}

.luca-currency {
    box-sizing: border-box;
    width: 100%;
    min-height: 1.2em;
    height: auto;
    line-height: 1.2;
    padding-top: 1px;
    padding-bottom: 1px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.luca-currency-symbol,
.luca-number {
    float: none !important;
    line-height: inherit;
}

.luca-currency-symbol {
    box-sizing: border-box;
    display: block;
    width: 1.5em;
    padding-left: 0.25em;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.luca-number {
    box-sizing: border-box;
    display: block;
    min-width: 0;
    padding-right: 2px;
    text-align: right;
}

/*
 * Pivot rebuilds the table body from moved source cells. These explicit grid
 * rules keep the concept rows and the value boundary intact in Viewer, HTML,
 * and iXBRL even when framework table styles are not present.
 */
.finance-table.xbrl-pivot-table > tbody > tr > td.xbrl-pivot-row-cell {
    border-bottom: 1px solid #000 !important;
}

.finance-table.xbrl-pivot-table > tbody > tr > td.xbrl-pivot-value-cell {
    border-bottom: 1px solid #dee2e6 !important;
    width: 9rem;
    min-width: 9rem;
}

.finance-table.xbrl-pivot-table > tbody > tr > td.xbrl-pivot-value-cell--first {
    border-left: 2px solid #000 !important;
}

.finance-table.xbrl-pivot-table > thead > tr > th[data-pivot-field="period"] {
    width: 9rem;
    min-width: 9rem;
}

/*
 * Accounting rules span the complete value cell. Vertical padding keeps the
 * currency symbol and number safely between the rules after a Pivot rebuild.
 */
.luca-underline {
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
}

.luca-underline-two {
    border-top: 1px solid currentColor;
    border-bottom: 3px double currentColor;
}

/*
 * Rendered report cells carry the accounting rule on the table cell itself.
 * Pivot moves the original cell, so the full-width rule survives every layout.
 */
.finance-table > tbody > tr > td.luca-accounting-rule-cell > .luca-currency {
    border-top: 0;
    border-bottom: 0;
    padding-top: 1px;
    padding-bottom: 3px;
}

.finance-table > tbody > tr > td.luca-accounting-rule-cell {
    position: relative;
}

.finance-table > tbody > tr > td.luca-accounting-rule-cell::before,
.finance-table > tbody > tr > td.luca-accounting-rule-cell::after {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
    content: "";
}

.finance-table > tbody > tr > td.luca-accounting-rule-cell::before {
    top: 0;
    border-top: 1px solid currentColor;
}

.finance-table > tbody > tr > td.luca-accounting-subtotal-cell::after {
    bottom: 0;
    border-bottom: 1px solid currentColor;
}

.finance-table > tbody > tr > td.luca-accounting-total-cell::after {
    bottom: 0;
    border-bottom: 3px double currentColor;
}
