/* ════════════════════════════════════════════════════════════════════
   PML Leaderboard — Public Styles v1.0.6
   Font: Poppins | Layout: Sticky Sidebar + Dual-Column
   Mobile: Full-width accordion, single-column, no overflow
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ── Box-sizing reset scoped to plugin ───────────────────────────── */
.pml-lb-wrap *, .pml-lb-wrap *::before, .pml-lb-wrap *::after,
.pml-records-wrap *, .pml-records-wrap *::before, .pml-records-wrap *::after,
.pml-modal-overlay *, .pml-participants-overlay * {
    box-sizing: border-box;
}

:root {
    --pml-red:         #c1121f;
    --pml-red-light:   #e63946;
    --pml-blue:        #1a3a6e;
    --pml-blue-light:  #2557a7;
    --pml-gold:        #f0c040;
    --pml-gold-dim:    #c9a84c;
    --pml-dark:        #0a0c10;
    --pml-dark2:       #111318;
    --pml-dark3:       #181c24;
    --pml-dark4:       #1e222e;
    --pml-border:      rgba(255,255,255,0.08);
    --pml-text:        #e8eaf0;
    --pml-muted:       rgba(232,234,240,0.5);
    --pml-font:        'Poppins', sans-serif;
    --pml-radius:      10px;
    --pml-radius-sm:   4px;   /* photos: square with small radius */
    --pml-shadow:      0 8px 32px rgba(0,0,0,0.45);
    --pml-transition:  0.22s cubic-bezier(0.4,0,0.2,1);
    --pml-sidebar-w:   260px;
    --pml-sticky-top:  32px;
}

/* ════════════════════════════════════════════════════════════════════
   WRAPPER  —  overflow: clip stops horizontal bleed without
               breaking sticky positioning like overflow:hidden does
   ════════════════════════════════════════════════════════════════════ */
.pml-lb-wrap,
.pml-records-wrap {
    font-family: var(--pml-font);
    color: var(--pml-text);
    background: var(--pml-dark);
    border-radius: 14px;
    padding: 28px 24px 40px;
    box-shadow: var(--pml-shadow);
    position: relative;
    overflow: clip;           /* clips decoration, allows sticky child */
    max-width: 100%;
    width: 100%;
}
/* Checkered corner decoration */
.pml-lb-wrap::before {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 140px; height: 140px;
    background-image: repeating-conic-gradient(rgba(255,255,255,0.025) 0% 25%, transparent 0% 50%);
    background-size: 16px 16px;
    pointer-events: none;
    border-radius: 0 14px 0 0;
}
/* Red-gold accent bar */
.pml-lb-wrap::after,
.pml-records-wrap::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--pml-red) 0%, var(--pml-red-light) 50%, var(--pml-gold) 100%);
}

/* ════════════════════════════════════════════════════════════════════
   BREADCRUMB
   ════════════════════════════════════════════════════════════════════ */
.pml-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 16px;
    margin-bottom: 18px;
    background: var(--pml-dark3);
    border: 1px solid var(--pml-border);
    border-radius: 8px;
    font-family: var(--pml-font);
    font-size: 11px;
    font-weight: 500;
    /* Constrain to container */
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.pml-bc-item {
    color: var(--pml-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    transition: color var(--pml-transition);
}
.pml-bc-item.is-active {
    color: var(--pml-gold);
    font-weight: 700;
}
.pml-bc-sep {
    color: rgba(232,234,240,0.25);
    font-size: 12px;
    flex-shrink: 0;
    user-select: none;
}

/* ════════════════════════════════════════════════════════════════════
   SEASON SWITCHER
   ════════════════════════════════════════════════════════════════════ */
.pml-season-switcher {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px;
}
.pml-season-btn {
    font-family: var(--pml-font);
    font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    padding: 5px 16px; border-radius: 99px;
    border: 1px solid var(--pml-border);
    background: var(--pml-dark3); color: var(--pml-muted);
    cursor: pointer; transition: all var(--pml-transition);
    white-space: nowrap;
}
.pml-season-btn:hover { background: var(--pml-dark4); color: var(--pml-text); }
.pml-season-btn.is-active {
    background: var(--pml-blue); color: #fff; border-color: var(--pml-blue-light);
}

/* ════════════════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════════════════ */
.pml-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
}

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════ */
.pml-sidebar {
    flex: 0 0 var(--pml-sidebar-w);
    width: var(--pml-sidebar-w);
    min-width: 0;
    position: sticky;
    top: var(--pml-sticky-top);
    max-height: calc(100vh - var(--pml-sticky-top) - 20px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--pml-border) transparent;
    background: var(--pml-dark2);
    border: 1px solid var(--pml-border);
    border-radius: var(--pml-radius);
}
.pml-sidebar::-webkit-scrollbar { width: 4px; }
.pml-sidebar::-webkit-scrollbar-thumb { background: var(--pml-border); border-radius: 2px; }

