/*
 * The ONE look of every filter panel's frame: TMB.filterPanel
 * (scripts/tmb-common.js). Matchup (matchup-filter-dock.js, mfd-), Player
 * Stats (ps-core.js, psb-), Player Search (player-search-stat-view.js, psv-)
 * and the dashboards that show them. A change here reaches every panel; a
 * page's own stylesheet styles only what its panel HOLDS (its rows), never
 * the frame. Loaded by every page that has a panel, before the page's own.
 */

/* ---- The column docked against a side ---- */
.tmb-fp {
    /* Ends at the top of the 40px fixed footer bar (front.css), not under it */
    position: fixed; top: var(--fp-top, 70px); bottom: 40px; width: var(--fp-w, 340px);
    z-index: 90; display: flex; flex-direction: column;
    background: var(--tmb-surface); box-shadow: 0 0 12px var(--tmb-black-10);
}
.tmb-fp[hidden] { display: none; }
.tmb-fp.tmb-fp-left { left: 0; border-right: 1px solid var(--tmb-gray-300); }
.tmb-fp.tmb-fp-right { right: 0; border-left: 1px solid var(--tmb-gray-300); }
.tmb-fp-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid var(--tmb-gray-300); background: var(--tmb-gray-100);
}
.tmb-fp-lhead { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.tmb-fp-title { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--tmb-gray-900); }
.tmb-fp-beta { padding: 1px 6px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: white; background: var(--tmb-purple); border-radius: 8px; }
.tmb-fp-btns { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.tmb-fp .tmb-fp-btn {
    width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: var(--tmb-gray-700); cursor: pointer; margin: 0; box-shadow: none;
    background: var(--tmb-surface) !important; border: 1px solid var(--tmb-gray-300); border-radius: 6px;
}
.tmb-fp .tmb-fp-btn:hover { color: var(--tmb-gray-900); border-color: var(--tmb-gray-400); }
.tmb-fp .tmb-fp-btn[aria-pressed="true"] { color: white; background: var(--tmb-switch-on) !important; border-color: var(--tmb-switch-on); }
/* A button a page puts in the head (Clear all, + Save) */
.tmb-fp .tmb-fp-hbtn {
    padding: 2px 9px; font-size: 0.72rem; line-height: 1.3; color: var(--tmb-gray-700); cursor: pointer; margin: 0; box-shadow: none;
    background: var(--tmb-surface) !important; border: 1px solid var(--tmb-gray-300); border-radius: 6px;
}
.tmb-fp .tmb-fp-hbtn:hover:not(:disabled) { border-color: var(--tmb-switch-on); color: var(--tmb-gray-900); }
.tmb-fp .tmb-fp-hbtn:disabled { opacity: 0.45; cursor: default; }

/* The count of filters set */
.tmb-fp-count { display: none; }
.tmb-fp-count.on {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
    font-size: 0.68rem; font-weight: 700; color: white; background: var(--tmb-switch-on); border-radius: 9px;
}

/* The body scrolls; its width is a container, so a wider panel can lay its rows side by side */
.tmb-fp-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 10px 72px; container-type: inline-size; container-name: tmbfp; }

/* Minimized: a thin bar that opens it again */
.tmb-fp .tmb-fp-bar {
    display: none; flex: 1 1 auto; width: 100%; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 10px; padding: 12px 0; font-size: 0.78rem; font-weight: 700; color: var(--tmb-gray-700); cursor: pointer; margin: 0;
    background: var(--tmb-gray-100) !important; border: none; border-radius: 0; box-shadow: none;
}
.tmb-fp .tmb-fp-bar:hover { color: var(--tmb-gray-900); background: var(--tmb-gray-300) !important; }
.tmb-fp-bar-text { writing-mode: vertical-rl; letter-spacing: 0.04em; }
.tmb-fp.tmb-fp-left .tmb-fp-bar-text { transform: rotate(180deg); }
.tmb-fp.tmb-fp-min .tmb-fp-head, .tmb-fp.tmb-fp-min .tmb-fp-body { display: none; }
.tmb-fp.tmb-fp-min .tmb-fp-bar { display: flex; }

