/* ============ Design tokens ============ */
:root {
  --brand: #0b7a4b;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --surface-3: #e3e9e6;
  --text: #13201a;
  --muted: #5b6a63;
  --border: #dde4e0;
  --accent: #0b8a55;
  --accent-ink: #ffffff;
  --accent-soft: #dcf3e7;
  --accent-text: #08683f;
  --blue: #2f6fb3;
  --blue-soft: #e1ecf8;
  --warn: #a75f00;
  --warn-soft: #fff0d4;
  --bad: #c42f3a;
  --bad-soft: #fde4e6;
  --pitch: #1d7d46;
  --pitch-2: #1a7140;
  --pitch-line: rgba(255,255,255,.28);
  --good-1: #c8eed9; --good-2: #8fdcb3; --mid: #e9ecea; --bad-1: #f8d5d2; --bad-2: #f0a9a3;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,32,24,.05), 0 4px 14px rgba(16,32,24,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.22);
  --focus: 0 0 0 3px rgba(11,138,85,.35);
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c110f; --surface: #151c19; --surface-2: #1c2521; --surface-3: #25302b; --text: #e7eeea; --muted: #97a59e;
    --border: #28332e; --accent: #26c487; --accent-ink: #04241a; --accent-soft: #14382a; --accent-text: #4fdca3;
    --blue: #6aa7e8; --blue-soft: #18283a;
    --warn: #f2b54f; --warn-soft: #3a2c12; --bad: #ff6f78; --bad-soft: #3d1a1d;
    --pitch: #166339; --pitch-2: #145a34; --good-1: #1d4a33; --good-2: #25774c; --mid: #232c28; --bad-1: #4a2724; --bad-2: #7a3530;
    --shadow: none; --focus: 0 0 0 3px rgba(38,196,135,.45);
  }
}
:root[data-theme="dark"] {
  --bg: #0c110f; --surface: #151c19; --surface-2: #1c2521; --surface-3: #25302b; --text: #e7eeea; --muted: #97a59e;
  --border: #28332e; --accent: #26c487; --accent-ink: #04241a; --accent-soft: #14382a; --accent-text: #4fdca3;
  --blue: #6aa7e8; --blue-soft: #18283a;
  --warn: #f2b54f; --warn-soft: #3a2c12; --bad: #ff6f78; --bad-soft: #3d1a1d;
  --pitch: #166339; --pitch-2: #145a34; --good-1: #1d4a33; --good-2: #25774c; --mid: #232c28; --bad-1: #4a2724; --bad-2: #7a3530;
  --shadow: none; --focus: 0 0 0 3px rgba(38,196,135,.45);
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--accent-text); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { top: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 20px 32px; flex: 1; outline: none; }

