body {
    background-color: white !important;
    color: #2c2c2c;
    font-family: "Open Sans", sans-serif;
}

.navbar-header {
    background-color: #000 !important;
    /* black header bar */
    color: white;
    padding: 10px 20px;
}

.navbar {
    background-color: #274185 !important;
    /* deep blue bar */
    border-bottom: 2px solid #F28F0B;
}

/* App header: one horizontal row (grid); keep bar from stacking like a collapsed navbar */
.navbar.portal-header-navbar {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    border-bottom: none !important;
}

.portal-header-inner.container-fluid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
}

.portal-header-main-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    align-items: center;
    column-gap: 0.5rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.navbar a,
.navbar-brand,
.dropdown-item {
    color: white !important;
    font-weight: bold;
}

.card {
    background-color: white !important;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.card-body {
    color: #2c2c2c;
}

.table th,
.table td {
    color: #2c2c2c !important;
}

/* Buttons */
.btn-primary {
    background-color: #274185;
    border-color: #274185;
}

.btn-secondary {
    background-color: #F28F0B;
    border-color: #F28F0B;
    color: black;
}

/* Notes and Percentile styling override if needed */
.badge-percentile {
    font-weight: bold;
    border-radius: 6px;
    padding: 2px 8px;
    color: black;
}

/* Master leaderboard: micro source tooltip anchored to cell bottom-right */
.master-lb-table {
    overflow: visible;
}

.master-lb-table td {
    overflow: visible;
    position: relative;
}

.master-lb-cell-inner--tipped {
    position: relative;
    display: block;
    min-height: 1.15em;
    padding: 0 10px 1px 0;
}

.master-lb-cell-inner--tipped.master-lb-cell-inner--has-src-icon {
    /* Reserve only a sliver of width — icon is absolutely positioned */
    padding-right: 11px;
}

.master-lb-cell-inner--tipped .master-lb-cell-val {
    display: inline;
}

/* Generic marker when no league/team logo is mapped */
.master-lb-cell-inner--tipped:not(.master-lb-cell-inner--has-src-icon)::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.master-lb-source-icon {
    position: absolute;
    right: 0;
    bottom: 1px;
    /* Micro-markers: ~1ex tall, capped so wide SVGs don’t eat layout */
    width: auto;
    max-height: 20px;
    max-width: 11px;
    min-width: 0;
    object-fit: contain;
    object-position: right bottom;
    pointer-events: none;
    filter: drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.55));
}

.master-lb-tip-text {
    display: none;
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 3px;
    padding: 3px 7px;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 500;
    color: #f8f8f8;
    background: rgba(20, 20, 22, 0.94);
    border-radius: 4px;
    text-align: left;
    max-width: min(240px, 42vw);
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    z-index: 100;
    pointer-events: none;
}

.master-lb-cell-inner--tipped:hover .master-lb-tip-text {
    display: block;
}

.master-lb-cell-inner--tipped:not(.master-lb-cell-inner--has-src-icon):hover::after {
    background: rgba(0, 0, 0, 0.45);
}

.master-lb-cell-inner--has-src-icon:hover .master-lb-source-icon {
    opacity: 0.88;
}

/* Player name → player page: looks like plain text (no underline / link colors) */
a.master-lb-player-link,
a.master-lb-player-link:visited,
a.master-lb-player-link:hover,
a.master-lb-player-link:active {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* Player profile — performance table: compact source logo column (left of value) */
.perf-measurement-source-col {
    min-width: 0;
    border-bottom: 0px !important;
}

.perf-measurement-source-logo {
    display: block;
    margin: 0 auto;
    height: 20px;
    max-height: 20px;
    width: auto;
    min-width: 0;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
}

/* Performance testing table — body cells (no fixed layout: avoids squeezing Value logos) */
table.perf-testing-compare-table {
    width: 100%;
}

table.perf-testing-compare-table tbody td {
    vertical-align: middle;
    padding-top: 6px;
    padding-bottom: 6px;
}

table.perf-testing-compare-table tbody td.perf-testing-test-td {
    min-width: 0;
}

/* Test column: spacer + label grid (matches toggle column width) */
.perf-metric-test-head {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.perf-metric-caret-slot-spacer {
    display: block;
    width: 18px;
    height: 1em;
    flex-shrink: 0;
    pointer-events: none;
}

.perf-metric-test-plain-label {
    min-width: 0;
}

/* Caret checkbox sits over icon; next row shows alternates (dbc.Checkbox = .form-check) */
.perf-metric-exp-toggle.form-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 18px;
    height: 1.1em;
    margin: 0;
    padding-left: 0;
    min-height: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.perf-metric-exp-toggle-label {
    padding: 0;
    margin: 0;
    line-height: 1;
    cursor: pointer;
}

.perf-metric-exp-input.form-check-input,
.perf-metric-exp-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    margin-left: 0;
    margin-top: 0;
    float: none;
    opacity: 0;
    cursor: pointer;
}

.perf-metric-exp-caret-icon {
    display: inline-block;
    color: #274185;
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
    /* Nudge into the narrow grid column so the glyph does not crowd the label */
    transform: translateX(-5px);
    transition: transform 0.12s ease;
}

tr.perf-metric-main-row.perf-metric-with-alt:has(input.perf-metric-exp-input:checked) .perf-metric-exp-caret-icon {
    transform: translateX(-5px) rotate(90deg);
}

tr.perf-metric-alt-row {
    display: none;
}

tr.perf-metric-main-row.perf-metric-with-alt:has(input.perf-metric-exp-input:checked) + tr.perf-metric-alt-row {
    display: table-row;
}

.perf-metric-alt-td {
    vertical-align: top;
    padding-top: 2px;
    padding-bottom: 8px;
    border-top: none;
}

.perf-metric-alt-row-list {
    margin: 0;
    padding: 0 0 0 1.35em;
    /* Full-span alt row: align list copy with .perf-metric-test-head label (18px + 6px gap) */
    margin-left: calc(18px + 6px - 1.35em);
    font-size: 12px;
    color: #555;
    line-height: 1.35;
}