/* Пул ставок — общий стиль. Учётная книга: сводка сверху, таблицы ниже, янтарный акцент. */
:root {
  --bg: #f4f3ee; --panel: #fffdf8; --sunk: #ecebe4; --line: #dcd9cf; --fg: #1e1d1a; --muted: #6c695f;
  --accent: #a8631a; --accent-ink: #fff; --accent-soft: #f3e3cf;
  --pos: #1d7a46; --neg: #b3352b; --warn-bg: #fbe4e1;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
  /* цвета участников в графиках (проверены на дальтонизм) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #151513; --panel: #1e1d1a; --sunk: #262521; --line: #36342f; --fg: #eeece5; --muted: #a29e93;
  --accent: #e0953f; --accent-ink: #1a1307; --accent-soft: #3a2a17; --pos: #5fc98a; --neg: #f07a6e; --warn-bg: #3a1d1a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; color-scheme: dark } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--body); }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 64px; display: grid; gap: 20px; }
h1 { font: 600 clamp(22px, 4vw, 30px)/1.1 var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font: 600 16px/1.3 var(--body); margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
[hidden] { display: none !important; }

header.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--sunk); color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile .k { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tile .v { font: 500 24px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.tile .s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile.accent { background: var(--accent-soft); border-color: transparent; }
.stakes { display: flex; flex-wrap: wrap; gap: 6px 14px; font-variant-numeric: tabular-nums; }
.stakes b { font: 500 20px/1.2 var(--display); } .stakes span { display: grid; }
.alert { background: var(--warn-bg); color: var(--neg); border-radius: var(--r); padding: 12px 16px; font-weight: 600; }

.tabs { display: flex; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }

form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; align-items: end; }
label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
label.f.wide { grid-column: span 2; }
@media (max-width: 520px) { label.f.wide { grid-column: auto; } }
input, select, textarea { font: inherit; font-size: 14px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { all: unset; cursor: pointer; padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; background: var(--sunk); color: var(--fg); text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 8px; } .btn.ghost:hover { color: var(--fg); }
.btn.danger { color: var(--neg); }
.chip { all: unset; cursor: pointer; font-size: 13px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); }

.tablebox { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
td.who { min-width: 180px; } td .sub { display: block; font-size: 12px; color: var(--muted); }
tr.open td { color: var(--muted); }
.mine { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
td input { padding: 6px 8px; } td input.pct { width: 72px; text-align: right; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--sunk); white-space: nowrap; }
.pill.won { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.pill.lost { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.pill.cash { background: var(--accent-soft); color: var(--accent); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); max-width: 72ch; margin: 0; }
.msg { font-size: 13px; min-height: 1em; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 12px rgb(0 0 0 / .12); }

/* аналитика */
h2.sec { font: 600 15px/1.3 var(--display); margin: 8px 0 -4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut { position: relative; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; }
.donut svg { width: 180px; height: 180px; display: block; overflow: visible; }
.donut .c1 { font: 500 15px var(--display); fill: var(--fg); font-variant-numeric: tabular-nums; }
.donut .c2 { font: 11px var(--body); fill: var(--muted); }
.donut .seg { transition: opacity .15s; cursor: default; } .donut .seg.dim { opacity: .3; }
@media (max-width: 440px) { .donut { grid-template-columns: 1fr; justify-items: center; } }
.legend { display: grid; gap: 2px; font-size: 13px; width: 100%; }
.legend .li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 5px 8px; border-radius: 6px; transition: opacity .15s; }
.legend .val { grid-column: 2; color: var(--muted); font-variant-numeric: tabular-nums; } .legend .val b { color: var(--fg); font-weight: 600; }
.legend .li:hover { background: var(--sunk); } .legend .li.dim { opacity: .4; }
.legend .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.grid-d { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
#a-kpi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin-bottom: 6px; }
.legend-row > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .dash { width: 16px; border-top: 2px dashed var(--fg); opacity: .7; }
.tip .tt { font-weight: 600; margin-bottom: 2px; }
.tip .tr { display: grid; grid-template-columns: 10px auto auto; gap: 6px; align-items: center; justify-content: start; }
.tip .tr .num { margin-left: 10px; } .tip .tr.strong { font-weight: 600; }
.chart .bar { transition: opacity .15s; } .chart .bar.hot { opacity: .75; }
.mcard .who-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mcard .who-head h2 { font: 600 16px/1.2 var(--display); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: 12px 16px; margin: 0; }
.kv > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font: 500 16px/1.25 var(--display); font-variant-numeric: tabular-nums; }
.kv dd small { display: block; font: 12px/1.3 var(--body); color: var(--muted); }
.mini-weeks { font-size: 13px; } .mini-weeks td, .mini-weeks th { padding: 5px 8px; }