/* ============ Header & navigation ============ */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16.5px; color: var(--text); text-decoration: none; white-space: nowrap; letter-spacing: -.01em; }
.tabs { display: flex; gap: 2px; height: 100%; margin: 0 auto 0 8px; }
.tabs button { display: flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0 12px; color: var(--muted); font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; position: relative; border-radius: 0; }
.tabs button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent-text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
.deadline { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: 12px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.deadline b { color: var(--text); font-size: 13px; }
.deadline .cd { color: var(--accent-text); font-weight: 700; }
.deadline.soon .cd { color: var(--bad); }

/* ============ Page structure ============ */
.page-head { margin: 4px 0 16px; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 760px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.section-head h2 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }
.grid2 > *, .grid4 > * { min-width: 0; }
.footnote { color: var(--muted); font-size: 13px; margin-top: 16px; max-width: 820px; }
.count-line { margin: 0 2px 8px; }
.site-foot { border-top: 1px solid var(--border); padding: 18px 20px 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
.site-foot p { max-width: 760px; margin: 0 auto 6px; }

/* ============ Form controls ============ */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 16px; }
.toolbar.tight { margin: 14px 0 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow, label.grow { flex: 1 1 200px; }
.field.narrow input, .field.narrow select { width: 120px; }
.field-l { font-size: 12.5px; color: var(--muted); font-weight: 650; }
label { color: var(--muted); font-size: 12.5px; font-weight: 650; }
input, select { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; height: 42px; min-width: 0; width: 100%; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23778' stroke-width='1.8' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
.toolbar select { width: auto; min-width: 130px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.check { display: inline-flex; align-items: center; gap: 8px; height: 42px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: flex-end; }
.wrap { flex-wrap: wrap; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { font: inherit; font-size: 14px; font-weight: 650; border: 0; background: transparent; color: var(--muted); padding: 0 14px; height: 34px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.sm button { height: 30px; padding: 0 11px; font-size: 13px; }

.btn { font: inherit; font-weight: 700; font-size: 15px; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 10px; padding: 0 18px; height: 42px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 8px; }
.x:hover { color: var(--bad); background: var(--bad-soft); }

/* ============ Loading ============ */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 90px 16px; color: var(--muted); text-align: center; }
.loading #loading-msg { color: var(--text); font-weight: 600; }
.progress { width: min(320px, 80vw); height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 5%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.inline-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 36px 0; color: var(--muted); }
.inline-loading .spinner { width: 24px; height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ============ Welcome / onboarding ============ */
.welcome { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; background: linear-gradient(135deg, var(--brand), #0f5f3d); color: #fff; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.welcome h2 { margin: 0 0 4px; font-size: 20px; }
.welcome p { color: rgba(255,255,255,.85); margin: 0 0 8px; }
.welcome ol { margin: 0; padding-left: 20px; color: rgba(255,255,255,.92); }
.welcome li { margin: 3px 0; }
.welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome .btn { background: #fff; color: #0b5c38; }
.welcome .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.onboard { max-width: 620px; margin: 8px auto 20px; padding: 26px; }
.onboard h2 { font-size: 20px; margin-bottom: 4px; }
.onboard form { margin: 16px 0 6px; }
.onboard form .btn { flex: none; }
.hint summary { color: var(--accent-text); font-size: 14px; font-weight: 600; margin-top: 8px; cursor: pointer; }
.hint ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.onboard #build-manual { width: 100%; }

/* ============ Stats / hero ============ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.hero { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.hero .big { grid-row: span 2; text-align: center; padding-right: 22px; border-right: 1px solid var(--border); }
.hero .big b { display: block; font-size: 34px; line-height: 1; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.hero .big span { font-size: 12.5px; color: var(--muted); }
.hero .facts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hero .facts div { font-size: 13px; color: var(--muted); }
.hero .facts b { display: block; color: var(--text); font-size: 15px; }
.hero .note { font-size: 13px; color: var(--muted); }

.best-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.best-side .section-head { margin-top: 0; }
.best-side { position: sticky; top: 76px; }
@media (max-width: 1000px) { .best-grid { grid-template-columns: minmax(0, 1fr); } .best-side { position: static; } .best-side .section-head { margin-top: 24px; } }

/* ============ Pitch ============ */
.advice-sec .pitch, .advice-sec .bench, #wc-box .pitch, #wc-box .bench { max-width: 760px; margin-left: auto; margin-right: auto; }
.pitch { background: var(--pitch); background-image: repeating-linear-gradient(0deg, var(--pitch) 0 54px, var(--pitch-2) 54px 108px); border-radius: var(--radius); padding: 18px 8px 14px; position: relative; overflow: hidden; }
.pitch::before { content: ""; position: absolute; left: 50%; top: -64px; width: 170px; height: 124px; transform: translateX(-50%); border: 2px solid var(--pitch-line); border-radius: 50%; }
.pitch::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 40px; border: 2px solid var(--pitch-line); border-bottom: 0; }
.prow { display: flex; justify-content: center; gap: 10px; margin: 12px 0; position: relative; z-index: 1; }
.bench { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 8px 4px; margin-top: 10px; }
.bench .lbl { font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 0 0 2px 8px; }
.bench .prow { margin: 8px 0; }
.pc { width: 108px; background: var(--surface); color: var(--text); border-radius: 10px; padding: 7px 6px 8px; text-align: center; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; transition: transform .12s ease; border: 0; font: inherit; }
.pc:hover { transform: translateY(-2px); }
.pc .nm { font-weight: 750; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .fx { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .xp { margin: 5px auto 0; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent-text); border-radius: 6px; font-size: 13px; padding: 1px 0; }
.pc .pr { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pc .badge { position: absolute; top: -8px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--surface); font-size: 11.5px; font-weight: 800; line-height: 22px; box-shadow: 0 0 0 2px var(--surface); }
.pc .badge.v { background: var(--muted); }
.flag { position: absolute; top: -8px; left: -7px; width: 20px; height: 20px; border-radius: 50%; font-size: 11.5px; font-weight: 800; line-height: 20px; background: var(--warn); color: #fff; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.flag.out { background: var(--bad); }
.flag.inline { position: static; display: inline-block; vertical-align: middle; box-shadow: none; }
.pc.in { box-shadow: 0 0 0 3px var(--accent), 0 2px 6px rgba(0,0,0,.25); }
.pc.out { box-shadow: 0 0 0 3px var(--bad), 0 2px 6px rgba(0,0,0,.25); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 10px 2px 4px; align-items: center; }
.legend-row .k { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: var(--surface); background: var(--text); margin-right: 5px; vertical-align: -4px; }
.legend-row .k.v { background: var(--muted); } .legend-row .k.w, .legend-row .k.n { color: #fff; } .legend-row .k.w { background: var(--warn); } .legend-row .k.n { background: var(--accent); }

/* ============ Lists & tables ============ */
.list-card { padding: 4px 0; }
.prow-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.prow-item:last-child { border-bottom: 0; }
.prow-item:hover { background: var(--surface-2); }
.prow-item .rk { color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; }
.prow-item .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-item .who span { font-size: 12.5px; color: var(--muted); }
.prow-item .price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pts { font-weight: 800; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent-text); border-radius: 7px; padding: 3px 8px; min-width: 46px; text-align: center; display: inline-block; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
table.data th { font-size: 12.5px; color: var(--muted); font-weight: 650; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th.sorted { color: var(--accent-text); }
table.data th.sorted::after { content: " ▼"; font-size: 9px; }
table.data th.sorted.asc::after { content: " ▲"; }
table.data td.n, table.data th.n { text-align: right; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr[data-pid] { cursor: pointer; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.sticky-first th:first-child, table.sticky-first td:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--border); }
table.sticky-first th:first-child { z-index: 3; }
.card > table.data, .card > .table-wrap { box-shadow: none; }
/* Tables inside an open/close box run edge to edge */
.flush-table { --pad: 18px; }
.flush-table > .table-wrap { margin: 0 calc(-1 * var(--pad)); border-radius: 0; border-left: 0; border-right: 0; }
.flush-table > .table-wrap:last-child { margin-bottom: calc(-1 * var(--pad)); border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.p-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 14px; }
.p-more:empty { display: none; }
#p-box > summary { flex-wrap: wrap; row-gap: 2px; }
.card:has(> table.data) { overflow-x: auto; }
.chip { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 650; margin-right: 3px; color: var(--text); }
.f5 { background: var(--good-2); } .f4 { background: var(--good-1); } .f3 { background: var(--mid); } .f2 { background: var(--bad-1); } .f1 { background: var(--bad-2); }
.fdr td { text-align: center; font-size: 12.5px; }
.fdr td:first-child { text-align: left; font-weight: 650; }
.fdr .chip { display: block; margin: 1px 0; padding: 3px 6px; }
.pos-tag { font-size: 12px; color: var(--muted); font-weight: 600; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.good { color: var(--accent-text); }

/* ============ My team ============ */
.team-bar { padding-bottom: 14px; }
.team-bar-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.team-name { font-size: 19px; font-weight: 800; }
.team-proj { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 14px 0 0; }
.team-proj .tp { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.team-proj .tp b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-proj .tp span { font-size: 12px; color: var(--muted); }
.team-proj .tp.main { background: var(--accent-soft); flex-direction: row; align-items: baseline; gap: 8px; padding-right: 18px; }
.team-proj .tp.main b { font-size: 30px; color: var(--accent-text); }
.team-proj .tp.main span { color: var(--accent-text); font-weight: 650; font-size: 13px; }
.team-proj.pending { align-items: center; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--muted); }
.team-proj.pending b { font-size: 18px; color: var(--text); }
.tp-note { margin: 6px 2px 0; }
.collapsible > summary { display: flex; align-items: baseline; gap: 10px; list-style: none; cursor: pointer; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary h2 { margin: 0; }
.collapsible > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); align-self: center; transition: transform .15s; }
.collapsible[open] > summary::after { transform: rotate(-135deg); }
.collapsible[open] > summary { margin-bottom: 12px; }
.squad-group { margin-top: 6px; }
.squad-group h4 { margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.add-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.add-bar .grow { flex: 1 1 240px; }
.add-results { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.add-row:last-child { border-bottom: 0; }
.add-row:hover { background: var(--surface-2); }
.add-row .who { cursor: pointer; min-width: 0; }
.add-row .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-row .who span { font-size: 12.5px; color: var(--muted); }
.add-row .who em { display: block; font-size: 12px; font-style: normal; color: var(--warn, var(--bad)); font-weight: 650; }
.add-row.blocked .who b, .add-row.blocked .pts { opacity: .55; }
.add-row .btn { min-width: 68px; }
.sq { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.sq:last-child { border-bottom: 0; }
.sq .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq .who span { font-size: 12.5px; color: var(--muted); }
.sq .price { font-size: 13px; color: var(--muted); }
.alerts { border-left: 4px solid var(--warn); }
.alerts ul { margin: 6px 0 0; padding-left: 18px; }
.alerts li { margin: 4px 0; }

.verdict { border-left: 5px solid var(--accent); }
.verdict.roll { border-left-color: var(--blue); }
.verdict .eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.verdict .big { font-size: 22px; font-weight: 800; margin-bottom: 8px; line-height: 1.25; }
.verdict .why { color: var(--muted); margin: 8px 0 0; }
.verdict.alt { border-left-color: var(--warn, #d9a400); }
.verdict.done { border-left-color: var(--accent); background: var(--accent-soft); }
.adv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.adv-off { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.adv-off .adv-actions { margin-top: 0; }
.gain-pill.neg { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 760px) { .adv-actions .btn { flex: 1 1 auto; } }
.move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.move .o, .move .i { padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.move .o { background: var(--bad-soft); }
.move .i { background: var(--accent-soft); }
.move .arrow { color: var(--muted); font-weight: 700; }
.gain-pill { display: inline-block; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; border-radius: 999px; padding: 3px 11px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 8px; }
.opt { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.opt.best { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.opt .t { font-weight: 700; font-size: 14px; }
.opt .net { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.opt .net.good { color: var(--accent-text); } .opt .net.bad { color: var(--bad); }
.swap { font-size: 13.5px; margin: 6px 0 0; line-height: 1.5; }
.swap .o { color: var(--bad); text-decoration: line-through; }
.swap .i { color: var(--text); font-weight: 700; }
.advice-sec { margin-top: 26px; }
.advice-sec > h2 { margin-bottom: 4px; }
.advice-sec > p.muted { margin-bottom: 12px; }
.summary-line { font-size: 15px; margin: 0 0 12px; }

/* ============ Fixtures ============ */
.fix-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 6px; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager select { width: auto; min-width: 200px; font-weight: 700; }
#fdr-box { margin-bottom: 18px; }
.fix-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.fix-side { position: sticky; top: 76px; }
.fix-side:empty { display: none; }
.fix-grid:has(.fix-side:empty) { grid-template-columns: 1fr; }
.fix-side .card { margin-bottom: 12px; }
@media (max-width: 1000px) {
  .fix-grid { grid-template-columns: 1fr; gap: 0; }
  .fix-side { position: static; margin-top: 6px; }
}
#fdr-box > summary h2 { font-size: 17px; }
.fix-day { font-size: 13px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 8px; }
.far-note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin: 10px 0 0; }
.mlist { padding: 0; overflow: hidden; margin-bottom: 0; }
.mrow { border-bottom: 1px solid var(--border); }
.mrow:last-child { border-bottom: 0; }
.mrow > summary, .mrow.done { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto minmax(0, 1fr) 16px; align-items: center; gap: 4px 12px; padding: 13px 16px 11px; }
.mrow > summary { list-style: none; cursor: pointer; }
.mrow > summary::-webkit-details-marker { display: none; }
.mrow > summary:hover { background: var(--surface-2); }
.mrow > summary:focus-visible { outline: none; box-shadow: inset var(--focus); }
.mrow[open] > summary { background: var(--surface-2); }
.mt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh, .ma { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mh { justify-content: flex-end; }
.mh .nm, .ma .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wp { flex: none; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 7px; border-radius: 7px; background: var(--surface-3); color: var(--text); }
.wp.h.fav { background: var(--accent); color: var(--accent-ink); }
.wp.a.fav { background: var(--blue); color: #fff; }
.ms.draw { display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 52px; padding: 3px 6px; background: transparent; }
.ms.draw small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mh .abbr, .ma .abbr { display: none; }
.ms { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; background: var(--surface-2); border-radius: 8px; padding: 4px 10px; min-width: 72px; }
.mrow[open] .ms { background: var(--surface); }
.ms.final { background: var(--text); color: var(--surface); }
.mx { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); justify-self: end; transition: transform .15s; }
.mrow.done .mx { visibility: hidden; }
.mrow[open] .mx { transform: rotate(-135deg); }
.mstrip { grid-column: 2 / 5; display: flex; gap: 2px; height: 4px; border-radius: 3px; overflow: hidden; margin-top: 6px; opacity: .85; }
.mstrip .ph { background: var(--accent); } .mstrip .pd { background: var(--surface-3); } .mstrip .pa { background: var(--blue); }
.mbody { padding: 4px 16px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.mbody .mverdict { margin: 10px 0 10px; font-size: 14.5px; }
.mbody .mstats div { background: var(--surface); }
@media (min-width: 761px) { .mbody .mstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mbody .scorers { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.probbar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; font-size: 12.5px; font-weight: 750; gap: 2px; }
.probbar i { font-style: normal; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.probbar .ph { background: var(--accent); color: var(--accent-ink); }
.probbar .pd { background: var(--surface-3); color: var(--text); }
.probbar .pa { background: var(--blue); color: #fff; }
.problbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.mstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 12px 0 4px; }
.mstats div { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; }
.mstats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.mstats span { font-size: 12px; color: var(--muted); }
.scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 13.5px; margin-top: 8px; }
.scorers h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 650; }
.scorers .r { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; }
.scorers .r span:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }
.odds-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.ft { font-size: 26px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.rank-list .r { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.rank-list .r:last-child { border-bottom: 0; }
.rank-list .r > span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ Injuries ============ */
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ncard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.ncard:hover { border-color: var(--muted); }
.ncard .top-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ncard .who b { font-size: 15.5px; }
.ncard .who span { display: block; font-size: 12.5px; color: var(--muted); }
.ncard .txt { font-size: 14px; }
.ncard .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.ncard .meta b { color: var(--text); }
.st { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.st-i { background: var(--bad-soft); color: var(--bad); }
.st-d { background: var(--warn-soft); color: var(--warn); }
.st-s { background: var(--bad-soft); color: var(--bad); }
.st-u { background: var(--surface-2); color: var(--muted); }
.mine { background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 750; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ============ Accuracy ============ */
.acc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.acc-card .q { font-weight: 700; margin-bottom: 4px; }
.acc-card .a { font-size: 24px; font-weight: 800; color: var(--accent-text); }
.acc-card p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
ol.method li { margin-bottom: 8px; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ============ Modals, toast, tooltip ============ */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; background: rgba(5,12,9,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.modal-box { background: var(--surface); color: var(--text); border-radius: 18px; max-width: 640px; width: 100%; padding: 22px; position: relative; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--text); background: var(--surface-3); }
.help-h { margin-top: 18px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.help-steps { padding-left: 20px; margin: 0; }
.help-steps li { margin: 6px 0; }
.glossary dt { font-weight: 700; margin-top: 12px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); }
.pm-head h2 { margin: 0 44px 4px 0; font-size: 22px; }
.pm-head .sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pm-head .sub span { background: var(--surface-2); border-radius: 7px; padding: 3px 9px; font-size: 13px; }
.pm-big { display: flex; align-items: center; gap: 14px; margin: 16px 0 4px; padding: 14px; background: var(--accent-soft); border-radius: 12px; }
.pm-big b { font-size: 34px; line-height: 1; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pm-big span { font-size: 14px; }
.pm-news { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 14px; }
.pm-sec { margin-top: 18px; }
.pm-sec h3 { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.hbar { display: grid; grid-template-columns: 150px 1fr 46px; gap: 10px; align-items: center; font-size: 14px; margin: 5px 0; }
.hbar .b { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .b i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .b i.neg { background: var(--bad); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.kv div { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.kv b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.kv span { font-size: 12.5px; color: var(--muted); }
.pm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.tip { position: fixed; z-index: 40; max-width: 300px; background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.msg-err { color: var(--bad); }
.msg-ok { color: var(--accent-text); }

/* ============ Tablet: compact header ============ */
@media (max-width: 1060px) {
  .tabs button { padding: 0 9px; font-size: 13.5px; }
  .tabs button svg { display: none; }
  .deadline { display: none; }
}

/* ============ Phones: bottom navigation ============ */
@media (max-width: 760px) {
  body { font-size: 15px; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  main { padding: 14px 14px 24px; }
  h1 { font-size: 22px; }
  /* a backdrop-filter would make the fixed bottom bar position itself inside the header */
  .top { backdrop-filter: none; background: var(--surface); }
  .top-in { padding: 0 14px; height: 54px; gap: 8px; }
  .brand span { font-size: 16px; }
  .deadline { display: flex; margin-left: auto; }
  .deadline .full { display: none; }
  .top-actions { margin-left: auto; gap: 4px; }
  .icon-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); margin: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 40; gap: 0; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .tabs button { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; font-size: 10.5px; min-width: 0; }
  .tabs button svg { display: block; width: 22px; height: 22px; }
  .tabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tabs button[aria-selected="true"]::after { top: 0; bottom: auto; left: 22%; right: 22%; border-radius: 0 0 3px 3px; }
  .page-head { margin-bottom: 14px; }
  .page-head p { font-size: 14px; }
  .toolbar { gap: 10px; }
  .toolbar .field { flex: 1 1 auto; }
  .toolbar select { min-width: 0; width: 100%; }
  .field.narrow input, .field.narrow select { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 0; padding: 0 6px; }
  .section-head .seg { width: auto; }
  .card { padding: 16px; }
  .flush-table { --pad: 16px; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero .big { grid-row: auto; border-right: 0; padding: 0 0 10px; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .hero .big b { display: inline; font-size: 30px; }
  .hero .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .hero .note { font-size: 12.5px; }
  .pitch { padding: 14px 4px 10px; }
  .prow { gap: 4px; margin: 9px 0; }
  .pc { width: calc((100vw - 60px) / 5); max-width: 76px; padding: 5px 2px 6px; border-radius: 8px; }
  .pc .nm { font-size: 11px; }
  .pc .fx { font-size: 9.5px; }
  .pc .xp { font-size: 11.5px; }
  .pc .pr { display: none; }
  .pc .badge { width: 19px; height: 19px; line-height: 19px; font-size: 10px; top: -7px; right: -5px; }
  .flag { width: 17px; height: 17px; line-height: 17px; font-size: 10px; top: -7px; left: -5px; }
  .grid2 { grid-template-columns: 1fr; }
  .news-list { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  table.data th, table.data td { padding: 8px 9px; font-size: 13.5px; }
  .hbar { grid-template-columns: 118px 1fr 40px; font-size: 13.5px; }
  .welcome { padding: 18px; }
  .onboard { padding: 20px; margin-top: 0; }
  .onboard form .btn { width: 100%; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: .4; } }
  .toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
  .site-foot { padding-bottom: 20px; }
  .pager select { flex: 1; min-width: 0; }
  .sq { grid-template-columns: minmax(0, 1fr) auto auto; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 8px 8px; }
  .stat .v { font-size: 18px; }
  .stat .l { font-size: 11px; line-height: 1.25; }
  .mrow > summary, .mrow.done { grid-template-columns: 46px minmax(0, 1fr) auto minmax(0, 1fr) 10px; gap: 4px 6px; padding: 12px 10px 10px; }
  .mt { font-size: 11.5px; }
  .mh, .ma { gap: 5px; }
  .wp { font-size: 12px; padding: 3px 5px; }
  .ms.draw { min-width: 38px; padding: 2px 0; font-size: 12px; }
  .ms.draw small { font-size: 9.5px; }
  .fix-bar { flex-wrap: wrap; }
  .fix-bar .pager { flex: 1 1 100%; }
  #fix-all { margin-left: auto; }
  .mh, .ma { font-size: 14.5px; }
  .ms { min-width: 64px; padding: 4px 6px; font-size: 14.5px; }
  .mbody { padding: 2px 12px 14px; }
  .add-row { padding: 9px 10px; gap: 8px; }
  .opt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .opt { padding: 10px 8px; }
  .opt .t { font-size: 12px; line-height: 1.25; min-height: 30px; }
  .opt .net { font-size: 19px; }
  .opt .small { font-size: 11.5px; }
  .swap { font-size: 12px; overflow-wrap: anywhere; }
  .team-bar .field.narrow { flex: 1 1 40%; }
  .team-proj { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .team-proj .tp.main { grid-column: 1 / -1; }
  .team-proj .tp { padding: 9px 12px; }
  .team-proj .tp b { font-size: 16px; }
  .team-proj.pending { display: flex; }
  .verdict .big { font-size: 20px; }
  .sq .price { display: none; }
}
@media (max-width: 430px) {
  .mh .full, .ma .full { display: none; }
  .mh .abbr, .ma .abbr { display: inline; }
  #fdr-box > summary > span { display: none; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