.pml-sidebar-toggle {
    display: none;
    width: 100%; padding: 13px 16px;
    background: var(--pml-dark3);
    border: none; color: var(--pml-text);
    font-family: var(--pml-font);
    font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; justify-content: space-between; align-items: center;
    transition: background var(--pml-transition);
}
.pml-sidebar-toggle:hover { background: var(--pml-dark4); }
.pml-sidebar-toggle-icon { font-size: 14px; transition: transform 0.2s; }
.pml-sidebar-body { display: block; }

.pml-sidebar-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--pml-border);
}
.pml-sidebar-section:last-child { border-bottom: none; }
.pml-sidebar-section-title {
    font-family: var(--pml-font);
    font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
    color: var(--pml-muted); padding: 0 14px 8px;
}
.pml-cat-item {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 8px 14px; gap: 8px;
    border: none; border-left: 3px solid transparent;
    background: transparent; color: var(--pml-muted);
    cursor: pointer; transition: all var(--pml-transition); text-align: left;
}
.pml-cat-item:hover { background: var(--pml-dark3); color: var(--pml-text); }
.pml-cat-item.is-active {
    background: var(--pml-dark4); color: var(--pml-gold); border-left-color: var(--pml-gold);
}
.pml-cat-item-name {
    font-family: var(--pml-font);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    flex: 1; line-height: 1.4; text-align: left;
    /* Wrap long category names gracefully */
    word-break: break-word; white-space: normal;
}
.pml-cat-item-arrow { font-size: 12px; opacity: 0.4; flex-shrink: 0; transition: transform var(--pml-transition); }
.pml-cat-item.is-active .pml-cat-item-arrow { opacity: 1; transform: translateX(2px); }

.pml-leg-item {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 7px 14px;
    border: none; border-left: 3px solid transparent;
    background: transparent;
    font-family: var(--pml-font);
    font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px;
    color: var(--pml-muted); cursor: pointer; text-align: left;
    word-break: break-word; white-space: normal;
    transition: all var(--pml-transition);
}
.pml-leg-item:hover:not(.is-upcoming) { background: var(--pml-dark3); color: var(--pml-text); }
.pml-leg-item.is-active {
    color: var(--pml-blue-light); font-weight: 700;
    border-left-color: var(--pml-blue-light); background: rgba(37,87,167,0.08);
}
.pml-leg-item.is-upcoming { opacity: 0.4; cursor: default; }
.pml-upcoming-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--pml-gold); flex-shrink: 0;
    animation: pml-pulse 1.8s ease-in-out infinite;
}
@keyframes pml-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

/* ════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════════════════ */
.pml-content {
    flex: 1;
    min-width: 0;      /* critical — prevents flex child from overflowing */
    overflow: hidden;  /* catches any internal overflow */
}