/* ---- Phone: the sheet that slides up (opened by the page's #<prefix>-m-filters pill) ---- */
.tmb-fp-sheet { position: fixed; inset: 0; z-index: 100000; visibility: hidden; pointer-events: none; }
.tmb-fp-sheet-back { position: absolute; inset: 0; background: var(--tmb-black-45); opacity: 0; transition: opacity 0.25s ease; }
.tmb-fp-sheet-pane {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; display: flex; flex-direction: column;
    background: var(--tmb-surface); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px var(--tmb-black-20);
    transform: translateY(100%); transition: transform 0.28s ease;
}
.tmb-fp-sheet.open { visibility: visible; pointer-events: auto; }
.tmb-fp-sheet.open .tmb-fp-sheet-back { opacity: 1; }
.tmb-fp-sheet.open .tmb-fp-sheet-pane { transform: translateY(0); }
html.tmb-fp-noscroll { overflow: hidden; }
.tmb-fp-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--tmb-gray-300); }
.tmb-fp-sheet-title { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; font-weight: 700; color: var(--tmb-gray-900); }
.tmb-fp-sheet .tmb-fp-sheet-done {
    padding: 5px 16px; font-size: 0.85rem; font-weight: 700; color: white; border: 0; border-radius: 16px;
    background: var(--tmb-switch-on) !important; margin: 0 !important;
}
.tmb-fp-sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px 24px; -webkit-overflow-scrolling: touch; container-type: inline-size; container-name: tmbfp; }
.tmb-fp-mpill .tmb-fp-count.on { margin-left: 4px; }

