.nrfi-pivot-app {
    --nc-bg: #0b1220;
    --nc-panel: #111b2e;
    --nc-panel-2: #162238;
    --nc-border: #2b3a53;
    --nc-text: #ecf3ff;
    --nc-muted: #9fb0c8;
    --nc-accent: #54a7ff;
    --nc-green: #63d49a;
    --nc-red: #ff7c84;
    --nc-amber: #f4c66a;
    background: var(--nc-bg);
    color: var(--nc-text);
    border: 1px solid var(--nc-border);
    border-radius: 14px;
    padding: 18px;
    font-family: inherit;
    line-height: 1.35;
}
.nrfi-pivot-app * { box-sizing: border-box; }
.nrfi-pivot-header { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:16px; }
.nrfi-pivot-header h2 { margin:2px 0 4px; color:#fff; font-size:clamp(20px,2.5vw,29px); }
.nrfi-pivot-kicker { color:var(--nc-accent); font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.nrfi-pivot-source-status { color:var(--nc-muted); font-size:13px; }
.nrfi-pivot-app label { color:var(--nc-muted); font-size:12px; font-weight:700; }
.nrfi-pivot-app select,.nrfi-pivot-app input { width:100%; min-height:40px; margin-top:5px; background:#0e1727; color:#fff; border:1px solid var(--nc-border); border-radius:8px; padding:8px 10px; font:inherit; font-size:14px; }
.nrfi-pivot-year-wrap { min-width:110px; }
.nrfi-pivot-scope-tabs { display:flex; gap:8px; margin:0 0 14px; border-bottom:1px solid var(--nc-border); padding-bottom:10px; }
.nrfi-pivot-scope-tabs button,.nrfi-pivot-actions button,.nrfi-pivot-cell-button,.nrfi-pivot-close { appearance:none; border:1px solid var(--nc-border); border-radius:8px; background:var(--nc-panel); color:var(--nc-text); cursor:pointer; font:inherit; }
.nrfi-pivot-scope-tabs button { padding:9px 18px; font-weight:800; }
.nrfi-pivot-scope-tabs button.is-active { background:var(--nc-accent); color:#08111f; border-color:var(--nc-accent); }
.nrfi-pivot-toolbar { display:grid; grid-template-columns:1.35fr repeat(4,minmax(120px,1fr)); gap:10px; padding:12px; background:var(--nc-panel); border:1px solid var(--nc-border); border-radius:10px; }
.nrfi-pivot-filters { margin-top:10px; border:1px solid var(--nc-border); border-radius:10px; background:var(--nc-panel); }
.nrfi-pivot-filters summary { cursor:pointer; padding:11px 13px; color:#fff; font-weight:800; }
.nrfi-pivot-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)); gap:10px; padding:0 12px 12px; }
.nrfi-pivot-actions { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-top:12px; }
.nrfi-pivot-search { width:min(420px,100%); }
.nrfi-pivot-action-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.nrfi-pivot-actions button { min-height:40px; padding:8px 12px; font-weight:800; }
.nrfi-pivot-actions button:hover { border-color:var(--nc-accent); }
.nrfi-pivot-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0; }
.nrfi-pivot-stat { background:var(--nc-panel); border:1px solid var(--nc-border); border-radius:10px; padding:11px 13px; min-width:0; }
.nrfi-pivot-stat .label { color:var(--nc-muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.nrfi-pivot-stat .value { color:#fff; font-size:21px; font-weight:900; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nrfi-pivot-stat .value.nrfi { color:var(--nc-green); }
.nrfi-pivot-message { color:var(--nc-muted); font-size:13px; margin:6px 0; }
.nrfi-pivot-table-wrap { overflow:auto; border:1px solid var(--nc-border); border-radius:10px; max-width:100%; }
.nrfi-pivot-table { width:100%; border-collapse:separate; border-spacing:0; min-width:640px; background:#0e1727; color:var(--nc-text); }
.nrfi-pivot-table th,.nrfi-pivot-table td { border-bottom:1px solid #24334a; border-right:1px solid #24334a; padding:8px 10px; text-align:center; vertical-align:middle; white-space:nowrap; }
.nrfi-pivot-table th { position:sticky; top:0; z-index:2; background:#101c30; color:#fff; font-size:12px; font-weight:900; }
.nrfi-pivot-table th:first-child { left:0; z-index:3; text-align:left; }
.nrfi-pivot-table td:first-child { position:sticky; left:0; z-index:1; background:#111b2e; text-align:left; font-weight:800; }
.nrfi-pivot-table tr:last-child td { border-bottom:0; }
.nrfi-pivot-table th:last-child,.nrfi-pivot-table td:last-child { border-right:0; }
.nrfi-pivot-table tbody tr:hover td { background:#14223a; }
.nrfi-pivot-table tbody tr:hover td:first-child { background:#182944; }
.nrfi-pivot-team-label { display:inline-flex; align-items:center; gap:8px; min-width:0; }
.nrfi-pivot-cell-button { width:100%; min-width:72px; padding:7px 8px; background:transparent; border-color:transparent; font-weight:900; }
.nrfi-pivot-cell-button:hover { border-color:var(--nc-accent); }
.nrfi-pivot-cell-button.nrfi-high { color:var(--nc-green); background:rgba(99,212,154,.08); }
.nrfi-pivot-cell-button.yrfi-high { color:var(--nc-red); background:rgba(255,124,132,.08); }
.nrfi-pivot-cell-button.count-value { color:#dce8f7; }
.nrfi-pivot-cell-button .sample { display:block; color:var(--nc-muted); font-size:10px; font-weight:700; margin-top:1px; }
.nrfi-pivot-empty { color:#64758f; }
.nrfi-pivot-sort { color:inherit; background:none; border:0; padding:0; font:inherit; font-weight:900; cursor:pointer; }
.nrfi-pivot-dialog { width:min(1000px,94vw); max-height:86vh; border:1px solid var(--nc-border); border-radius:12px; background:var(--nc-bg); color:var(--nc-text); padding:0; }
.nrfi-pivot-dialog::backdrop { background:rgba(0,0,0,.68); }
.nrfi-pivot-dialog-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 16px; border-bottom:1px solid var(--nc-border); }
.nrfi-pivot-dialog-head h3 { margin:2px 0 0; color:#fff; }
.nrfi-pivot-close { width:38px; height:38px; font-size:25px; line-height:1; }
.nrfi-pivot-dialog-body { padding:14px 16px 18px; max-height:70vh; overflow:auto; }
.nrfi-pivot-drill-table { width:100%; border-collapse:collapse; min-width:760px; font-size:12px; }
.nrfi-pivot-drill-table th,.nrfi-pivot-drill-table td { padding:7px 8px; border-bottom:1px solid var(--nc-border); text-align:left; white-space:nowrap; }
.nrfi-pivot-drill-table th { color:var(--nc-muted); text-transform:uppercase; letter-spacing:.04em; font-size:10px; }
.nrfi-pivot-result-nrfi { color:var(--nc-green); font-weight:900; }
.nrfi-pivot-result-yrfi { color:var(--nc-red); font-weight:900; }
.nrfi-pivot-loading { opacity:.66; pointer-events:none; }
@media (max-width: 980px) {
    .nrfi-pivot-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .nrfi-pivot-control-wide { grid-column:1 / -1; }
    .nrfi-pivot-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
    .nrfi-pivot-app { padding:12px; border-radius:10px; }
    .nrfi-pivot-header { align-items:stretch; flex-direction:column; }
    .nrfi-pivot-year-wrap { width:100%; }
    .nrfi-pivot-scope-tabs button { flex:1; padding:9px 8px; }
    .nrfi-pivot-toolbar,.nrfi-pivot-filter-grid { grid-template-columns:1fr; }
    .nrfi-pivot-control-wide { grid-column:auto; }
    .nrfi-pivot-actions { align-items:stretch; flex-direction:column; }
    .nrfi-pivot-action-buttons { width:100%; }
    .nrfi-pivot-action-buttons button { flex:1; }
    .nrfi-pivot-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

.nrfi-pivot-stat .value.yrfi { color:var(--nc-red); }
.nrfi-pivot-game-results td:first-child { font-weight:700; }
.nrfi-pivot-game-results td:nth-child(2) { text-align:left; }
.nrfi-pivot-matchup-team,.nrfi-pivot-winner { display:inline-flex; align-items:center; gap:6px; }
.nrfi-pivot-matchup-team + .nrfi-pivot-at { margin:0 7px; color:var(--nc-muted); font-weight:800; }
.nrfi-pivot-hand,.nrfi-pivot-subtext { color:var(--nc-muted); font-size:11px; }
.nrfi-pivot-subtext { display:block; margin-top:2px; }
.nrfi-pivot-score { font-weight:900; font-variant-numeric:tabular-nums; }
.nrfi-pivot-final-score { display:flex; flex-direction:column; gap:2px; text-align:left; font-size:12px; }
.nrfi-pivot-winner { font-weight:800; }

.nrfi-pivot-results-prompt { padding:22px; color:var(--nc-muted); text-align:center; background:#0e1727; }

.nrfi-pivot-primary { background:var(--nc-accent) !important; color:#08111f !important; border-color:var(--nc-accent) !important; }
.nrfi-pivot-primary:disabled { opacity:.55; cursor:not-allowed; }
.nrfi-pivot-show-games[hidden] { display:none !important; }
.nrfi-pivot-game-log-section { margin-top:18px; padding-top:16px; border-top:1px solid var(--nc-border); }
.nrfi-pivot-game-log-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.nrfi-pivot-game-log-head h3 { margin:2px 0 0; color:#fff; font-size:20px; }
.nrfi-pivot-game-log-kicker { color:var(--nc-accent); font-size:11px; font-weight:900; letter-spacing:.06em; text-transform:uppercase; }
.nrfi-pivot-game-log-message { color:var(--nc-muted); font-size:13px; margin:0 0 10px; }
.nrfi-pivot-game-log-message strong { color:var(--nc-text); }
@media (max-width: 620px) {
    .nrfi-pivot-game-log-head { align-items:stretch; flex-direction:column; }
    .nrfi-pivot-game-log-head button { width:100%; min-height:40px; }
}
