/* ==========================================================================
   player.php — the modern skin (Oct 2026, mock for approval)
   --------------------------------------------------------------------------
   Printed by player.php just before <div class="benfica-layout pm-page">, inside
   #main-content and outside #player-tab-panel, so soft navigation carries it and
   the AJAX tab swaps never remove it. Every selector is scoped to
   .benfica-layout.pm-page: nothing here reaches another page.

   Hands off, on purpose (approved 27 Sep):
     - the player hero (hero.php .hero-pv2) — it is outside .benfica-layout;
     - the pill tab bar #playerSelectionTabs and its sticky behaviour;
     - the Position Map pitch drawing (.player-position-field and its children).
   Nothing below selects inside those three.

   Same vocabulary as match-modern.css (the match page, same week): borderless
   cards on a soft shadow, tinted icon chips, rows that breathe, count-up figures
   via bn-motion.js. Colours are theme tokens only; dark mode re-points the tokens.
   ========================================================================== */

.benfica-layout.pm-page {
    --pm-card-bg: var(--theme-surface);
    --pm-row-bg: var(--theme-surface-2);
    --pm-row-hover: color-mix(in oklab, var(--theme-primary) 5%, var(--theme-surface-2));
    --pm-line: color-mix(in oklab, var(--theme-border) 70%, transparent);
    --pm-soft-shadow: var(--elev-2);
    --pm-lift-shadow: var(--elev-3);
    --pm-radius: var(--theme-radius, 1rem);
}
/* Dark: the same neutral surface the sidebar panels use (.bn-panel → --bs-tertiary-bg),
   so the main column and the aside read as one set of cards. */
[data-bs-theme="dark"] .benfica-layout.pm-page {
    --pm-card-bg: var(--bs-tertiary-bg, var(--theme-surface-2));
    --pm-row-bg: color-mix(in oklab, var(--theme-ink) 7%, var(--pm-card-bg));
    --pm-row-hover: color-mix(in oklab, var(--theme-ink) 11%, var(--pm-card-bg));
    --pm-line: color-mix(in oklab, var(--theme-ink) 10%, transparent);
}

/* ---- Cards: borderless on a soft shadow -------------------------------------
   Every bnSection card in the main column (intro, statistics, lists, charts,
   tables, history). The sidebar keeps its own panel skin, restyled further down. */
.benfica-layout.pm-page .bn-main .bn-section > .card,
.benfica-layout.pm-page .bn-main .bn-section > .collapse > .card,
.benfica-layout.pm-page .bn-main .bn-section > .collapsing > .card {
    border: 0 !important;
    background: var(--pm-card-bg);
    box-shadow: var(--pm-soft-shadow);
}
[data-bs-theme="dark"] .benfica-layout.pm-page .bn-main .bn-section > .card,
[data-bs-theme="dark"] .benfica-layout.pm-page .bn-main .bn-section > .collapse > .card { background: var(--pm-card-bg); }

/* Tables in those cards: a quiet tinted head, rows that breathe, a soft hover. */
.benfica-layout.pm-page .bn-main .plg-skin > thead > tr > th {
    background: var(--pm-row-bg);
    border-bottom: 1px solid var(--pm-line) !important;
    padding-top: .55rem; padding-bottom: .55rem;
    font-size: .68rem;
}
.benfica-layout.pm-page .bn-main .plg-skin > tbody > tr > td { border-bottom-color: var(--pm-line); }
.benfica-layout.pm-page .bn-main .plg-skin > tbody > tr:hover > * { background-color: var(--pm-row-hover); }
.benfica-layout.pm-page .bn-main .plg-skin > tfoot > tr > * {
    background: var(--pm-row-bg);
    border-top: 0 !important;
    font-weight: 800;
}
.benfica-layout.pm-page .bn-main .stats-table thead tr { border-bottom: 1px solid var(--pm-line); }
.benfica-layout.pm-page .bn-main .stats-table .stats-th {
    background: var(--pm-row-bg);
    border-bottom: 1px solid var(--pm-line) !important;
    padding-top: .6rem !important; padding-bottom: .55rem !important;
}
.benfica-layout.pm-page .bn-main .stats-table .stats-th.stats-th-active { background: rgba(var(--theme-primary-rgb), .09) !important; }
.benfica-layout.pm-page .bn-main .stats-table tbody tr.stats-row { border-bottom-color: var(--pm-line); }
.benfica-layout.pm-page .bn-main .stats-table tbody tr.stats-row:hover { background: var(--pm-row-hover) !important; }
.benfica-layout.pm-page .bn-main .stats-summary-row td {
    background: var(--pm-row-bg) !important;
    border-top: 0;
    font-weight: 800;
}
.benfica-layout.pm-page .bn-main .stats-sortby-bar { background: transparent; border-top: 1px solid var(--pm-line); padding: .65rem .6rem; }
.benfica-layout.pm-page .bn-main .stats-sortbtn { border-color: transparent; background: var(--pm-row-bg); }
.benfica-layout.pm-page .bn-main .stats-sortbtn:hover { background: var(--pm-row-hover); border-color: transparent; }

