/* STATS_X_STATWORK_V1 — «Работа со статами» */
/* пока вид открыт, прячем то, что к нему не относится: выбор спота и учеников «Сравнения», срез по типу оппонента, деление пополам, винрейт */
#tab-compare:has(#swRoot) .cmp-row-blocks,
#tab-compare:has(#swRoot) .cmp-row:has(#cmpStudents),
#tab-compare:has(#swRoot) .stc-grid:has(.stats-opp-gran),
#tab-compare:has(#swRoot) #cmpOpp,
#tab-compare:has(#swRoot) #cmpOppNote,
#tab-compare:has(#swRoot) #cmpHalf,
#tab-compare:has(#swRoot) *:has(> #cmpHalf),
#tab-compare:has(#swRoot) .stc-grp:has(#cmpMetric),
#tab-compare:has(#swRoot) .stc-grp:has(#cmpRef),
#tab-compare:has(#swRoot) #cmpCoinWarn { display: none !important; }

.sw-wrap { color: #e8e2d4; font-size: 13px; line-height: 1.4; }
.sw-muted { color: var(--muted2, #8b8b8b); }
.sw-wrap small { color: var(--muted2, #8b8b8b); font-size: 11px; font-weight: 400; }

.sw-head { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line, #2a2a2a); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.sw-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sw-f > label { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted2, #8b8b8b); }
.sw-f-stat { flex: 1 1 380px; }
.sw-search { position: relative; }
.sw-search input { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, .06); color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-radius: 9px; padding: 8px 11px; font-size: 14px; }
.sw-search input:focus { outline: none; border-color: var(--gold-400, #e5b566); }
.sw-sug { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 420px; overflow: auto; padding: 8px 10px; border-radius: 10px; background: #1a1813; border: 1px solid #5a4d33; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.sw-sug-g { display: flex; flex-wrap: wrap; gap: 4px 5px; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sw-sug-g:last-child { border-bottom: 0; }
.sw-sug-g em { flex: 0 0 118px; font-style: normal; font-size: 11.5px; font-weight: 700; color: #fff; padding-left: 7px; border-left: 3px solid var(--tone, #888); }
.sw-sug-g button { background: rgba(255, 255, 255, .06); border: 1px solid transparent; border-radius: 7px; color: #e8e2d4; font-size: 12px; padding: 3px 8px; cursor: pointer; }
.sw-sug-g button:hover, .sw-sug-g button.on { border-color: var(--gold-400, #e5b566); color: #fff; }
.sw-sug-e { padding: 10px; color: var(--muted2, #8b8b8b); }
.sw-cur { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.sw-cur > b { font-size: 16px; color: #fff; padding-left: 9px; border-left: 4px solid var(--tone, #888); }
.sw-dir { display: inline-flex; gap: 4px; }
.sw-dir .stats-mode-btn { font-size: 11px; padding: 3px 8px; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--c); color: #fff; font-weight: 600; }
.sw-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sw-chip button { background: none; border: 0; color: var(--muted2, #8b8b8b); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; }
.sw-chip button:hover { color: #fff; }
.sw-num { width: 76px; background: rgba(255, 255, 255, .06); color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.sw-note { min-height: 16px; margin: 6px 2px; font-size: 12px; color: #ffb36b; }

.sw-prob { margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line, #2a2a2a); background: rgba(255, 255, 255, .02); }
.sw-prob > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.sw-pchip { border: 1px solid transparent; border-radius: 7px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: #fff; }
.sw-pchip em { font-style: normal; font-weight: 700; margin-left: 3px; }
.sw-pchip:hover, .sw-pchip.on { border-color: #fff; }

.sw-card { margin: 0 0 12px; padding: 12px 14px 14px; border-radius: 12px; border: 1px solid var(--line, #2a2a2a); background: rgba(255, 255, 255, .02); }
.sw-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--gold-400, #e5b566); }
.sw-card h4 { margin: 0 0 3px; font-size: 13.5px; color: #fff; }
.sw-sub { margin: 0 0 8px; font-size: 12px; color: #b9b2a0; max-width: 1050px; }

/* цвета отклонений: хуже / лучше (если задано направление), иначе выше / ниже */
.sw-t-bad { background: rgba(235, 90, 75, .30); }
.sw-t-good { background: rgba(80, 200, 90, .26); }
.sw-t-up { background: rgba(232, 176, 72, .28); }
.sw-t-down { background: rgba(70, 150, 230, .30); }
.sw-verd span[class^="sw-t-"], .sw-top span[class^="sw-t-"] { padding: 1px 6px; border-radius: 5px; color: #fff; font-weight: 600; }
.sw-t-ok { color: #8fd08a; font-weight: 600; }
.sw-up { color: #f0b860; } .sw-down { color: #6fb1f0; }

/* полоса: коридор, середина, точки */
.sw-strip { position: relative; height: 22px; border-radius: 5px; background: rgba(255, 255, 255, .035); min-width: 150px; }
.sw-strip.tall { height: 46px; margin: 0 0 10px; }
.sw-strip i { position: absolute; top: 50%; }
.sw-iqr { top: 3px !important; bottom: 3px; border-radius: 4px; background: rgba(229, 181, 102, .20); border: 1px solid rgba(229, 181, 102, .35); box-sizing: border-box; }
.sw-med { top: 0 !important; bottom: 0; width: 0; border-left: 2px solid var(--gold-400, #e5b566); }
.sw-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, .38); }
.sw-strip.tall .sw-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.sw-dot:hover { background: #fff; z-index: 3; }
.sw-mark { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c); border: 2px solid #14120e; box-sizing: border-box; z-index: 2; }
.sw-strip.tall .sw-mark { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.sw-mark.thin { background: transparent; border: 2px dashed var(--c); }
.sw-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted2, #8b8b8b); margin-bottom: 2px; }
.sw-verd { list-style: none; margin: 0; padding: 0; }
.sw-verd li { padding: 4px 0; font-size: 13.5px; }
.sw-verd li > i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.sw-big { font-size: 17px; color: #fff; }
.sw-hands { margin-left: 8px; background: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 7px; color: #e8e2d4; font-size: 11.5px; padding: 2px 9px; cursor: pointer; }
.sw-hands:hover { border-color: var(--gold-400, #e5b566); color: #fff; }

.sw-top { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: rgba(229, 181, 102, .07); border: 1px solid rgba(229, 181, 102, .22); }
.sw-top ul { margin: 6px 0 0; padding: 0; list-style: none; }
.sw-top li { padding: 2px 0; }
.sw-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--sw-col, 600px), 1fr)); gap: 18px 26px; }
.sw-dim { min-width: 0; overflow-x: auto; }
.sw-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sw-tbl th, .sw-tbl td { padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, .06); text-align: left; vertical-align: middle; white-space: nowrap; }
.sw-tbl thead th { font-size: 11px; font-weight: 600; color: var(--muted2, #8b8b8b); border-bottom: 1px solid rgba(255, 255, 255, .14); }
.sw-tbl tbody th { font-weight: 600; color: #fff; }
.sw-tbl .sw-v { text-align: center; }
.sw-tbl .sw-cor b { color: var(--gold-400, #e5b566); }
.sw-tbl .sw-st { width: 30%; min-width: 150px; }
.sw-stx { display: flex; justify-content: space-between; }
.sw-tbl .sw-ct { width: 110px; }
.sw-tbl .sw-n { text-align: right; color: var(--muted2, #8b8b8b); }
.sw-sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.sw-cell, .sw-cellv { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid transparent; border-radius: 7px; padding: 2px 7px; color: #fff; font-size: 13px; }
.sw-cell { cursor: pointer; }
button.sw-cell:not([class*='sw-t-']) { background: transparent; }
.sw-cell:hover { border-color: rgba(255, 255, 255, .5); }
.sw-cell em, .sw-cellv em { font-style: normal; font-size: 11px; font-weight: 700; }
.sw-cell small { font-size: 10.5px; }
.sw-cell.sw-thin { opacity: .45; }
.sw-sh em { font-style: normal; font-weight: 700; margin-left: 4px; font-size: 11.5px; }
.sw-bar { position: relative; display: inline-block; width: 64px; height: 10px; vertical-align: middle; margin-right: 5px; background: linear-gradient(to right, transparent 49.5%, rgba(255, 255, 255, .25) 49.5%, rgba(255, 255, 255, .25) 50.5%, transparent 50.5%); }
.sw-bar i { position: absolute; top: 1px; bottom: 1px; border-radius: 2px; }
.sw-b-bad { background: #e06b5f; } .sw-b-good { background: #67c04e; } .sw-b-up { background: #e8b048; } .sw-b-down { background: #4696e6; }

.sw-rel { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px 22px; }
.sw-tbl-rel tbody th button { background: none; border: 0; color: #e8e2d4; cursor: pointer; padding: 0; font: inherit; text-align: left; }
.sw-tbl-rel tbody th button:hover { color: var(--gold-400, #e5b566); text-decoration: underline; }
.sw-tbl-rel tr.out th button { color: #fff; font-weight: 700; }

.sw-svg { display: block; max-width: 100%; }
.sw-g { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.sw-ax { fill: #8b8b8b; font-size: 11px; }
.sw-yr { fill: #b9b2a0; }
.sw-band { fill: rgba(229, 181, 102, .16); stroke: none; }
.sw-medl { fill: none; stroke: #e5b566; stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .8; }
.sw-drill .sw-dbtns { margin: 6px 0 10px; }
.sw-drill .cmp-local { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }

.sw-t-okb { background: rgba(143, 208, 138, .16); }
.sw-fine { margin-top: 8px; color: #cfc8b4; }

#swRoot .sw-how { border-left: 2px solid var(--gold-300, #d8b45a); padding-left: 8px; }

/* STATWORK_WR_V1: крупное окно «показатель → винрейт» */
#swRoot [data-sw-wr] { cursor: pointer; }
#swRoot [data-sw-wr]:hover .sw-strip { outline: 1px solid var(--gold-300, #d8b45a); outline-offset: 1px; }
#swRoot .sw-wrhint { font-size: 11px; color: #8d8672; margin: 4px 0 2px; }
.sw-wr { position: fixed; inset: 0; z-index: 9200; background: rgba(0, 0, 0, .66); display: flex; align-items: flex-start; justify-content: center; padding: 28px 18px; overflow: auto; }
.sw-wr-box { width: min(1560px, 100%); background: #14130f; border: 1px solid #5a4d33; border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .7); padding: 14px 18px 18px; font-size: 12.5px; color: #d9d4c5; }
.sw-wr-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sw-wr-h b { display: block; font-size: 17px; color: #fff; }
.sw-wr-h span { color: #8d8672; font-size: 12px; }
.sw-wr-ctl { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sw-wr-ctl label { color: #8d8672; font-size: 11px; margin-right: 4px; }
.sw-wr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.sw-wr .sw-sub { color: #a8a290; font-size: 12px; line-height: 1.45; margin: 6px 0; max-width: 1100px; }
.sw-wr .sw-wr-word { font-size: 13.5px; color: #e9e4d4; }
.sw-wr .sw-muted { color: #7d7767; }
.sw-wr .sw-verd { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 13px; }
.sw-wr .sw-verd li { margin: 3px 0; }
.sw-wr .sw-verd i, .sw-wr-list th i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sw-wr .sw-svg { display: block; max-width: 100%; background: #100f0c; border: 1px solid #2b2820; border-radius: 10px; }
.sw-wr .sw-g { stroke: #2a2720; stroke-width: 1; } .sw-wr .sw-g.z { stroke: #6b6452; } .sw-wr .sw-g.v { stroke: #1f1d18; }
.sw-wr .sw-ax { fill: #8d8672; font-size: 11px; } .sw-wr .sw-axt { fill: #b9b29c; font-size: 12px; }
.sw-wr-zone { fill: rgba(141, 240, 127, .07); }
.sw-wr-dot { fill: #7d7a70; opacity: .5; } .sw-wr-dot.s { fill: #b9b29c; opacity: .75; }
.sw-wr-band { fill: rgba(229, 181, 102, .22); } .sw-wr-line { fill: none; stroke: #e5b566; stroke-width: 2.5; }
.sw-wr-err { stroke: #e9e4d4; stroke-width: 1.2; } .sw-wr-bin { fill: #14130f; stroke: #e9e4d4; stroke-width: 1.4; }
.sw-wr-mine { fill: #e5b566; stroke: #14130f; stroke-width: 1; }
.sw-wr-vl { stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .8; } .sw-wr-lab { font-size: 12px; font-weight: 600; }
.sw-wr-list { max-height: calc(100vh - 170px); overflow: auto; border-left: 1px solid #2b2820; padding-left: 14px; }
.sw-wr-list h4 { margin: 0 0 6px; font-size: 12.5px; color: #e5b566; }
.sw-wr-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sw-wr-list td, .sw-wr-list th { padding: 2.5px 4px; text-align: left; font-weight: 400; border-bottom: 1px solid #1f1d18; white-space: nowrap; }
.sw-wr-list thead th { color: #7d7767; font-size: 10.5px; white-space: normal; }
.sw-wr-list .v { text-align: right; color: #fff; font-weight: 600; } .sw-wr-list .n, .sw-wr-list .w { text-align: right; color: #8d8672; }
.sw-wr-list tr.f th { color: #fff; font-weight: 600; } .sw-wr-list tr.thin { opacity: .45; }
@media (max-width: 1100px) { .sw-wr-grid { grid-template-columns: 1fr; } .sw-wr-list { border-left: 0; padding-left: 0; max-height: none; } }

/* точный отбор раздач клетки */
.sw-drill .sw-rows { margin: 8px 0 10px; padding: 8px 10px; border: 1px solid #3a3426; border-radius: 8px; background: #14130f; }
.sw-drill .sw-rows .sw-dbtns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.sw-drill .sw-rnote { font-size: 11.5px; color: #8d8672; } .sw-drill .sw-rnote.bad { color: #ff8d80; }
.sw-drill .sw-muted { color: #8d8672; }