.pml-loading {
    display: flex; align-items: center; gap: 14px;
    padding: 48px 0; color: var(--pml-muted);
    font-family: var(--pml-font); font-size: 14px;
}
.pml-spinner {
    width: 26px; height: 26px; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--pml-red);
    border-radius: 50%; animation: pml-spin 0.75s linear infinite;
}
@keyframes pml-spin { to { transform: rotate(360deg); } }
.pml-error {
    padding: 20px; background: rgba(193,18,31,0.1);
    border: 1px solid rgba(193,18,31,0.3); border-radius: var(--pml-radius);
    color: #f8a4a8; font-family: var(--pml-font); font-size: 13px;
}
.pml-no-data {
    padding: 48px; text-align: center;
    color: var(--pml-muted); font-family: var(--pml-font); font-size: 14px; font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════
   CATEGORY BLOCK
   ════════════════════════════════════════════════════════════════════ */
.pml-lb-container { display: flex; flex-direction: column; gap: 28px; }

.pml-category-block {
    background: var(--pml-dark2);
    border: 1px solid var(--pml-border);
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
    animation: pml-fadein 0.3s ease both;
}
@keyframes pml-fadein { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

.pml-category-header {
    background: linear-gradient(90deg, var(--pml-dark4) 0%, var(--pml-dark3) 100%);
    padding: 14px 18px;
    border-bottom: 1px solid var(--pml-border);
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.pml-category-name {
    font-family: var(--pml-font);
    font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
    color: #fff; flex: 1; line-height: 1.3;
    /* Allow wrapping on mobile — no nowrap */
    word-break: break-word;
}
.pml-category-dist {
    font-family: var(--pml-font);
    font-size: 10px; font-weight: 600; color: var(--pml-gold);
    background: rgba(240,192,64,0.1); border: 1px solid rgba(240,192,64,0.25);
    padding: 3px 10px; border-radius: 99px;
    white-space: nowrap; flex-shrink: 0;
}

/* Two equal columns — collapses on mobile */
.pml-category-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
}
.pml-standings-col {
    padding: 16px 14px;
    border-right: 1px solid var(--pml-border);
    min-width: 0;   /* prevents column from overflowing grid */
}
.pml-standings-col:last-child { border-right: none; }
.pml-standings-col-title {
    font-family: var(--pml-font);
    font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--pml-muted); margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--pml-border);
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap; overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════
   STANDINGS ROWS
   Per-rank colours use CSS custom properties so Elementor selectors
   can override each rank individually without specificity battles.
   ════════════════════════════════════════════════════════════════════ */
.pml-standings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

/* ── Per-rank CSS variable defaults ─────────────────────────────── */
/* Champion — gold gradient */
.pml-standings-row[data-rank="1"] {
    --pml-rank-label-color:   #f0c040;
    --pml-rank-label-bg:      linear-gradient(90deg, #7a5c00 0%, #3d2e00 100%);
    --pml-rank-row-bg:        linear-gradient(120deg, #1e2e1a 0%, #1a1f2a 100%);
    --pml-rank-row-border:    rgba(240,192,64,0.35);
}
/* 1st Runner Up — silver */
.pml-standings-row[data-rank="2"] {
    --pml-rank-label-color:   #e0e0e0;
    --pml-rank-label-bg:      linear-gradient(90deg, #3a3a3a 0%, #222 100%);
    --pml-rank-row-bg:        var(--pml-dark3);
    --pml-rank-row-border:    rgba(200,200,200,0.15);
}
/* 2nd Runner Up — copper/bronze */
.pml-standings-row[data-rank="3"] {
    --pml-rank-label-color:   #cd7f32;
    --pml-rank-label-bg:      linear-gradient(90deg, #3b2200 0%, #221600 100%);
    --pml-rank-row-bg:        var(--pml-dark3);
    --pml-rank-row-border:    rgba(205,127,50,0.15);
}
/* 3rd Runner Up — slate blue */
.pml-standings-row[data-rank="4"] {
    --pml-rank-label-color:   #8899bb;
    --pml-rank-label-bg:      linear-gradient(90deg, #1a2035 0%, #111318 100%);
    --pml-rank-row-bg:        var(--pml-dark3);
    --pml-rank-row-border:    rgba(100,120,160,0.15);
}
/* 4th Runner Up — dark grey */
.pml-standings-row[data-rank="5"] {
    --pml-rank-label-color:   #667080;
    --pml-rank-label-bg:      linear-gradient(90deg, #1a1d22 0%, #111318 100%);
    --pml-rank-row-bg:        var(--pml-dark3);
    --pml-rank-row-border:    rgba(80,90,100,0.12);
}
/* Participant (rank > 5) */
.pml-standings-row.pml-rank-participant {
    --pml-rank-label-color:   rgba(232,234,240,0.3);
    --pml-rank-label-bg:      transparent;
    --pml-rank-row-bg:        var(--pml-dark3);
    --pml-rank-row-border:    transparent;
}

/* ── Base row styles — consume the CSS variables ─────────────────── */
.pml-standings-row {
    border-radius: var(--pml-radius-sm);
    background: var(--pml-rank-row-bg, var(--pml-dark3));
    border: 1px solid var(--pml-rank-row-border, transparent);
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
    transition: all var(--pml-transition);
}
.pml-standings-row:hover {
    filter: brightness(1.1);
    transform: translateX(2px);
}

/* ── Rank label strip ────────────────────────────────────────────── */
.pml-rank-label {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    font-family: var(--pml-font);
    font-size: 9px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    /* Consume per-rank vars */
    color:      var(--pml-rank-label-color, rgba(232,234,240,0.5));
    background: var(--pml-rank-label-bg,   rgba(255,255,255,0.03));
}
.pml-rank-label .pml-rank-medal { font-size: 13px; flex-shrink: 0; }
/* Keep legacy classes for JS compatibility */
.pml-rank-1      { /* vars set on data-rank="1" parent */ }
.pml-rank-runner { /* vars set on data-rank parent      */ }
.pml-rank-n      { /* vars set on .pml-rank-participant */ }

/* Row body */
.pml-row-body {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    min-width: 0;
}
/* Champion: slightly larger padding, align photo to bottom */
.pml-standings-row[data-rank="1"] .pml-row-body {
    padding: 10px 10px 12px;
    align-items: flex-end;
}

/* ── PHOTOS: square with 4px border-radius (not circular) ─────── */
.pml-entity-photo {
    width: 40px; height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid var(--pml-border);
    flex-shrink: 0;
}
.pml-entity-photo-placeholder {
    width: 40px; height: 40px;
    border-radius: 4px;
    background: var(--pml-dark4);
    border: 2px solid var(--pml-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
/* Champion photo — larger */
.pml-standings-row[data-rank="1"] .pml-entity-photo,
.pml-standings-row[data-rank="1"] .pml-entity-photo-placeholder {
    width: 68px; height: 68px;
    border-radius: 4px;
    border-color: rgba(240,192,64,0.35);
}

/* Name + sub */
.pml-entity-info { flex: 1; min-width: 0; }
.pml-entity-name {
    font-family: var(--pml-font);
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2px;
    color: var(--pml-text); line-height: 1.2;
    /* Truncate with ellipsis — prevents overflow */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pml-standings-row[data-rank="1"] .pml-entity-name { font-size: 14px; }
.pml-entity-sub {
    font-family: var(--pml-font);
    font-size: 10px; font-weight: 500; color: var(--pml-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px;
}

/* Points */
.pml-points-wrap { text-align: right; flex-shrink: 0; min-width: 36px; }
.pml-points-badge {
    font-family: var(--pml-font);
    font-size: 20px; font-weight: 800; color: var(--pml-text); line-height: 1;
}
.pml-standings-row[data-rank="1"] .pml-points-badge { font-size: 26px; color: var(--pml-gold); }
.pml-points-label {
    font-family: var(--pml-font);
    font-size: 9px; font-weight: 600; color: var(--pml-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.pml-detail-arrow {
    font-size: 12px; color: var(--pml-muted); flex-shrink: 0; margin-left: 2px;
    transition: transform var(--pml-transition);
}
.pml-standings-row:hover .pml-detail-arrow { transform: translateX(3px); }

.pml-empty-col {
    padding: 20px 0; color: var(--pml-muted);
    font-family: var(--pml-font); font-style: italic; font-size: 12px;
}

/* View All button */
.pml-view-all-btn {
    display: block; width: 100%; padding: 9px;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: var(--pml-radius-sm);
    color: var(--pml-muted); cursor: pointer;
    font-family: var(--pml-font);
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    text-align: center; transition: all var(--pml-transition); margin-top: 4px;
}
.pml-view-all-btn:hover {
    border-color: var(--pml-gold); color: var(--pml-gold); background: rgba(240,192,64,0.06);
}

/* ════════════════════════════════════════════════════════════════════
   DETAIL MODAL
   ════════════════════════════════════════════════════════════════════ */
.pml-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.78); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(5px);
}
.pml-modal {
    background: var(--pml-dark2);
    border: 1px solid var(--pml-border); border-top: 4px solid var(--pml-red);
    border-radius: 14px; padding: 28px 24px 24px;
    max-width: 540px; width: 100%; position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    max-height: 90vh; overflow-y: auto;
    animation: pml-modal-in 0.22s cubic-bezier(0.4,0,0.2,1);
}
@keyframes pml-modal-in { from{opacity:0;transform:scale(.95) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

.pml-modal-close {
    position: absolute; top: 12px; right: 12px;
    background: var(--pml-dark4); border: 1px solid var(--pml-border);
    color: var(--pml-muted); border-radius: 50%;
    width: 28px; height: 28px; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--pml-transition); flex-shrink: 0;
}
.pml-modal-close:hover { background: var(--pml-red); color: #fff; border-color: var(--pml-red); }

.pml-modal-entity-header {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 12px; margin-bottom: 20px; padding-bottom: 18px;
    border-bottom: 1px solid var(--pml-border);
}
/* Modal photo — square with small radius */
.pml-modal-photo {
    width: 120px; height: 120px;
    border-radius: 6px;
    object-fit: cover;
    border: 3px solid var(--pml-gold);
}
.pml-modal-photo-placeholder {
    width: 120px; height: 120px; border-radius: 6px;
    background: var(--pml-dark4); border: 3px solid var(--pml-border);
    display: flex; align-items: center; justify-content: center; font-size: 44px;
}
.pml-modal-name {
    font-family: var(--pml-font);
    font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
    color: #fff; line-height: 1.15; word-break: break-word;
}
.pml-modal-sub {
    font-family: var(--pml-font); font-size: 13px; font-weight: 600; color: var(--pml-gold);
}
.pml-modal-total {
    background: var(--pml-dark3); border: 1px solid var(--pml-border);
    border-radius: var(--pml-radius); padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.pml-modal-total-label {
    font-family: var(--pml-font);
    font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--pml-muted);
}
.pml-modal-total-pts {
    font-family: var(--pml-font); font-size: 30px; font-weight: 800; color: var(--pml-gold); line-height: 1;
}
.pml-modal-total-pts span { font-size: 12px; color: var(--pml-muted); margin-left: 3px; }
.pml-modal-breakdown-title {
    font-family: var(--pml-font); font-size: 10px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: var(--pml-muted); margin-bottom: 8px;
}
.pml-modal-leg-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: var(--pml-radius-sm);
    background: var(--pml-dark3); border: 1px solid var(--pml-border); margin-bottom: 5px;
    gap: 10px;
}
.pml-modal-leg-name  { font-family: var(--pml-font); font-size: 12px; font-weight: 600; color: var(--pml-text); min-width: 0; flex: 1; }
.pml-modal-leg-time  { font-family: var(--pml-font); font-size: 11px; color: var(--pml-red-light); }
.pml-modal-leg-pts   { font-family: var(--pml-font); font-size: 16px; font-weight: 800; color: var(--pml-gold); flex-shrink: 0; }
.pml-modal-leg-pos   { font-family: var(--pml-font); font-size: 11px; color: var(--pml-muted); }

/* ════════════════════════════════════════════════════════════════════
   ALL PARTICIPANTS MODAL
   ════════════════════════════════════════════════════════════════════ */
.pml-participants-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85); z-index: 99998;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 24px 16px 16px; backdrop-filter: blur(5px);
    overflow-y: auto;
}
.pml-participants-modal {
    background: var(--pml-dark2);
    border: 1px solid var(--pml-border); border-top: 4px solid var(--pml-gold);
    border-radius: 14px; width: 100%; max-width: 1000px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    animation: pml-modal-in 0.22s cubic-bezier(0.4,0,0.2,1); overflow: hidden;
}
.pml-participants-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--pml-border);
    background: var(--pml-dark3); position: sticky; top: 0; z-index: 2;
    gap: 12px;
}
.pml-participants-title {
    font-family: var(--pml-font);
    font-size: 18px; font-weight: 800; text-transform: uppercase; color: #fff; line-height: 1;
}
.pml-participants-sub { font-family: var(--pml-font); font-size: 12px; color: var(--pml-gold); margin-top: 3px; }
.pml-participants-body { padding: 20px; }
.pml-participants-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.pml-p-card {
    background: var(--pml-dark3); border: 1px solid var(--pml-border);
    border-radius: 8px; padding: 14px 10px;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
    transition: all var(--pml-transition);
}
.pml-p-card.is-champion {
    background: linear-gradient(160deg, rgba(240,192,64,0.1), var(--pml-dark3));
    border-color: rgba(240,192,64,0.28);
}
.pml-p-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.13); }
.pml-p-rank {
    font-family: var(--pml-font); font-size: 9px; font-weight: 800;
    letter-spacing: 0.8px; text-transform: uppercase;
    padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,0.05);
    white-space: nowrap;
}
.pml-p-rank.pml-rank-1      { color: var(--pml-gold); background: rgba(240,192,64,0.1); }
.pml-p-rank.pml-rank-runner { color: var(--pml-muted); }
.pml-p-rank.pml-rank-n      { color: rgba(232,234,240,0.3); }
/* Participant photos — square */
.pml-p-photo {
    width: 60px; height: 60px; border-radius: 4px; object-fit: cover; border: 2px solid var(--pml-border);
}
.pml-p-photo-placeholder {
    width: 60px; height: 60px; border-radius: 4px;
    background: var(--pml-dark4); border: 2px solid var(--pml-border);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pml-p-name { font-family: var(--pml-font); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--pml-text); line-height: 1.2; word-break: break-word; }
.pml-p-sub  { font-family: var(--pml-font); font-size: 10px; font-weight: 500; color: var(--pml-muted); }
.pml-p-pts  { font-family: var(--pml-font); font-size: 16px; font-weight: 800; color: var(--pml-gold); line-height: 1; }
.pml-p-pts span { font-size: 10px; color: var(--pml-muted); }

/* ════════════════════════════════════════════════════════════════════
   RECORDS WIDGET
   ════════════════════════════════════════════════════════════════════ */
.pml-records-header { margin-bottom: 20px; }
.pml-records-title  { font-family: var(--pml-font); font-size: 22px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 0.3px; margin: 0 0 3px; }
.pml-records-sub    { font-family: var(--pml-font); font-size: 12px; color: var(--pml-muted); margin: 0 0 18px; }
.pml-records-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.pml-record-card {
    background: var(--pml-dark3); border: 1px solid var(--pml-border);
    border-radius: 10px; padding: 16px 18px;
    transition: all var(--pml-transition); position: relative; overflow: hidden;
}
.pml-record-card::before {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--pml-red), var(--pml-gold));
}
.pml-record-cat      { font-family: var(--pml-font); font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--pml-muted); margin-bottom: 3px; }
.pml-record-dist     { font-family: var(--pml-font); font-size: 10px; color: var(--pml-gold-dim); margin-bottom: 8px; }
.pml-record-time-big { font-family: var(--pml-font); font-size: 34px; font-weight: 800; color: var(--pml-gold); line-height: 1; margin-bottom: 12px; }
.pml-record-meta     { display: flex; align-items: center; gap: 9px; }
.pml-record-photo    { width: 38px; height: 38px; border-radius: 4px; object-fit: cover; border: 2px solid var(--pml-border); flex-shrink: 0; }
.pml-record-rider    { font-family: var(--pml-font); font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--pml-text); line-height: 1.2; word-break: break-word; }
.pml-record-team     { font-family: var(--pml-font); font-size: 10px; font-weight: 500; color: var(--pml-muted); }
.pml-record-leg      { font-family: var(--pml-font); font-size: 10px; color: var(--pml-red-light); margin-top: 2px; }

body.pml-modal-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  ≤ 960px
   Sidebar collapses to top accordion
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .pml-layout {
        flex-direction: column;
        gap: 12px;
    }
    .pml-sidebar {
        position: static;
        width: 100%;
        flex: none;
        max-height: none;
        overflow-y: visible;
    }
    .pml-sidebar-toggle { display: flex; }
    .pml-sidebar-body   { display: none; }
    .pml-sidebar-body.is-open { display: block; }
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  ≤ 640px
   Single column, tighter spacing, zero horizontal overflow
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    /* Wrapper — ensure it never bleeds the Elementor column */
    .pml-lb-wrap,
    .pml-records-wrap {
        padding: 14px 10px 24px;
        border-radius: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* All direct children constrained */
    .pml-layout,
    .pml-content,
    .pml-lb-container,
    .pml-category-block { max-width: 100%; overflow-x: hidden; }

    /* Category block: single column */
    .pml-category-cols { grid-template-columns: 1fr; }
    .pml-standings-col {
        border-right: none;
        border-bottom: 1px solid var(--pml-border);
        padding: 12px 10px;
    }
    .pml-standings-col:last-child { border-bottom: none; }

    /* Category header */
    .pml-category-header { flex-wrap: wrap; gap: 6px; padding: 12px; }
    .pml-category-name   { font-size: 13px; width: 100%; }
    .pml-category-dist   { font-size: 9px; }

    /* Row rank label */
    .pml-rank-label { padding: 4px 10px; font-size: 8px; letter-spacing: 0.8px; }

    /* Row body */
    .pml-row-body { padding: 8px; gap: 8px; min-width: 0; }

    /* Photos */
    .pml-entity-photo,
    .pml-entity-photo-placeholder { width: 36px; height: 36px; font-size: 13px; }

    /* Champion card photo */
    .pml-standings-row[data-rank="1"] .pml-entity-photo,
    .pml-standings-row[data-rank="1"] .pml-entity-photo-placeholder {
        width: 52px; height: 52px;
    }

    /* Names */
    .pml-entity-name { font-size: 11px; }
    .pml-standings-row[data-rank="1"] .pml-entity-name { font-size: 13px; }
    .pml-entity-sub  { font-size: 9px; }

    /* Points */
    .pml-points-wrap  { min-width: 30px; }
    .pml-points-badge { font-size: 17px; }
    .pml-standings-row[data-rank="1"] .pml-points-badge { font-size: 21px; }

    /* Arrow hidden to save width */
    .pml-detail-arrow { display: none; }

    /* Season buttons */
    .pml-season-btn { font-size: 10px; padding: 4px 10px; }

    /* Detail modal */
    .pml-modal {
        padding: 20px 14px 18px;
        border-radius: 10px;
        max-height: 92vh;
    }
    .pml-modal-name { font-size: 18px; }
    .pml-modal-photo,
    .pml-modal-photo-placeholder { width: 90px; height: 90px; }

    /* Participants modal — bottom sheet style */
    .pml-participants-overlay {
        padding: 8px 0 0;
        align-items: flex-end;
    }
    .pml-participants-modal {
        border-radius: 14px 14px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        width: 100%;
    }
    .pml-participants-header { padding: 14px 14px; }
    .pml-participants-title  { font-size: 15px; }
    .pml-participants-body   { padding: 12px 10px; }
    .pml-participants-grid   { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }

    /* Records */
    .pml-record-time-big { font-size: 26px; }
    .pml-records-grid    { grid-template-columns: 1fr 1fr; gap: 10px; }
    .pml-record-card     { padding: 12px 10px; }
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  ≤ 380px  (iPhone SE, Galaxy A, etc.)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .pml-lb-wrap,
    .pml-records-wrap { padding: 10px 8px 18px; }
    .pml-standings-col { padding: 10px 8px; }
    .pml-category-name { font-size: 11px; }
    .pml-entity-name   { font-size: 10px; }
    .pml-points-badge  { font-size: 15px; }
    .pml-standings-row[data-rank="1"] .pml-points-badge { font-size: 18px; }
    .pml-standings-row[data-rank="1"] .pml-entity-photo,
    .pml-standings-row[data-rank="1"] .pml-entity-photo-placeholder { width: 44px; height: 44px; }
    .pml-records-grid  { grid-template-columns: 1fr; }
    .pml-participants-grid { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
}