/* Result squares in the lists: the site's squared chip (radius .25rem). */
.benfica-layout.pm-page .bn-main .plg-skin .badge { border-radius: .25rem; }

/* Notices inside the tabs (no records, no history): a soft card with an icon chip. */
.benfica-layout.pm-page .bn-main .alert.alert-info {
    display: flex; align-items: center; gap: .7rem;
    border: 0; border-radius: var(--pm-radius);
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
    color: var(--theme-ink-muted); font-size: .88rem; font-weight: 600;
}
.benfica-layout.pm-page .bn-main .alert.alert-info > i:first-child {
    flex: 0 0 auto; width: 2.2rem; height: 2.2rem; margin: 0 !important; border-radius: .75rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--theme-accent-rgb), .16); color: var(--theme-accent-700, var(--theme-accent));
}
[data-bs-theme="dark"] .benfica-layout.pm-page .bn-main .alert.alert-info > i:first-child { color: var(--theme-accent); }

/* ---- Intro card (#player-profile) -------------------------------------------
   The biography with room to breathe; the facts beside it as one tinted panel
   whose labels carry small icon chips. The pitch inside it is untouched. */
.benfica-layout.pm-page #player-profile > .card > .card-body { padding: 1.1rem 1.2rem !important; }
.benfica-layout.pm-page #player-profile .col > div[style*="word-break"] {
    font-size: .97rem; line-height: 1.78;
    color: var(--theme-ink);
}
/* Phones: the intro card a little tighter. The facts panel (Position Map) keeps its
   original look (restored at Bruno's request, 1 Oct 2026). */
@media (max-width: 767.98px) {
    .benfica-layout.pm-page #player-profile > .card > .card-body { padding: .9rem .95rem !important; }
    .benfica-layout.pm-page #player-profile .col > div[style*="word-break"] { font-size: .93rem; line-height: 1.72; }
}

/* ---- Statistics tab: the season card as separate blocks ---------------------
   The one big card held four things (fan rating, the season table, by
   competition, market value). Here the card is a transparent shell and each
   block is its own soft card with a gap between them. */
.benfica-layout.pm-page #player-statistics > .card {
    background: transparent !important; box-shadow: none !important; overflow: visible;
}
.benfica-layout.pm-page #player-statistics > .card > .card-body { background: transparent; }
.benfica-layout.pm-page #player-statistics > .card > .card-body > :is(.bn-rtg-summary, .bn-rtg-stripwrap, .stats-table-wrap, #player-by-competition, #player-market-value-chart) {
    background: var(--pm-card-bg);
    box-shadow: var(--pm-soft-shadow);
    border-radius: var(--pm-radius);
    margin-top: 1rem !important;
}
.benfica-layout.pm-page #player-statistics > .card > .card-body > :first-child { margin-top: 0 !important; }
/* The rating head and its strip read as one card. */
.benfica-layout.pm-page #player-statistics > .card > .card-body > .bn-rtg-summary:has(+ .bn-rtg-stripwrap) {
    border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: .85rem 1rem .35rem;
    box-shadow: 0 -1px 0 transparent, var(--pm-soft-shadow);
    clip-path: inset(-30px -30px 0 -30px);
}
.benfica-layout.pm-page #player-statistics > .card > .card-body > .bn-rtg-summary + .bn-rtg-stripwrap {
    margin-top: 0 !important; border-top-left-radius: 0; border-top-right-radius: 0; padding-bottom: .4rem;
    clip-path: inset(0 -30px -30px -30px);
}
.benfica-layout.pm-page #player-statistics .bn-rtg-summary:not(:has(+ .bn-rtg-stripwrap)) { padding: .85rem 1rem; margin-bottom: 0; }
.benfica-layout.pm-page #player-statistics .bn-rtg-summary-label { font-weight: 800; }
.benfica-layout.pm-page #player-statistics > .card > .card-body > :is(.stats-table-wrap, #player-by-competition) { overflow: hidden; }
.benfica-layout.pm-page #player-statistics > .card > .card-body > :is(.stats-table-wrap, #player-by-competition) { overflow-x: auto; }
.benfica-layout.pm-page #player-market-value-chart { padding: .9rem 1rem .8rem !important; }
.benfica-layout.pm-page #player-market-value-chart > .d-flex:first-child { margin-bottom: .6rem !important; }

