/* Shared scrollbar appearance, following Analytics: thin, neutral bars for
   both page owners and content areas. Home and Download Store deliberately
   do not load this sheet. Overflow, heights and scroll ownership stay local.
   The early important layer prevents old component palettes winning by order. */
@layer otdx-scrollbars {
    :root {
        --otdx-scrollbar-thumb: #808080;
        /* Download Store's light gray, subtly darker for table contrast. */
        --otdx-table-scrollbar-thumb: #dcdee2;
        --otdx-scrollbar-track: transparent;
    }

    @media (forced-colors: none) {
        /* Native tables, legacy DataTables and the div-based table views.
           Scope the palette to table regions so page/menu bars keep theirs.
           data-table-scroll is the opt-in for new custom table renderers. */
        :is([data-table-scroll], .table-scroll, .table-responsive,
            .dataTables_scrollBody, .ck-table-scroll, .bis-ck-scroll,
            .bis-imp-tblscroll, .bis-imp-rec-rows, #bis-imp-chooser-rows,
            .bis-tr-picker-rows, .ec-ledger-scroll, .dxa-appr__table,
            .fe-table-scroll, .dtk-tbody, .card-content:has(table),
            :has(> table), :has(> [role="table"])) {
            --otdx-scrollbar-thumb: var(--otdx-table-scrollbar-thumb);
        }

        * {
            /* Keep this normal priority so intentional scrollbar-width:none
               declarations in components continue to hide their bars. */
            scrollbar-width: thin;
            scrollbar-color: var(--otdx-scrollbar-thumb) var(--otdx-scrollbar-track) !important;
        }

        /* These components previously hid only the WebKit pseudo-element.
           Use the standard property too, since scrollbar-color supersedes it. */
        :is(.left-sidebar, .left-sidebar *, .wa-modal-list, .ndx-tabs) {
            scrollbar-width: none !important;
        }
        @media (min-width: 901px) and (max-width: 1100px) {
            .reprocessamento-cockpit .filter-tabs { scrollbar-width: none !important; }
        }

        /* Legacy PerfectScrollbar paints DOM thumbs instead of native bars.
           Preserve its visibility/drag behavior while sharing the palette. */
        :is(.ps__scrollbar-y, .ps__thumb-y) {
            background-color: var(--otdx-scrollbar-thumb) !important;
        }
        :is(.ps__scrollbar-y-rail, .ps__rail-y) {
            background-color: transparent !important;
        }
    }
}