/* ===== The rows: TMB.filterRows (tmb-common.js), every panel's ===== */
/* A row: its label above, its choice under it, any (i) or link beside the choice */
.tmb-fr { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; margin-bottom: 10px; }
.tmb-fr > .tmb-fr-label { flex: 0 0 100%; }
.tmb-fr > .tmb-fr-seg { flex: 0 1 auto; min-width: 0; }
.tmb-fr-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--tmb-gray-600); }
/* The segmented choice */
.tmb-fr-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--tmb-gray-100); border: 1px solid var(--tmb-gray-300); border-radius: 8px; }
/* doubled class + !important: front.css paints every button, and a site-wide button.active outranks a plain rule */
.tmb-fr-seg .tmb-fr-pill.tmb-fr-pill {
    margin: 0; padding: 3px 10px; font-size: 0.74rem; font-weight: 400; line-height: 1.3; color: var(--tmb-gray-900); cursor: pointer;
    border: none; border-radius: 6px; background: transparent !important; box-shadow: none;
}
.tmb-fr-seg .tmb-fr-pill.tmb-fr-pill:hover { background: var(--tmb-gray-300) !important; }
.tmb-fr-seg .tmb-fr-pill.tmb-fr-pill.active { background-color: var(--tmb-switch-on) !important; color: white !important; }
/* A choice that has nothing to show yet (After All-Star before the game is played) */
.tmb-fr-pill.tmb-fr-off { opacity: 0.45; cursor: not-allowed; }
.tmb-fr-i { color: var(--tmb-gray-500); font-size: 0.72rem; cursor: help; }
/* Two short rows on one line */
.tmb-fr-pair { display: flex; flex-wrap: wrap; gap: 0 10px; }
.tmb-fr-pair > .tmb-fr { flex: 0 0 auto; }
/* The Games slider */
.tmb-fr-slide { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.tmb-fr-slide .tmb-fr-range { flex: 1 1 auto; min-width: 120px; max-width: 320px; margin: 0; accent-color: var(--tmb-switch-on); cursor: pointer; }
.tmb-fr-slide .tmb-fr-range:disabled { opacity: 0.5; cursor: default; }
.tmb-fr-val { flex: 0 0 auto; font-size: 0.72rem; font-weight: 600; color: var(--tmb-gray-700); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Similar / Ranked: TMB.oppPanel (tmb-common.js), every panel's ===== */
.tmb-op { margin: -4px 0 12px; padding: 10px; background: var(--tmb-gray-100); border: 1px solid var(--tmb-gray-300); border-radius: 8px; }
.tmb-op .tmb-fr-seg { background: var(--tmb-surface); }
.tmb-op-title { margin-bottom: 6px; font-size: 0.78rem; font-weight: 700; color: var(--tmb-gray-900); }
.tmb-op-sub { margin-top: 6px; font-size: 0.7rem; line-height: 1.35; color: var(--tmb-gray-600); }
.tmb-op-warn { color: var(--tmb-red); }
.tmb-op-row { margin: 8px 0 0; }
.tmb-op-count { flex-wrap: nowrap; }
.tmb-op-count > .tmb-fr-label { flex: 0 0 auto; }
.tmb-op-count .tmb-fr-slide { flex: 1 1 auto; }
.tmb-op-count .tmb-fr-range { min-width: 100px; max-width: 260px; }
/* The stats ticked (Similar) */
.tmb-op-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tmb-op .tmb-op-chip {
    margin: 0; padding: 2px 8px; font-size: 0.72rem; line-height: 1.4; color: white; cursor: pointer; box-shadow: none;
    background: var(--tmb-switch-on) !important; border: none; border-radius: 10px;
}
.tmb-op .tmb-op-chip i { margin-left: 3px; font-size: 0.6rem; opacity: 0.85; }
/* The stats picked (Ranked), each with its own High / Low */
.tmb-op-rks { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.tmb-op-rk { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; font-size: 0.75rem; color: var(--tmb-navy-700); background: var(--tmb-blue-50); border: 1px solid var(--tmb-blue-200); border-radius: 8px; }
.tmb-op-rk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmb-op-rk .tmb-fr-seg { padding: 1px; }
.tmb-op .tmb-op-rk .tmb-fr-pill.tmb-fr-pill { padding: 1px 8px; font-size: 0.7rem; }
.tmb-op .tmb-op-x { margin: 0; padding: 0 2px; font-size: 0.65rem; color: var(--tmb-gray-600); cursor: pointer; background: none !important; border: 0; box-shadow: none; }
.tmb-op .tmb-op-x:hover { color: var(--tmb-red); }
/* The stat list: search, then a row a stat with 0, 1 or 2 teams' figures (place in rankcolor) */
.tmb-op .tmb-op-q { display: block; width: 100%; height: auto; margin: 6px 0 0; padding: 4px 8px; font-size: 0.76rem; color: var(--tmb-gray-900); background: var(--tmb-surface); border: 1px solid var(--tmb-gray-400); border-radius: 4px; box-shadow: none; }
.tmb-op-list { max-height: 260px; overflow-y: auto; margin-top: 6px; padding-right: 2px; background: var(--tmb-surface); border: 1px solid var(--tmb-gray-300); border-radius: 4px; padding: 2px 6px 4px; }
.tmb-op-lhead, .tmb-op-opt { display: grid; align-items: center; gap: 6px; }
.tmb-op-c0 .tmb-op-lhead, .tmb-op-c0 .tmb-op-opt { grid-template-columns: minmax(0, 1fr); }
.tmb-op-c1 .tmb-op-lhead, .tmb-op-c1 .tmb-op-opt { grid-template-columns: minmax(0, 1fr) 76px; }
.tmb-op-c2 .tmb-op-lhead, .tmb-op-c2 .tmb-op-opt { grid-template-columns: minmax(0, 1fr) 76px 76px; }
.tmb-op-list-rk.tmb-op-c0 .tmb-op-lhead, .tmb-op-list-rk.tmb-op-c0 .tmb-op-opt { grid-template-columns: minmax(0, 1fr) 68px; }
.tmb-op-list-rk.tmb-op-c1 .tmb-op-lhead, .tmb-op-list-rk.tmb-op-c1 .tmb-op-opt { grid-template-columns: minmax(0, 1fr) 64px 68px; }
.tmb-op-list-rk.tmb-op-c2 .tmb-op-lhead, .tmb-op-list-rk.tmb-op-c2 .tmb-op-opt { grid-template-columns: minmax(0, 1fr) 60px 60px 68px; gap: 4px; }
.tmb-op-lhead { position: sticky; top: 0; z-index: 1; padding: 2px 5px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: var(--tmb-gray-600); background: var(--tmb-surface); }
.tmb-op-lhead > span:not(:first-child) { text-align: center; }
.tmb-op-g { margin: 6px 0 2px; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; color: var(--tmb-gray-600); }
.tmb-op .tmb-op-opt { margin: 0 -5px; padding: 3px 5px; font-size: 0.74rem; font-weight: 400; color: var(--tmb-gray-900); border-radius: 4px; cursor: pointer; transition: background 0.12s; }
.tmb-op .tmb-op-opt:hover { background: color-mix(in srgb, var(--tmb-switch-on) 8%, transparent); }
.tmb-op .tmb-op-opt.on { font-weight: 600; background: color-mix(in srgb, var(--tmb-switch-on) 12%, transparent); }
.tmb-op-list-rk .tmb-op-opt { cursor: default; }
.tmb-op-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmb-op-name input { flex: 0 0 auto; margin: 0; accent-color: var(--tmb-switch-on); }
.tmb-op-v { padding: 1px 4px; font-size: 0.7rem; font-weight: 600; text-align: center; white-space: nowrap; border-radius: 4px; font-variant-numeric: tabular-nums; }
.tmb-op-v small { font-size: 0.62rem; font-weight: 500; opacity: 0.8; }
.tmb-op-none { color: var(--tmb-gray-500); font-weight: 400; }
.tmb-fr-seg.tmb-op-mini { justify-self: end; padding: 1px; }
.tmb-op .tmb-op-mini .tmb-fr-pill.tmb-fr-pill { padding: 0 5px; font-size: 0.6rem; line-height: 1.35; }
.tmb-op-result { margin-top: 8px; font-size: 0.72rem; line-height: 1.35; color: var(--tmb-gray-700); }