/* ---- "Latest …" lists -------------------------------------------------------- */
.benfica-layout.pm-page .bn-main .pla-list > tbody > tr > td { padding-top: .5rem; padding-bottom: .5rem; }

/* ---- Analytics: headline tiles ------------------------------------------------
   renderPlayerKpiCard()'s cards become the .mm-tile idiom: a radial tint in the
   card's tone, a tinted icon chip, a big figure. --c is an "r,g,b" triplet. */
.benfica-layout.pm-page .pkpi-row { margin-bottom: .5rem !important; }
.benfica-layout.pm-page .pkpi {
    --c: var(--theme-primary-rgb);
    position: relative; overflow: hidden;
    border: 0 !important; border-radius: var(--pm-radius);
    background: radial-gradient(120% 120% at 0% 0%, rgba(var(--c), .10), transparent 60%), var(--pm-card-bg);
    box-shadow: var(--pm-soft-shadow);
    transition: transform var(--dur-base, .24s) ease, box-shadow var(--dur-base, .24s) ease;
}
[data-bs-theme="dark"] .benfica-layout.pm-page .pkpi { background: radial-gradient(120% 120% at 0% 0%, rgba(var(--c), .18), transparent 60%), var(--pm-card-bg); }
@media (hover: hover) { .benfica-layout.pm-page .pkpi:hover { transform: translateY(-3px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page .pkpi.border-success { --c: var(--theme-success-rgb); }
.benfica-layout.pm-page .pkpi.border-info { --c: var(--theme-info-rgb); }
.benfica-layout.pm-page .pkpi.border-primary { --c: var(--theme-accent-rgb); }
.benfica-layout.pm-page .pkpi > .card-body { padding: .85rem .95rem !important; }
.benfica-layout.pm-page .pkpi .pkpi-head { gap: .75rem; }
.benfica-layout.pm-page .pkpi .pkpi-icon {
    width: 2.6rem; height: 2.6rem; border-radius: .8rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; background: rgba(var(--c), .14);
}
.benfica-layout.pm-page .pkpi .pkpi-icon:is(.text-danger, .text-success, .text-info, .text-primary) { color: rgb(var(--c)) !important; }
.benfica-layout.pm-page .pkpi .pkpi-icon[class*="-mask"] { background-color: rgb(var(--c)); width: 1.25em; height: 1em; border-radius: 0; }
.benfica-layout.pm-page .pkpi .pkpi-value { font-size: 1.6rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: var(--theme-ink); }
.benfica-layout.pm-page .pkpi .pkpi-label { font-size: .66rem; font-weight: 800; letter-spacing: .06em; color: var(--theme-ink-muted); margin-top: .3rem; }
.benfica-layout.pm-page .pkpi .pkpi-sub {
    margin-top: .6rem; padding: .3rem .55rem; border-top: 0; border-radius: .55rem;
    background: var(--pm-row-bg); font-size: .72rem; font-weight: 600; color: var(--theme-ink-muted);
}
/* The assist / clean-sheet glyphs are mask icons (they paint with background-color), so
   their chip is a tinted square drawn by a pseudo element behind them instead. */
.benfica-layout.pm-page .pkpi .pkpi-head:has(> [class*="-mask"]) { position: relative; }
.benfica-layout.pm-page .pkpi .pkpi-head:has(> [class*="-mask"])::before {
    content: ""; position: absolute; left: 0; top: 50%; width: 2.6rem; height: 2.6rem; margin-top: -1.3rem;
    border-radius: .8rem; background: rgba(var(--c), .14);
}
.benfica-layout.pm-page .pkpi .pkpi-head > [class*="-mask"] { margin: 0 .7rem; position: relative; }
@media (max-width: 575.98px) {
    .benfica-layout.pm-page .pkpi > .card-body { padding: .7rem .7rem !important; }
    .benfica-layout.pm-page .pkpi .pkpi-head { gap: .55rem; }
    .benfica-layout.pm-page .pkpi .pkpi-icon { width: 2.1rem; height: 2.1rem; border-radius: .65rem; font-size: .9rem; }
    .benfica-layout.pm-page .pkpi .pkpi-head:has(> [class*="-mask"])::before { width: 2.1rem; height: 2.1rem; margin-top: -1.05rem; border-radius: .65rem; }
    .benfica-layout.pm-page .pkpi .pkpi-head > [class*="-mask"] { margin: 0 .5rem; }
    .benfica-layout.pm-page .pkpi .pkpi-value { font-size: 1.3rem; }
    .benfica-layout.pm-page .pkpi .pkpi-label { font-size: .6rem; }
}

/* 992-1199px: the aside takes 340px, so the main column is narrow; smaller chips and
   figures keep a large all-seasons total ("21,345") inside its tile. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .benfica-layout.pm-page .pkpi .pkpi-icon { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
    .benfica-layout.pm-page .pkpi .pkpi-head:has(> [class*="-mask"])::before { width: 2.2rem; height: 2.2rem; margin-top: -1.1rem; }
    .benfica-layout.pm-page .pkpi .pkpi-value { font-size: 1.3rem; }
    .benfica-layout.pm-page .pm-stat-num { font-size: 1.05rem; }
}

/* ---- Analytics: Player Facts (the match-facts cards) -------------------------- */
.benfica-layout.pm-page #player-facts .mf-wrap,
.benfica-layout.pm-page #player-facts .mf-grid { gap: .6rem; }
.benfica-layout.pm-page #player-facts .mf-card {
    border: 0; border-radius: .9rem; padding: .6rem .8rem .6rem .9rem;
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
}
.benfica-layout.pm-page #player-facts .mf-card.mf-lead {
    background: linear-gradient(100deg, color-mix(in oklab, var(--mf-tone, var(--theme-ink-faint)) 13%, var(--pm-card-bg)) 0%, var(--pm-card-bg) 70%);
}
@media (hover: hover) { .benfica-layout.pm-page #player-facts .mf-card:hover { transform: translateY(-2px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page #player-facts .mf-chip { width: 2rem; height: 2rem; border-radius: .65rem; font-size: .85rem; }
.benfica-layout.pm-page #player-facts .mf-body { font-size: .85rem; }
.benfica-layout.pm-page #player-facts .mf-lead .mf-body { font-size: .95rem; }

/* ---- Analytics: Detailed Metrics tiles ---------------------------------------- */
.benfica-layout.pm-page .pl-detail-fact {
    border: 0; border-radius: .9rem;
    padding: .7rem .8rem;
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
    transition: transform var(--dur-base, .24s) ease, box-shadow var(--dur-base, .24s) ease;
}
@media (hover: hover) { .benfica-layout.pm-page .pl-detail-fact:hover { transform: translateY(-2px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page .pl-detail-fact-label {
    display: flex; align-items: center; gap: .45rem;
    font-size: .64rem; font-weight: 800; letter-spacing: .06em; color: var(--theme-ink-muted);
}
.benfica-layout.pm-page .pl-detail-fact-label > i:not([class*="-mask"]):not([class*="-card"]) {
    flex: 0 0 auto; width: 1.55rem; height: 1.55rem; margin: 0 !important; border-radius: .5rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: .68rem;
    background: rgba(var(--theme-primary-rgb), .09); color: var(--theme-primary);
}
.benfica-layout.pm-page .pl-detail-fact-label > i:is([class*="-mask"], [class*="-card"]) { margin: 0 .3rem 0 .25rem !important; }
.benfica-layout.pm-page .pl-detail-fact-value { font-size: 1.3rem; font-weight: 900; margin-top: .4rem; font-variant-numeric: tabular-nums; color: var(--theme-ink); }
.benfica-layout.pm-page .pl-detail-fact-hint { font-size: .72rem; color: var(--theme-ink-muted); }
[data-bs-theme="dark"] .benfica-layout.pm-page .pl-detail-fact-label > i:not([class*="-mask"]):not([class*="-card"]) { color: color-mix(in oklab, var(--theme-primary) 55%, var(--theme-ink)); background: rgba(var(--theme-primary-rgb), .2); }

/* ---- Analytics: chart cards, milestones --------------------------------------- */
.benfica-layout.pm-page #player-analytics-tab-content .bn-section > .card > .card-body.p-2 { padding: .85rem .9rem !important; }
.benfica-layout.pm-page #player-analytics-tab-content #trendMetric {
    width: auto; border-radius: 999px; border-color: transparent;
    background-color: var(--pm-row-bg); font-weight: 700; font-size: .78rem; padding-left: .85rem;
}
.benfica-layout.pm-page #analytics-milestones .badge { border-radius: 999px; padding: .32em .65em; font-weight: 800; }
.benfica-layout.pm-page #analytics-milestones .progress { height: .5rem !important; border-radius: 99px; background: var(--pm-row-bg); }
.benfica-layout.pm-page #analytics-milestones .progress-bar { border-radius: 99px; }

/* ---- Breakdown: summary tiles ------------------------------------------------- */
.benfica-layout.pm-page .pm-stat {
    --c: var(--theme-draw-rgb);
    display: flex; align-items: center; gap: .7rem; text-align: left !important;
    border: 0 !important; border-radius: var(--pm-radius) !important;
    padding: .75rem .8rem !important;
    background: radial-gradient(120% 120% at 0% 0%, rgba(var(--c), .10), transparent 60%), var(--pm-card-bg) !important;
    box-shadow: var(--pm-soft-shadow);
    transition: transform var(--dur-base, .24s) ease, box-shadow var(--dur-base, .24s) ease;
}
[data-bs-theme="dark"] .benfica-layout.pm-page .pm-stat { background: radial-gradient(120% 120% at 0% 0%, rgba(var(--c), .18), transparent 60%), var(--pm-card-bg) !important; }
@media (hover: hover) { .benfica-layout.pm-page .pm-stat:hover { transform: translateY(-3px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page .pm-stat--win { --c: var(--theme-success-rgb); }
.benfica-layout.pm-page .pm-stat--goals { --c: var(--theme-accent-rgb); }
.benfica-layout.pm-page .pm-stat--cs { --c: var(--theme-info-rgb); }
.benfica-layout.pm-page .pm-stat--mins,
.benfica-layout.pm-page .pm-stat--avg { --c: var(--theme-primary-rgb); }
.benfica-layout.pm-page .pm-stat-ico {
    flex: 0 0 auto; width: 2.3rem; height: 2.3rem; border-radius: .75rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: .92rem;
    background: rgba(var(--c), .16); color: rgb(var(--c));
}
.benfica-layout.pm-page .pm-stat--neutral .pm-stat-ico { color: var(--theme-ink-muted); background: rgba(var(--c), .4); }
.benfica-layout.pm-page .pm-stat-body { min-width: 0; display: flex; flex-direction: column; }
.benfica-layout.pm-page .pm-stat-num { font-size: 1.25rem; font-weight: 900; line-height: 1.05; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; color: var(--theme-ink); }
.benfica-layout.pm-page .pm-stat-lbl {
    order: 2; margin-top: .25rem; font-size: .62rem !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--theme-ink-muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Six across (md and up) leaves ~150px a tile: the chip sits above the figure. */
@media (min-width: 768px) {
    .benfica-layout.pm-page .pm-stat { flex-direction: column; align-items: flex-start; gap: .5rem; }
}
@media (max-width: 380px) {
    .benfica-layout.pm-page .pm-stat { gap: .5rem; padding: .65rem .6rem !important; }
    .benfica-layout.pm-page .pm-stat-ico { width: 2rem; height: 2rem; font-size: .8rem; }
    .benfica-layout.pm-page .pm-stat-num { font-size: 1.1rem; }
}
.benfica-layout.pm-page .player-breakdown-boxed {
    border: 0; border-radius: var(--pm-radius);
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
}
.benfica-layout.pm-page #player-match-detailed-log .bn-filters .btn { border-radius: 999px; }
/* The per-competition match logs: the "Not in Squad" / "On the Bench" rows keep their
   meaning but lose the heavy grey/yellow fills for a softer tint. */
.benfica-layout.pm-page .player-detailed-log-table > tbody > tr.table-secondary > * { --bs-table-bg: var(--pm-row-bg); color: var(--theme-ink-muted); }
.benfica-layout.pm-page .player-detailed-log-table > tbody > tr.table-warning > * { --bs-table-bg: rgba(var(--theme-warning-rgb), .10); }
[data-bs-theme="dark"] .benfica-layout.pm-page .player-detailed-log-table > tbody > tr.table-warning > * { --bs-table-bg: color-mix(in oklab, var(--theme-warning) 9%, var(--pm-card-bg)); }

/* ---- Vs Clubs ------------------------------------------------------------------ */
.benfica-layout.pm-page #player-vs-clubs .pvc-scope { border-bottom: 1px solid var(--pm-line); padding: .7rem .9rem; gap: .4rem; }
.benfica-layout.pm-page #player-vs-clubs .pvc-scope > span {
    display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px;
    background: var(--pm-row-bg); font-weight: 600;
}
.benfica-layout.pm-page #player-vs-clubs .pvc-note { border-top: 1px solid var(--pm-line); padding: .7rem .9rem; }

/* ---- History: achievements, previous clubs, transfers, numbers, availability --- */
.benfica-layout.pm-page #player-achievements .ph-card {
    border: 0; background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
    transition: transform var(--dur-base, .24s) ease, box-shadow var(--dur-base, .24s) ease;
}
@media (hover: hover) { .benfica-layout.pm-page #player-achievements .ph-card:hover { transform: translateY(-3px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page #player-achievements .ph-ico {
    border-radius: .8rem;
    background: radial-gradient(120% 120% at 20% 10%, rgba(var(--theme-accent-rgb), .30), rgba(var(--theme-accent-rgb), .10));
    color: var(--theme-accent-700, var(--theme-accent));
}
[data-bs-theme="dark"] .benfica-layout.pm-page #player-achievements .ph-ico { color: var(--theme-accent); }

/* Previous clubs: each club a small tile with its crest on a disc. */
.benfica-layout.pm-page #player-previous-clubs-history > .card { background: transparent !important; box-shadow: none !important; overflow: visible; }
.benfica-layout.pm-page #player-previous-clubs-history > .card > .card-body { padding: 0 !important; }
.benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .65rem !important;
}
@media (max-width: 575.98px) {
    .benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem !important; }
}
.benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex > :is(a, span) {
    display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start; gap: .1rem;
    padding: .8rem .5rem .7rem; border-radius: var(--pm-radius);
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
    color: var(--theme-ink); font-weight: 700; min-width: 0;
    transition: transform var(--dur-base, .24s) ease, box-shadow var(--dur-base, .24s) ease;
}
@media (hover: hover) { .benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex > a:hover { transform: translateY(-3px); box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex > :is(a, span) > span:first-child,
.benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex > span > i:first-child {
    width: 2.8rem !important; height: 2.8rem !important; border-radius: 50%; margin-bottom: .35rem !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    background: var(--pm-row-bg);
}
.benfica-layout.pm-page #player-previous-clubs-history .card-body > .d-flex > :is(a, span) .small {
    font-size: .78rem; line-height: 1.25; overflow-wrap: anywhere;
}

/* Transfer history: a fee reads as money (green, the site convention). */
.benfica-layout.pm-page #player-transfers .trf-table > tbody > tr > td:last-child { font-weight: 800; }
.benfica-layout.pm-page #player-transfers .trf-table .badge,
.benfica-layout.pm-page #player-transfers .trf-table .bn-chip { border-radius: 999px; }

/* Squad numbers: the shirts already are cards; they lose the hairline like the rest. */
.benfica-layout.pm-page #player-squad-numbers .sqn-card { border-color: transparent; background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow); }
.benfica-layout.pm-page #player-squad-numbers .sqn-card.is-current { border-color: rgba(var(--theme-accent-rgb), .7); }
@media (hover: hover) { .benfica-layout.pm-page #player-squad-numbers .sqn-card:hover { box-shadow: var(--pm-lift-shadow); } }

/* Availability history: soft cards with the accent edge kept. */
.benfica-layout.pm-page #player-availability-history .pih-card {
    border: 0; background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
    border-radius: .9rem;
}
.benfica-layout.pm-page #player-availability-history .pih-card::before { width: 4px; }
@media (hover: hover) { .benfica-layout.pm-page #player-availability-history .pih-card:hover { box-shadow: var(--pm-lift-shadow); } }
.benfica-layout.pm-page #player-availability-history :is(.pih-chip, .pih-season) { background: var(--pm-row-bg); }
.benfica-layout.pm-page #player-availability-history .pih-filters .pih-filter { border-color: transparent; background: var(--pm-row-bg); }
.benfica-layout.pm-page #player-availability-history .pih-filters .pih-filter.active { background: var(--theme-primary); color: var(--theme-on-primary); }

/* Its four summary figures: the .mm-tile idiom (icon chip left, figure over label). The
   label's icon is lifted out of its line by display:contents, so no markup changes. */
.benfica-layout.pm-page #player-availability-history > .row > [class*="col-"] > .border.rounded-3 {
    border: 0 !important; border-radius: var(--pm-radius) !important; padding: .75rem .85rem !important;
    background: radial-gradient(120% 120% at 0% 0%, rgba(var(--theme-danger-rgb), .08), transparent 60%), var(--pm-card-bg) !important;
    box-shadow: var(--pm-soft-shadow); text-align: left !important;
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .7rem; align-items: center;
    font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--theme-ink-muted);
}
.benfica-layout.pm-page #player-availability-history > .row > [class*="col-"] > .border.rounded-3 > .small { display: contents; }
.benfica-layout.pm-page #player-availability-history > .row > [class*="col-"] > .border.rounded-3 > .small > i {
    grid-column: 1; grid-row: 1 / span 2;
    width: 2.3rem; height: 2.3rem; margin: 0 !important; border-radius: .75rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
    background: color-mix(in oklab, currentColor 14%, transparent);
}
.benfica-layout.pm-page #player-availability-history > .row > [class*="col-"] > .border.rounded-3 > .fs-5 {
    grid-column: 2; grid-row: 1; align-self: end;
    font-size: 1.45rem !important; font-weight: 900 !important; line-height: 1.05; letter-spacing: 0; text-transform: none;
    font-variant-numeric: tabular-nums; color: var(--theme-ink);
}
.benfica-layout.pm-page #player-availability-history .pih-tl {
    border: 0 !important; border-radius: var(--pm-radius); overflow: hidden;
    background: var(--pm-card-bg); box-shadow: var(--pm-soft-shadow);
}

/* ---- Season drill-down (?stats_id=) ------------------------------------------ */
.benfica-layout.pm-page #season-statistics-section .bn-section > .card { border: 0 !important; box-shadow: var(--pm-soft-shadow); background: var(--pm-card-bg); }

/* ---- Sidebar ----------------------------------------------------------------------
   The Player facts: each label icon in a small tinted chip (all Font Awesome
   glyphs, so the <i> itself can carry the chip). */
.benfica-layout.pm-page .bn-aside .mi-info-panel .bn-facts { gap: .5rem; }
.benfica-layout.pm-page .bn-aside .mi-info-panel .bn-facts > li { align-items: center; }
.benfica-layout.pm-page .bn-aside .mi-info-panel .bn-fact-label { display: inline-flex; align-items: center; gap: .55rem; }
.benfica-layout.pm-page .bn-aside .mi-info-panel .bn-fact-label > i {
    flex: 0 0 auto; width: 1.7rem !important; height: 1.7rem; margin: 0 !important; border-radius: .55rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: .78rem;
    background: rgba(var(--theme-accent-rgb), .14); color: var(--theme-accent) !important;
}
.benfica-layout.pm-page .bn-aside .mi-info-panel .bn-fact-val { font-weight: 800; }

/* Contract / Trophy / Market Value widgets: the bordered inner boxes become soft tiles. */
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .bg-body-secondary { background: var(--pm-row-bg) !important; border-radius: .75rem !important; }
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .bg-body-secondary .fw-semibold,
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .bg-body-secondary .fs-5 { font-weight: 900 !important; font-variant-numeric: tabular-nums; }
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .alert {
    border: 0; border-radius: .8rem;
    background: rgba(var(--theme-success-rgb), .10); color: var(--theme-ink);
}
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .progress { height: .5rem !important; border-radius: 99px; background: var(--pm-row-bg); }
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .progress-bar { border-radius: 99px; }
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .trophy-card {
    border: 0 !important; border-radius: .85rem; background: var(--pm-row-bg) !important; box-shadow: none;
    transition: transform var(--dur-base, .24s) ease;
}
@media (hover: hover) { .benfica-layout.pm-page .bn-aside .co-sidebar-widget a:hover .trophy-card { transform: translateY(-2px); } }
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .py-2.px-3.mb-0:has(.fa-trophy) {
    border: 0 !important; border-radius: .85rem;
    background: radial-gradient(120% 140% at 0% 0%, rgba(var(--theme-accent-rgb), .18), transparent 65%), var(--pm-row-bg) !important;
}
.benfica-layout.pm-page .bn-aside .co-sidebar-widget .mv-vote-btn { border-radius: 999px; }

/* Dark: the widgets' red headings and figures (.text-primary) are lifted towards the ink,
   the same treatment the theme gives links — club red on the dark card is too faint. */
[data-bs-theme="dark"] .benfica-layout.pm-page .bn-aside .co-sidebar-widget :is(.text-primary, h6.text-primary) {
    color: color-mix(in oklab, var(--theme-primary) 55%, var(--theme-ink)) !important;
}

@media (prefers-reduced-motion: reduce) {
    .benfica-layout.pm-page :is(.pkpi, .pm-stat, .pl-detail-fact, .ph-card, .mf-card) { transition: none !important; }
    .benfica-layout.pm-page :is(.pkpi, .pm-stat, .pl-detail-fact, .ph-card, .mf-card):hover { transform: none !important; }
}

/* No shadows, the sidebar's border instead (Bruno, 1 Oct 2026, as on the match page):
   the two shadow tokens become a 1px ring in the .bn-panel line colour, so every card
   that wore the soft shadow now shows that border (no layout shift), and the theme's
   drop shadows on the sidebar panels and widgets go. The pill tab bar keeps its own. */
.benfica-layout.pm-page { --pm-soft-shadow: 0 0 0 1px rgba(0, 0, 0, .07); --pm-lift-shadow: 0 0 0 1px rgba(0, 0, 0, .07); }
[data-bs-theme="dark"] .benfica-layout.pm-page { --pm-soft-shadow: 0 0 0 1px rgba(255, 255, 255, .08); --pm-lift-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.benfica-layout.pm-page :is(.bn-aside .bn-panel, .section-card) { box-shadow: none !important; border: 1px solid rgba(0, 0, 0, .07) !important; }
[data-bs-theme="dark"] .benfica-layout.pm-page :is(.bn-aside .bn-panel, .section-card) { border-color: rgba(255, 255, 255, .08) !important; }
.benfica-layout.pm-page .bn-aside .bn-panel.bn-cta { border-color: transparent !important; }

/* Intro card: a smaller gap around the biography (Bruno, 1 Oct 2026). */
.benfica-layout.pm-page #player-profile > .card > .card-body { padding: .75rem .85rem !important; }
.benfica-layout.pm-page #player-profile .col > div[style*="word-break"] { line-height: 1.6; }

/* Average Fan Rating: the head and its strip are ONE card. The shared block rule above
   (:is() with #player-by-competition) out-ranked the join, so the strip sat 16px below
   as its own card with its columns at the card edges. The doubled id wins it back; the
   strip gets the head's 1rem sides so the first/last columns line up with the title. */
.benfica-layout.pm-page #player-statistics#player-statistics > .card > .card-body > .bn-rtg-summary:has(+ .bn-rtg-stripwrap) {
    margin-bottom: 0 !important; border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important;
}
.benfica-layout.pm-page #player-statistics#player-statistics > .card > .card-body > .bn-rtg-summary + .bn-rtg-stripwrap {
    margin-top: 0 !important; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important;
    padding: .1rem 1rem .5rem !important;
}

/* Cards as on the forum, the site's normal (Bruno, 1 Oct 2026): the 1px .bn-panel line
   AND the theme's soft drop shadow. Overrides the shadow-free pass just above. */
.benfica-layout.pm-page {
    --pm-soft-shadow: 0 0 0 1px rgba(0, 0, 0, .07), var(--theme-shadow, 0 10px 30px rgba(0, 0, 0, .06));
    --pm-lift-shadow: 0 0 0 1px rgba(0, 0, 0, .07), var(--theme-shadow, 0 10px 30px rgba(0, 0, 0, .06));
}
[data-bs-theme="dark"] .benfica-layout.pm-page {
    --pm-soft-shadow: 0 0 0 1px rgba(255, 255, 255, .08), var(--theme-shadow, 0 10px 30px rgba(0, 0, 0, .3));
    --pm-lift-shadow: 0 0 0 1px rgba(255, 255, 255, .08), var(--theme-shadow, 0 10px 30px rgba(0, 0, 0, .3));
}
.benfica-layout.pm-page :is(.bn-aside .bn-panel, .section-card) { box-shadow: var(--theme-shadow, 0 10px 30px rgba(0, 0, 0, .06)) !important; }
