/* ========================================
   BLOCK 2: Page-Specific CSS (pvi-leaderboard-ytd)
   (this page only; extracted from the fragment's
    inline <style> — Block 1 lives in pvi-master-frame.css)
   ======================================== */

.pv-content { font-size: 0.875rem; }

        /* ── PortraitVision Brand ── */
        main { flex: 1; }

        /* Header */

        /* Role switcher */

        /* Page content */
        .pv-content { padding: 1.5rem; }

        .pv-page-title {
            font-size: 1.2rem; font-weight: 700; color: #1b1f2e;
            border-left: 4px solid var(--green);
            padding-left: 0.65rem; margin-bottom: 1.25rem;
        }

        /* ── Filter bar ────────────────────────────────────────────────────
           Stays in multi-column flex-wrap layout down to 600 px.
           Below 600 px an accordion toggle collapses the controls into a
           compact 2-column grid to minimise vertical height. ── */
        .pv-filter-bar {
            background: #fff;
            border: 1px solid #dde1ea;
            border-radius: 6px;
            padding: 0.75rem 1rem 0.6rem;
            margin-bottom: 1.25rem;
        }

        /* Controls row — flex-wrap so filters sit in 2–3 per line naturally */
        .pv-filter-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem 0.75rem;
            align-items: flex-end;
        }

        .filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
        .filter-group label {
            font-size: 0.7rem; color: #6c757d; font-weight: 600;
            text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
        }
        .pv-filter-controls select,
        .pv-filter-controls input[type="date"],
        .pv-filter-controls input[type="text"] {
            font-size: 0.82rem; min-width: 120px;
        }

        /* Divider between filter row and sort/preset row */
        .pv-filter-divider {
            border-top: 1px solid #eef0f5;
            margin: 0.6rem 0;
        }

        /* Sort section sits on the same controls row */
        .pv-sort-label {
            font-size: 0.7rem; color: #2e9e6b; font-weight: 700;
            text-transform: uppercase; letter-spacing: .06em;
            align-self: center; padding-top: 0.1rem; white-space: nowrap;
        }

        /* Preset input */
        .pv-preset-input { min-width: 140px; max-width: 180px; }

        /* Apply / Save buttons */
        .pv-filter-actions {
            display: flex; align-items: flex-end; gap: 0.4rem; margin-left: auto;
        }

        /* ── Narrow accordion toggle (visible only <600 px) ── */
        .pv-filter-toggle {
            display: none;
            width: 100%;
            background: #f6f8fc;
            border: 1px solid #dde1ea;
            border-radius: 6px;
            padding: 0.5rem 0.85rem;
            font-size: 0.82rem; font-weight: 600; color: #1b1f2e;
            text-align: left; cursor: pointer;
            margin-bottom: 1rem;
        }
        .pv-filter-toggle .chevron { transition: transform .2s; display: inline-block; float: right; }
        .pv-filter-toggle.open .chevron { transform: rotate(180deg); }

        .pv-filter-collapsible { /* no hiding; JS controls display */ }

        @media (max-width: 600px) {
            .pv-content { padding: 0.75rem; }
            .pv-filter-toggle { display: block; }
            /* Collapse the bar's chrome when closed; restore when open */
            .pv-filter-bar { padding: 0; border: none; background: transparent; margin-bottom: 0; }
            .pv-filter-bar:has(.pv-filter-collapsible.open) {
                padding: 0.75rem 1rem 0.6rem;
                border: 1px solid #dde1ea;
                background: #fff;
                margin-bottom: 1.25rem;
            }
            .pv-filter-collapsible { display: none; }
            .pv-filter-collapsible.open { display: block; }

            /* 2-column grid inside the collapsed accordion */
            .pv-filter-collapsible .pv-filter-controls {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 0.5rem;
                align-items: start;
            }
            .pv-filter-collapsible .pv-filter-divider { grid-column: 1 / -1; }
            .pv-filter-collapsible .pv-sort-label { grid-column: 1 / -1; }
            .pv-filter-collapsible .pv-filter-actions {
                grid-column: 1 / -1;
                margin-left: 0; justify-content: flex-end;
            }
            .pv-filter-controls select,
            .pv-filter-controls input[type="date"],
            .pv-filter-controls input[type="text"] {
                min-width: unset; width: 100%;
            }
            .pv-preset-input { max-width: unset; width: 100%; }
        }

        /* ── Comparison checkbox column ── */
        .cb-col { width: 36px !important; min-width: 36px; text-align: center !important; padding: 0.3rem 0.25rem !important; }
        .pv-cb { cursor: pointer; width: 16px; height: 16px; accent-color: #2e9e6b; vertical-align: middle; }
        .pv-cb:disabled { cursor: not-allowed; opacity: 0.35; }

        /* ── Inline comparison tray (between filter bar and table) ── */
        .pv-cmp-tray {
            background: #1b1f2e; border-radius: 6px;
            padding: 0.6rem 1rem; margin-bottom: 1rem;
        }
        .pv-cmp-tray-inner {
            display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.75rem;
        }
        .cmp-tray-label {
            color: #9ba5c0; font-size: 0.72rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
        }
        .cmp-tray-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1; min-width: 0; }
        .cmp-tag {
            background: #252b3b; color: #c8d0e0; font-size: 0.76rem;
            padding: 0.2rem 0.6rem; border-radius: 4px;
            display: inline-flex; align-items: center; gap: 0.35rem;
        }
        .cmp-tag .rm-tag {
            cursor: pointer; color: #9ba5c0; border: none; background: none;
            padding: 0; font-size: 1.1rem; line-height: 1;
        }
        .cmp-tag .rm-tag:hover { color: #fff; }
        .cmp-tray-hint { color: #6e8090; font-size: 0.72rem; white-space: nowrap; font-style: italic; }
        .cmp-tray-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

        /* Pivot: checkbox in column header */
        .pv-pivot-cb-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
        .pv-pivot-cb { cursor: pointer; width: 15px; height: 15px; accent-color: #2e9e6b; margin-top: 3px; }
        .pv-pivot-cb:disabled { cursor: not-allowed; opacity: 0.35; }

        /* Leaderboard table */
        .pv-table-wrap { overflow-x: auto; }
        /* Scale the wide table so it always fits without a scrollbar
           between the pivot breakpoint (1400 px) and ~1550 px */
        @media (min-width: 1401px) and (max-width: 1550px) {
            .pv-table-wrap { zoom: 0.86; }
        }
        /* Stacked label for the pivot header row (Rank + Compare in one cell) */
        .pv-pl-hdr { display: flex; flex-direction: column; gap: 3px; font-size: 0.68rem; font-weight: 700; color: #9ba5c0; text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; }
        .pv-lb-table {
            width: 100%;
            border-collapse: collapse;
            background: #fff;
            border: 1px solid #dde1ea;
            border-radius: 6px;
            overflow: hidden;
        }
        .pv-lb-table th {
            background: #252b3b;
            color: #c8d0e0;
            font-size: 0.72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .04em;
            padding: 0.55rem 0.6rem;
            white-space: nowrap;
        }

        /* ── Sortable column headers ───────────────────────────────────────
           The affordance is scoped to th[data-sort], so the Compare column
           (class cb-col, no data-sort) keeps the default cursor and no
           hover highlight. The direction arrow is drawn off the aria-sort
           attribute pvSortTables sets in pvi-shared.js; the glyphs are the
           FontAwesome 6 Free solid codepoints for fa-sort (f0dc),
           fa-sort-up (f0de) and fa-sort-down (f0dd), escaped rather than
           embedded, and served locally from /css/all.min.css (no CDN).
           Replaces the old .sort-asc / .sort-desc rules, which nothing sets
           any more. ── */
        .pv-lb-table thead th[data-sort] {
            position: relative;
            padding-right: 1.15rem;   /* arrow room, so the label never shifts */
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
        }
        .pv-lb-table thead th[data-sort]:hover { background: #2e3550; color: #fff; }

        /* Keyboard focus. --dull-blue at full strength for the outline;
           --focus-ring-blue is the same hue at 25% alpha and is used as the
           inset glow, matching form controls in the frame. */
        .pv-lb-table thead th[data-sort]:focus-visible {
            outline: 2px solid var(--dull-blue);
            outline-offset: -2px;
            box-shadow: inset 0 0 0 4px var(--focus-ring-blue);
        }

        /* Resting state: the neutral both-ways glyph, dimmed, so every
           sortable column advertises itself without competing with the
           active one. */
        .pv-lb-table thead th[data-sort]::after {
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            content: "\f0dc";
            position: absolute;
            right: 0.3rem;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.7em;
            opacity: 0.35;
        }
        .pv-lb-table thead th[data-sort][aria-sort="ascending"]::after  { content: "\f0de"; opacity: 1; }
        .pv-lb-table thead th[data-sort][aria-sort="descending"]::after { content: "\f0dd"; opacity: 1; }

        .pv-lb-table td {
            padding: 0.45rem 0.6rem;
            border-bottom: 1px solid #eef0f5;
            white-space: nowrap;
            vertical-align: middle;
            font-size: 0.82rem;
        }
        .pv-lb-table tr:last-child td { border-bottom: none; }
        .pv-lb-table tr:hover td { background: #f8f9ff; }

        /* Rank badge */
        .rank-badge {
            display: inline-flex; align-items: center; justify-content: center;
            width: 26px; height: 26px; border-radius: 50%;
            font-weight: 700; font-size: 0.75rem; background: #e9ecef; color: #495057;
        }
        .rank-badge.rank-1 { background: #ffc107; color: #fff; }
        .rank-badge.rank-2 { background: #adb5bd; color: #fff; }
        .rank-badge.rank-3 { background: #cd7f32; color: #fff; }

        /* Scored cells */
        .scored {
            display: inline-block;
            text-align: center; font-weight: 700;
            color: #fff; border-radius: 4px;
            padding: 0.25rem 0.4rem;
            min-width: 34px;
        }
        .scored a { color: inherit; text-decoration: none; }

        /* Trend indicator */
        .trend-up   { color: #3dbb61; font-size: 1rem; }
        .trend-down { color: #e03e3e; font-size: 1rem; }
        .trend-flat { color: #adb5bd; font-size: 1rem; }

        /* Green/Orange/Red pct pills */
        .pct-green  { background: #d4f5e2; color: #1a6b3a; font-size: 0.75rem; border-radius: 3px; padding: 2px 5px; font-weight: 600; }
        .pct-orange { background: #fef3dd; color: #7a5000; font-size: 0.75rem; border-radius: 3px; padding: 2px 5px; font-weight: 600; }
        .pct-red    { background: #fde8e8; color: #7a1a1a; font-size: 0.75rem; border-radius: 3px; padding: 2px 5px; font-weight: 600; }

        /* Footer */
        .pv-footer {
            border-top: 1px solid #dde1ea;
            padding: 0.75rem 1.25rem;
            text-align: center;
            font-size: 0.78rem;
            color: #6c757d;
            background: #fff;
            margin-top: 2rem;
        }
        .pv-footer a { color: #6c757d; text-decoration: none; }
        .pv-footer a:hover { text-decoration: underline; }

        /* ── Column-pivot navigator (breakpoint: 1400px) ─────────────────────
           At ≤1400px the table transposes: metrics → rows, each record
           becomes a navigable column filling the available screen width.
           Prev/Next buttons page through records that don't fit at once.
           Column width: 100px each; label column: 90px sticky left. ── */
        @media (max-width: 1400px) {
            .pv-table-wrap { overflow: visible; }
            .pv-pivot { margin-bottom: 1.5rem; }
            .pv-pivot-nav {
                display: flex; align-items: center; gap: 0.5rem;
                margin-bottom: 0.5rem;
            }
            .pv-pivot-nav .pv-nav-pg {
                flex: 1; text-align: center; font-size: 0.78rem; color: #6c757d;
            }
            .pv-pivot-tbl {
                width: 100%; border-collapse: separate; border-spacing: 0;
                font-size: 0.82rem;
            }
            .pv-pivot-tbl thead th {
                background: #f6f8fc; border-bottom: 2px solid #dde1ea;
                padding: 0.4rem 0.3rem; white-space: normal;
                vertical-align: middle; text-align: center;
                width: 100px; min-width: 100px; max-width: 100px;
            }
            .pv-pivot-tbl tbody td {
                padding: 0.3rem 0.3rem; border-bottom: 1px solid #f0f2f8;
                vertical-align: middle; word-break: break-word;
            }
            .pv-pivot-tbl tbody tr:last-child td { border-bottom: none; }
            .pv-pl {
                position: sticky; left: 0; background: #f6f8fc;
                border-right: 2px solid #dde1ea; font-size: 0.68rem;
                font-weight: 700; color: #6c757d; text-transform: uppercase;
                letter-spacing: .03em; white-space: nowrap; z-index: 2;
                width: 90px; min-width: 90px; max-width: 90px;
                padding: 0.3rem 0.4rem;
            }
            .pv-pivot-tbl thead .pv-pl { z-index: 3; }
            /* Record columns: allow name to wrap, center content */
            .pv-pc {
                text-align: center;
                white-space: normal;
                width: 100px; min-width: 100px; max-width: 100px;
            }
        }
    
