    :root { --bg:#0f1419; --card:#1a2230; --line:#2a3547; --txt:#e6edf3; --muted:#8b98a9; --acc:#3fb950; --warn:#d29922; --exact:#3fb950; --outcome:#e3b341; --miss:#f85149; --away:#58a6ff; }
    * { box-sizing:border-box; }
    body { margin:0; font-family:system-ui,Segoe UI,Roboto,sans-serif; background:var(--bg); color:var(--txt); }
    header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--bg); z-index:5; }
    header h1 { font-size:18px; margin:0; flex:0 0 auto; }
    header .spacer { flex:1; }
    main { max-width:760px; margin:0 auto; padding:16px; }
    .card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:12px; }
    .row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .muted { color:var(--muted); font-size:13px; }
    .teams { font-weight:600; font-size:16px; }
    input { background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:8px 10px; width:100%; }
    input.score { width:56px; text-align:center; }
    button { background:var(--acc); color:#07210f; border:0; border-radius:8px; padding:8px 14px; font-weight:600; cursor:pointer; }
    button.ghost { background:transparent; color:var(--txt); border:1px solid var(--line); }
    button:disabled { opacity:.5; cursor:not-allowed; }
    .tag { font-size:12px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); }
    .tag.locked { color:var(--warn); border-color:var(--warn); }
    .tag.done { color:var(--acc); border-color:var(--acc); }
    .tag.open { color:var(--acc); border-color:var(--acc); }
    /* наближення старту матчу */
    .soon-h24 { color:#f85149; }   /* < 24 год */
    .soon-d3  { color:#f0883e; }   /* < 3 днів */
    .soon-d5  { color:#d29922; }   /* < 5 днів */
    .cd { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid currentColor; white-space:nowrap; }
    table { width:100%; border-collapse:collapse; }
    th,td { text-align:left; padding:8px; border-bottom:1px solid var(--line); }
    th { color:var(--muted); font-weight:600; font-size:13px; }
    th.sort-th { cursor:pointer; user-select:none; white-space:nowrap; }
    th.sort-th:hover { color:var(--txt); }
    td.num, th.num { text-align:center; }
    .tabs { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
    .tabs button { background:transparent; border:1px solid var(--line); color:var(--muted); }
    .tabs button.active { background:var(--acc); color:#07210f; border-color:var(--acc); }
    .filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
    .filters button { background:transparent; border:1px solid var(--line); color:var(--muted); font-weight:500; padding:6px 12px; }
    .filters button.active { background:var(--acc); color:#07210f; border-color:var(--acc); }
    .filters .cnt { opacity:.7; font-size:12px; }
    .stage-filters { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
    .stage-filters button { background:transparent; border:1px solid var(--line); color:var(--muted); font-weight:500; padding:5px 11px; font-size:13px; border-radius:8px; }
    .stage-filters button.active { background:rgba(63,185,80,.15); color:var(--acc); border-color:var(--acc); }
    .stage-label { font-size:11px; color:var(--muted); margin-bottom:5px; text-transform:uppercase; letter-spacing:.5px; }
    .toggle-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
    .toggle-row label { font-size:13px; color:var(--muted); cursor:pointer; user-select:none; }
    .toggle-switch { position:relative; width:34px; height:20px; flex-shrink:0; }
    .toggle-switch input { opacity:0; width:0; height:0; }
    .toggle-switch .slider { position:absolute; inset:0; border-radius:999px; background:var(--line); cursor:pointer; transition:background .2s; }
    .toggle-switch .slider:before { content:''; position:absolute; width:14px; height:14px; border-radius:50%; background:#fff; top:3px; left:3px; transition:transform .2s; }
    .toggle-switch input:checked + .slider { background:var(--acc); }
    .toggle-switch input:checked + .slider:before { transform:translateX(14px); }
    .err { color:#f85149; font-size:13px; }
    .pts { font-weight:700; }
    .pts.p3 { color:var(--exact); } .pts.p1 { color:var(--outcome); } .pts.p0 { color:var(--miss); }
    .others { margin-top:8px; font-size:13px; color:var(--muted); }
    .bet-line { padding:2px 0; }
    .bet-line.mine { font-weight:700; }
    .bet-line.exact { color:var(--exact); }
    .bet-line.outcome { color:var(--outcome); }
    .bet-line.miss { color:var(--miss); }
    .brk { margin-top:10px; }
    .brk-bar { display:flex; height:10px; border-radius:6px; overflow:hidden; background:#0d1117; border:1px solid var(--line); }
    .brk-bar span { display:block; height:100%; }
    .brk-bar .bh { background:var(--exact); }
    .brk-bar .bd { background:var(--muted); }
    .brk-bar .ba { background:var(--away); }
    .brk-leg { margin-top:6px; font-size:12px; }
    /* список гравців, які ще не зробили ставку (під матчем за <24 год до старту) */
    .pending { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); }
    .pending-head { font-size:12px; font-weight:600; color:var(--miss); letter-spacing:.02em; }
    .pending-names { margin-top:5px; display:flex; gap:6px; flex-wrap:wrap; }
    .pending-names .pn { font-size:13px; color:var(--miss); background:rgba(248,81,73,.10); border:1px solid rgba(248,81,73,.35); border-radius:999px; padding:2px 9px; }
    .pending.done .pending-head { color:var(--acc); }
    .rules h3 { margin:16px 0 6px; font-size:15px; }
    .rules p, .rules li { color:var(--txt); font-size:14px; line-height:1.55; }
    .rules ul { margin:6px 0; padding-left:20px; }
    .rules .ex { color:var(--muted); }
    .pill { display:inline-block; min-width:20px; text-align:center; font-weight:700; border-radius:6px; padding:0 6px; }
    .pill.p3 { background:rgba(63,185,80,.15); color:var(--exact); }
    .pill.p1 { background:rgba(227,179,65,.15); color:var(--outcome); }
    .pill.p0 { background:rgba(248,81,73,.15); color:var(--miss); }
    a { color:#58a6ff; }
    .legend { font-size:12px; color:var(--muted); margin-top:8px; display:flex; gap:14px; flex-wrap:wrap; }
    .legend .dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:5px; vertical-align:middle; }
    .rk { display:inline-block; min-width:22px; text-align:center; vertical-align:middle; }
    /* медалі за перші три місця */
    .rk.rk-gold, .rk.rk-silver, .rk.rk-bronze {
      min-width:22px; height:22px; line-height:22px; text-align:center;
      border-radius:50%; font-weight:800; font-size:12px;
    }
    .rk.rk-gold   { background:linear-gradient(145deg,#ffe7a0,#f2b705); color:#3a2a00; box-shadow:0 0 0 1px rgba(242,183,5,.45); }
    .rk.rk-silver { background:linear-gradient(145deg,#eef1f5,#b9c2cc); color:#26323f; box-shadow:0 0 0 1px rgba(185,194,204,.45); }
    .rk.rk-bronze { background:linear-gradient(145deg,#e9b489,#c07b3e); color:#3a1c05; box-shadow:0 0 0 1px rgba(192,123,62,.45); }
    .mv { display:inline-block; min-width:26px; text-align:center; vertical-align:middle; font-size:11px; font-weight:700; margin-left:6px; white-space:nowrap; }
    .mv-up { color:var(--exact); }
    .mv-down { color:var(--miss); }
    .mv-same { color:var(--muted); font-weight:600; }
    .mv-new { color:var(--muted); }
    .mvbar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
    .mvbar-label { font-size:12px; color:var(--muted); margin-right:2px; }
    .seg { font-size:12px; padding:4px 10px; border-radius:999px; border:1px solid var(--line); background:transparent; color:var(--muted); cursor:pointer; }
    .seg.on { background:var(--acc); border-color:var(--acc); color:#06210d; font-weight:600; }
    /* підсвічування власного рядка в таблиці */
    tr.me-row td { background:rgba(63,185,80,.10); }
    tr.me-row td:first-child { box-shadow:inset 3px 0 0 var(--acc); }
    tr.me-row td:nth-child(2) { font-weight:700; color:var(--acc); }
    /* перемикач таблиці (загальна / групи) */
    .scopebar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
    .scopebar-label { font-size:12px; color:var(--muted); margin-right:2px; }
    /* групи */
    .grp { border:1px solid var(--line); border-radius:10px; padding:12px; margin-bottom:10px; background:#0d1117; }
    .grp-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .grp-name { font-weight:600; font-size:15px; }
    .grp-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
    button.sm { padding:5px 10px; font-size:13px; }
    button.danger { background:transparent; color:var(--miss); border:1px solid var(--miss); }
    .badge { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); }
    .badge.owner { color:var(--warn); border-color:var(--warn); }
    .badge.member { color:var(--acc); border-color:var(--acc); }
    .badge.default { color:var(--away); border-color:var(--away); }
    .members { margin-top:10px; }
    .member { display:flex; align-items:center; gap:8px; padding:6px 0; border-top:1px solid var(--line); font-size:14px; }
    .member .mname { flex:1; }
    /* адмінка */
    .adm-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
    .adm-row:last-child { border-bottom:0; }
    .switch { min-width:118px; }
    .switch.on { background:var(--acc); color:#06210d; border-color:var(--acc); }
    .switch.off { background:transparent; color:var(--muted); border:1px solid var(--line); }
    .team-row { display:flex; align-items:center; gap:8px; padding:6px 0; border-top:1px solid var(--line); }
    .team-row .tn { flex:1; }
    .team-row input { width:84px; text-align:center; }
    .saved { color:var(--acc); font-size:12px; min-width:64px; }
    /* контакт для відновлення доступу */
    .contact { margin-top:10px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:#0d1117; font-size:14px; line-height:1.5; }
    .contact a { color:var(--acc); text-decoration:none; }
    .contact a:hover { text-decoration:underline; }
    /* список користувачів в адмінці */
    .user-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--line); }
    .user-row .ui { flex:1; min-width:0; }
    .user-row .un { font-weight:600; }
    .user-row.blocked .un { color:var(--miss); }
    .user-row .ustat { font-size:12px; color:var(--muted); margin-top:2px; }
    .pill-blocked { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--miss); color:var(--miss); }
    /* рейтинг та коефіцієнти на картці матчу */
    .rank { font-size:12px; color:var(--away); font-weight:600; }
    .odds { margin-top:8px; font-size:13px; color:var(--muted); }
    .odds b { color:var(--txt); }
    /* live-рахунок під час матчу */
    .live-score { margin-top:8px; font-size:14px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .live-badge { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; background:rgba(248,81,73,.15); border:1px solid var(--miss); color:var(--miss); letter-spacing:.04em; animation:live-pulse 1.4s ease-in-out infinite; }
    @keyframes live-pulse { 0%,100%{opacity:1} 50%{opacity:.45} }
    .live-score-form { display:none; margin-top:8px; }
    .live-score-form .row { flex-wrap:wrap; gap:8px; }
    /* live-режим: мітка в таблиці та дельта очок */
    .live-mode-badge { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; background:rgba(248,81,73,.15); border:1px solid var(--miss); color:var(--miss); margin-left:8px; vertical-align:middle; }
    .toggle-row.live-toggle label { color:var(--txt); }
    .live-delta { font-size:11px; font-weight:700; color:var(--miss); margin-left:3px; vertical-align:middle; opacity:.9; }
    /* роздільник між «моєю ставкою» та списком усіх учасників */
    .others-head { border-top:1px solid var(--line); margin-top:10px; padding-top:8px; font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
    /* вкладка «Улюблені» */
    .fav-mine { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:space-between; }
    .fav-team { color:var(--txt); }
    .fav-row { border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; background:#0d1117; }
    .fav-head { display:flex; align-items:center; gap:10px; cursor:pointer; }
    .fav-name { flex:1; font-weight:600; }
    .fav-chev { color:var(--muted); transition:transform .15s ease; }
    .fav-row.open .fav-chev { transform:rotate(90deg); }
    .fav-hist { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); font-size:13px; }
    .fav-hist .h-item { padding:3px 0; color:var(--txt); }
    .fav-hist .h-when { color:var(--muted); }
    /* модалка вибору улюбленої команди */
    .modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.62); display:flex; align-items:center; justify-content:center; z-index:50; padding:16px; }
    .modal { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:18px; width:100%; max-width:420px; }
    .modal h2 { margin:0 0 6px; font-size:18px; }
    .modal .modal-sub { margin:0 0 12px; }
    .modal-actions { display:flex; gap:8px; margin-top:14px; }
    select.fav-select { width:100%; background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:10px; font-size:15px; }
    /* картка прогнозу фіналістів (над матчами) */
    .finalist-card { border-color:rgba(242,183,5,.45); background:linear-gradient(180deg,rgba(242,183,5,.06),transparent 60%),var(--card); }
    .finalist-card .fc-head { font-weight:700; font-size:15px; margin-bottom:10px; }
    .finalist-card .fc-sub { font-weight:400; color:var(--muted); font-size:13px; }
    .finalist-card .fc-grid { display:flex; align-items:flex-end; gap:10px; }
    .finalist-card .fc-side { flex:1; min-width:0; }
    .finalist-card .fc-side label { display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
    .finalist-card .fc-vs { font-size:18px; padding-bottom:8px; }
    .finalist-card .fc-foot { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; }
    .finalist-card .fc-pick { font-size:16px; font-weight:600; margin-bottom:8px; }
    .finalist-card .fc-msg { font-size:13px; }
    .finalist-card .fc-msg.ok { color:var(--acc); }
    .finalist-card .fc-msg.err { color:var(--miss); }
    .finalist-card .fc-rules { font-size:13px; margin-top:10px; }
    .finalist-card .fc-points { font-size:14px; margin:6px 0; }
    .finalist-card .fc-hit { color:var(--exact); font-weight:600; font-size:13px; }
    .finalist-card .fc-miss-tag { color:var(--miss); font-weight:600; font-size:13px; }
    .board-bonus { display:inline-block; margin-left:5px; font-size:11px; font-weight:700; color:var(--outcome); white-space:nowrap; }
    /* вкладка «Фіналісти» */
    .fin-row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; background:#0d1117; }
    .fin-row-missing { border-color:rgba(248,81,73,.35); }
    .fin-name { font-weight:600; }
    .fin-no { color:var(--miss); font-weight:600; font-size:13px; }
    .fin-yes { color:var(--acc); font-weight:600; font-size:13px; }
    .fin-pick { font-weight:600; }
    .fin-open { color:var(--acc); font-weight:600; }
    /* підсвічування збірної за станом у турнірі */
    .fin-team.t-alive { color:var(--txt); }                     /* ще бере участь — білий */
    .fin-team.t-elim  { color:var(--miss); }                    /* вилетіла — червоний */
    .fin-team.t-final { color:var(--away); font-weight:700; }   /* вийшла у фінал — синій */
    .fin-team.t-champ { color:var(--exact); font-weight:700; }  /* чемпіон — зелений */
    .fin-legend { font-size:12px; color:var(--muted); display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; }
    .fin-legend i { font-style:normal; margin-right:4px; }
    @media (max-width:480px){ .finalist-card .fc-grid { flex-direction:column; align-items:stretch; } .finalist-card .fc-vs { text-align:center; padding:2px 0; } }
    /* модалка зворотного зв'язку */
    textarea.fb-text { width:100%; background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:10px; font-size:15px; font-family:inherit; resize:vertical; min-height:96px; }
    input.fb-contact { margin-top:10px; }
    .ok { color:var(--acc); font-size:13px; }
    /* ── Новини ── */
    .tab-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--miss); margin-left:5px; vertical-align:middle; }
    .news-day { font-size:13px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin:18px 0 8px; }
    .news-day:first-child { margin-top:2px; }
    .news-item { border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:10px; background:var(--card); }
    .news-item.imp { border-color:var(--outcome); box-shadow:inset 3px 0 0 var(--outcome); }
    .news-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .news-title { font-weight:700; }
    .news-time { font-size:12px; margin-left:auto; white-space:nowrap; }
    .news-body { margin-top:6px; color:var(--txt); line-height:1.5; white-space:pre-wrap; word-break:break-word; }
    .news-edited { font-size:11px; color:var(--muted); margin-top:6px; }
    .nc { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; white-space:nowrap; }
    .nc-added   { background:rgba(63,185,80,.15);  color:var(--exact); }
    .nc-fixed   { background:rgba(88,166,255,.15); color:#58a6ff; }
    .nc-changed { background:rgba(227,179,65,.15); color:var(--outcome); }
    .nc-info    { background:rgba(139,148,158,.15); color:var(--muted); }
    .news-star { color:var(--outcome); }
    /* спливне вікно «Що нового» */
    .wn-list { max-height:50vh; overflow-y:auto; margin:2px 0; }
    .wn-item { border-top:1px solid var(--line); padding:10px 0; }
    .wn-item:first-child { border-top:0; padding-top:2px; }
    .wn-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .wn-title { font-weight:700; }
    .wn-body { margin-top:5px; color:var(--txt); line-height:1.45; font-size:14px; white-space:pre-wrap; word-break:break-word; }
    .wn-more { margin-top:10px; font-size:13px; color:var(--muted); }
    /* адмін: форма новин */
    .nf-grid { display:flex; flex-direction:column; gap:8px; }
    .nf-grid input[type="text"], .nf-grid textarea, .nf-grid select { width:100%; background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:9px; font-size:14px; font-family:inherit; }
    .nf-grid textarea { resize:vertical; min-height:84px; }
    .nf-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
    .nf-check { display:flex; align-items:center; gap:6px; font-size:14px; color:var(--muted); }
    .nadm-item { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-top:1px solid var(--line); }
    .nadm-item .ni { flex:1; min-width:0; }
    .nadm-title { font-weight:600; }
    .nadm-meta { font-size:12px; color:var(--muted); margin-top:2px; }
    .nadm-actions { display:flex; gap:6px; flex-wrap:wrap; }
    .status-draft { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--muted); color:var(--muted); }
    .status-pub { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--acc); color:var(--acc); }
    /* під-вкладки всередині адмінки (Користувачі / Матчі / Рейтинг / Новини / Синхро) */
    .adm-subtabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
    .adm-subtabs button { background:transparent; border:1px solid var(--line); color:var(--muted); font-weight:500; padding:6px 12px; border-radius:8px; }
    .adm-subtabs button.active { background:var(--acc); color:#07210f; border-color:var(--acc); }
    /* адмінська таблиця матчів: рядок, що розгортається */
    .amatch { border:1px solid var(--line); border-radius:10px; margin-bottom:8px; background:#0d1117; overflow:hidden; }
    .amatch-head { display:flex; align-items:center; gap:10px; padding:11px 13px; cursor:pointer; flex-wrap:wrap; }
    .amatch.open .amatch-head { border-bottom:1px solid var(--line); background:var(--card); }
    .amatch-teams { font-weight:600; flex:1; min-width:0; }
    .amatch-score { font-weight:700; }
    .amatch-chev { color:var(--muted); transition:transform .15s ease; }
    .amatch.open .amatch-chev { transform:rotate(90deg); }
    .amatch-body { padding:12px 13px; }
    .pn-hist { cursor:pointer; color:var(--txt); border-color:var(--acc) !important; }
    .pn-hist:hover { background:rgba(63,185,80,.12); }
    .bh-panel { background:#0d1117; border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-top:8px; font-size:13px; }
    .bh-panel-title { font-size:12px; color:var(--muted); margin-bottom:6px; }
    .bh-entry { display:flex; justify-content:space-between; gap:8px; padding:3px 0; border-bottom:1px solid var(--line); }
    .bh-entry:last-child { border-bottom:0; font-weight:600; color:var(--acc); }
    .bh-score { font-weight:600; }
    .bh-when { color:var(--muted); font-size:12px; }
    .amatch-body .muted-empty { color:var(--muted); }
    /* рядок учасника в адмінському перегляді матчу */
    .part-summary { font-size:12px; color:var(--muted); margin-bottom:8px; }
    .part-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-top:1px solid var(--line); }
    .part-row:first-child { border-top:0; }
    .part-name { flex:1; min-width:0; }
    .part-status { font-size:12px; font-weight:600; white-space:nowrap; }
    .part-row.placed .part-status { color:var(--acc); }
    .part-row.missing .part-name, .part-row.missing .part-status { color:var(--miss); }
    .part-row.missing .part-name { font-weight:600; }
    /* ---- Асистент 🤖 ---- */
    .ai-wrap { display:flex; flex-direction:column; height:min(70vh,560px); }
    .ai-bar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--line); }
    .ai-bar .ai-clear { font-size:12px; padding:5px 10px; }
    .ai-log { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:10px; padding:4px; }
    .ai-msg { max-width:85%; padding:9px 12px; border-radius:12px; line-height:1.45; white-space:pre-wrap; word-wrap:break-word; }
    .ai-msg.user { align-self:flex-end; background:var(--acc); color:#07210f; border-bottom-right-radius:4px; }
    .ai-msg.bot  { align-self:flex-start; background:#0d1117; border:1px solid var(--line); border-bottom-left-radius:4px; }
    .ai-msg.bot.typing { color:var(--muted); font-style:italic; }
    .ai-hint { color:var(--muted); font-size:13px; text-align:center; margin:auto 0; padding:16px; }
    .ai-chips { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; }
    .ai-chips button { background:transparent; border:1px solid var(--line); color:var(--muted); font-size:12px; padding:6px 10px; }
    .ai-input { display:flex; gap:8px; margin-top:10px; }
    .ai-input textarea { flex:1; background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:9px 10px; resize:none; font-family:inherit; font-size:14px; }
    .ai-input button { flex:0 0 auto; }
    /* ---- Гостьовий режим ---- */
    .guest-banner { display:none; align-items:center; gap:10px; flex-wrap:wrap; background:#10212e; border:1px solid var(--acc); border-radius:10px; padding:10px 14px; margin-bottom:14px; }
    .guest-banner .gb-txt { flex:1; min-width:200px; font-size:14px; }
    .guest-banner b { color:var(--acc); }
    .guest-lock { margin-top:10px; padding:10px 12px; border:1px dashed var(--line); border-radius:10px; background:#0d1117; color:var(--muted); font-size:13px; line-height:1.5; }
    .link-btn { background:transparent; border:0; color:var(--acc); padding:0; font:inherit; cursor:pointer; text-decoration:underline; }
    .guest-card-cta { margin-top:10px; }
    /* статистика гостей в адмінці */
    .guest-stats { display:flex; gap:10px; flex-wrap:wrap; margin:10px 0 14px; }
    .gstat { flex:1; min-width:120px; background:#0d1117; border:1px solid var(--line); border-radius:10px; padding:12px 14px; text-align:center; }
    .gstat .gnum { font-size:24px; font-weight:700; color:var(--acc); }
    .gstat .glbl { font-size:12px; color:var(--muted); margin-top:2px; }
    .gvisit { display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-top:1px solid var(--line); font-size:13px; }
    .gvisit:first-child { border-top:0; }
    .gvisit .gv-when { color:var(--muted); white-space:nowrap; }
    .gvisit .gv-main { flex:1; min-width:0; }
    .gvisit .gv-ip { font-weight:600; }
    .gvisit .gv-dev { color:var(--muted); }
    .gvisit .gv-linked { color:var(--accent); font-weight:500; }
    /* ── Активність: популярність вкладок і таблиця користувачів ── */
    .act-bars { margin:6px 0 4px; }
    .act-bar { display:flex; align-items:center; gap:8px; margin:4px 0; font-size:13px; }
    .act-bar .ab-name { width:120px; flex:none; color:var(--muted); }
    .act-bar .ab-track { flex:1; background:#0d1117; border:1px solid var(--line); border-radius:6px; height:18px; overflow:hidden; }
    .act-bar .ab-fill { height:100%; background:var(--acc); }
    .act-bar .ab-num { width:48px; flex:none; text-align:right; font-weight:600; }
    .act-utable { width:100%; border-collapse:collapse; font-size:13px; margin-top:4px; }
    .act-utable th { text-align:left; color:var(--muted); font-weight:500; padding:6px 8px; border-bottom:1px solid var(--line); }
    .act-utable td { padding:6px 8px; border-bottom:1px solid var(--line); }
    .act-utable td.num { text-align:right; }
    .act-role { font-size:11px; color:var(--muted); }
    .act-ev { display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-top:1px solid var(--line); font-size:13px; }
    .act-ev:first-child { border-top:0; }
    .act-ev .ae-when { color:var(--muted); white-space:nowrap; }
    .act-ev .ae-main { flex:1; min-width:0; }
    .act-ev .ae-type { display:inline-block; font-size:11px; padding:1px 6px; border-radius:5px; border:1px solid var(--line); color:var(--muted); margin-right:4px; }
    /* підвкладки всередині «Таблиця» */
    .board-subtabs { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
    /* ── Графік змін позицій ── */
    .chart-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:6px; }
    .chart-wrap svg { display:block; }
    .chart-grid { stroke:var(--line); stroke-width:1; }
    .chart-axis-txt { fill:var(--muted); font-size:11px; }
    .chart-line { fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
    .chart-line.me { stroke-width:3.5; }
    .chart-dot { stroke:var(--card); stroke-width:1.5; }
    .chart-leg-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
    .chart-legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:10px; }
    .chart-leg { display:inline-flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; color:var(--txt); user-select:none; padding:2px 4px; border-radius:6px; }
    .chart-leg.off { opacity:.4; }
    .chart-leg.me-leg { font-weight:700; }
    .chart-leg .lsw { width:12px; height:12px; border-radius:3px; flex:none; }
    .chart-empty { color:var(--muted); font-size:13px; padding:12px 0; }
    /* ── Вибір кольору в профілі ── */
    .color-grid { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
    .color-sw { width:30px; height:30px; border-radius:8px; border:2px solid transparent; cursor:pointer; position:relative; padding:0; }
    .color-sw.mine { border-color:var(--txt); box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--txt); }
    .color-sw.taken { cursor:not-allowed; opacity:.28; }
    .color-sw.taken::after { content:'✕'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:14px; text-shadow:0 1px 2px #000; }

    /* ============ Головна: список розділів ============ */
    #brand { cursor:pointer; }
    .hub-head h2 { font-size:20px; }
    .hub-grid { display:flex; flex-direction:column; gap:12px; }
    .hub-card { display:flex; align-items:center; gap:14px; background:var(--card); border:1px solid var(--line);
                border-radius:12px; padding:16px; cursor:pointer; transition:border-color .15s, transform .15s; }
    .hub-card:hover { border-color:var(--acc); transform:translateY(-1px); }
    .hub-card.hub-soon { opacity:.72; }
    .hub-card.hub-soon:hover { border-color:var(--line); }
    .hub-icon { font-size:34px; flex:0 0 auto; line-height:1; }
    .hub-body { flex:1; min-width:0; }
    .hub-title { font-size:17px; font-weight:700; }
    .hub-badge { font-size:11px; font-weight:600; padding:1px 7px; border-radius:999px;
                 border:1px solid var(--warn); color:var(--warn); vertical-align:middle; }
    .hub-sub { font-size:13px; color:var(--acc); margin-top:2px; }
    .hub-text { margin-top:6px; line-height:1.45; }
    .hub-cta { flex:0 0 auto; color:var(--muted); font-size:13px; font-weight:600; white-space:nowrap; }

    /* ============ Картки турнірів (прогнози + кіберліга) ============ */
    .t-card { border:1px solid var(--line); border-radius:10px; padding:12px; margin-top:10px;
              cursor:pointer; transition:border-color .15s; }
    .t-card:hover { border-color:var(--acc); }
    .t-card-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .t-emoji { font-size:20px; }
    .t-name { font-weight:700; font-size:16px; }
    .t-status { font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--muted); }
    .t-status.ts-active { color:var(--acc); border-color:var(--acc); }
    .t-status.ts-upcoming { color:var(--away); border-color:var(--away); }
    .t-status.ts-archived { color:var(--muted); }
    .t-desc { margin-top:6px; line-height:1.45; }
    .t-meta { margin-top:6px; font-size:12px; }
    .t-links { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
    .t-links button { font-size:12px; padding:5px 10px; }
    .empty-note { border:1px dashed var(--line); border-radius:10px; padding:16px; margin-top:12px; text-align:center; }
    .btn-link { display:inline-block; background:var(--acc); color:#07210f; border-radius:8px;
                padding:8px 14px; font-weight:600; text-decoration:none; }
    .tctx-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 12px; margin-bottom:12px;
                background:var(--card); border:1px solid var(--line); border-radius:10px; }
    .tctx-name { font-weight:700; }

    /* ============ Кіберліга ============ */
    .cs-new { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px;
              background:var(--miss); color:#fff; }
    .cs-section { border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
    .cs-section h3, .cs-block h3 { font-size:15px; margin:0 0 10px; }
    .cs-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
    .cs-grid label, .cs-section > label { display:block; font-size:13px; color:var(--muted); }
    .cs-grid input, .cs-grid select, .cs-section > label input { margin-top:4px; }
    select { background:#0d1117; border:1px solid var(--line); color:var(--txt); border-radius:8px; padding:8px 10px; width:100%; }
    .cs-check { display:flex !important; align-items:flex-start; gap:8px; font-size:13px; color:var(--txt); margin:8px 0; }
    .cs-check input { width:auto; margin-top:2px; }
    .cs-prow { display:grid; grid-template-columns:24px 1fr 1fr 1.4fr 34px; gap:6px; align-items:center; margin-bottom:6px; }
    .cs-pnum { color:var(--muted); font-size:13px; text-align:center; }
    .cs-del { padding:6px 8px; }
    .cs-volta { margin-top:8px; }
    .cs-block { border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
    .cs-rules { margin:0; padding-left:20px; font-size:13px; line-height:1.6; }
    .cs-winner { margin-top:8px; color:var(--acc); font-size:15px; }
    .cs-actions { margin-top:10px; }
    .cs-actions button { font-size:13px; padding:6px 12px; }
    .cs-share { margin-top:10px; padding:8px 10px; border:1px dashed var(--line); border-radius:8px; font-size:12px; }
    .cs-share code { font-size:11px; word-break:break-all; }
    .cs-share button { font-size:11px; padding:3px 8px; margin-left:6px; }
    .cs-part { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:7px 0; border-bottom:1px solid var(--line); }
    .cs-part:last-child { border-bottom:0; }
    .cs-part-name { font-weight:600; }
    .cs-part.cs-out { opacity:.55; }
    .cs-part.cs-me { background:rgba(63,185,80,.07); border-radius:6px; padding-left:8px; padding-right:8px; }
    .cs-you { font-size:11px; color:var(--acc); border:1px solid var(--acc); border-radius:999px; padding:1px 6px; }
    .cs-group { font-size:11px; color:var(--away); border:1px solid var(--away); border-radius:999px; padding:1px 7px; }
    .cs-elim { font-size:11px; color:var(--miss); border:1px solid var(--miss); border-radius:999px; padding:1px 7px; }
    .table-wrap { overflow-x:auto; }
    .cs-table th, .cs-table td { padding:6px; font-size:13px; }
    .cs-table tr.cs-qual td { background:rgba(63,185,80,.08); }
    .cs-teams { font-size:11px; }
    .cs-bracket { display:flex; gap:14px; overflow-x:auto; padding-bottom:6px; }
    .cs-round { min-width:150px; }
    .cs-round-title { font-size:12px; color:var(--muted); margin-bottom:6px; }
    .cs-tie { border:1px solid var(--line); border-radius:8px; margin-bottom:10px; overflow:hidden; }
    .cs-tie-side { padding:6px 8px; font-size:13px; border-bottom:1px solid var(--line); }
    .cs-tie-side:last-child { border-bottom:0; }
    .cs-tie-side.cs-win { color:var(--acc); font-weight:700; }
    .cs-stage { margin-bottom:14px; }
    .cs-stage-title { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
    .cs-match { border:1px solid var(--line); border-radius:9px; margin-bottom:7px; }
    .cs-match.cs-unseen { border-color:var(--warn); box-shadow:0 0 0 1px var(--warn) inset; }
    .cs-match.cs-open { border-color:var(--acc); }
    .cs-match-head { display:grid; grid-template-columns:1fr auto 1fr auto; gap:8px; align-items:center;
                     padding:9px 11px; cursor:pointer; }
    .cs-side { font-size:14px; min-width:0; overflow-wrap:anywhere; }
    .cs-side-away { text-align:right; }
    .cs-score { font-weight:700; font-size:16px; white-space:nowrap; }
    .cs-pens { font-size:11px; font-weight:500; color:var(--muted); }
    .cs-dot { width:8px; height:8px; border-radius:50%; background:var(--warn); }
    .cs-match-meta { padding:0 11px 8px; font-size:11px; }
    .cs-match-meta a { color:var(--away); }
    .cs-history { padding:0 11px 10px; }
    .cs-hist-row { font-size:12px; padding:5px 0; border-top:1px dashed var(--line); line-height:1.5; }
    .cs-hist-comment { color:var(--muted); margin-top:2px; }
    .cs-form { padding:0 11px 11px; border-top:1px solid var(--line); margin-top:2px; padding-top:10px; }
    .cs-form-row { gap:8px; margin-bottom:8px; }
    .cs-form-row input[type=number] { width:64px; text-align:center; }
    .cs-form-row select { width:auto; min-width:120px; }
    .cs-comment { margin-bottom:8px; }

    @media (max-width:600px) {
      .hub-card { align-items:flex-start; }
      .hub-cta { display:none; }
      .cs-prow { grid-template-columns:20px 1fr 34px; }
      .cs-prow input:nth-of-type(1), .cs-prow input:nth-of-type(2) { grid-column:2 / 3; }
      .cs-match-head { grid-template-columns:1fr auto 1fr; }
    }

    /* ============ Кіберліга: пікер команд, товариська гра, кабінет ============ */
    .cs-pcard { border:1px solid var(--line); border-radius:10px; padding:10px; margin-bottom:8px; }
    .cs-prow-head { display:flex; align-items:center; gap:8px; }
    .cs-prow-head select { flex:1; }
    .cs-plabel { font-size:12px; margin:8px 0 4px; }
    .cs-hint { display:block; font-size:11px; margin-top:3px; }
    .cs-side-title { font-weight:600; margin-bottom:6px; }
    .cs-sides { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; }
    .cs-teampick { position:relative; }
    .cs-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; min-height:22px; align-items:center; }
    .cs-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; padding:3px 8px;
               border-radius:999px; border:1px solid var(--acc); color:var(--acc); }
    .cs-chip button { background:none; border:0; color:inherit; cursor:pointer; padding:0; font-size:12px; }
    .cs-ac-wrap { position:relative; }
    .cs-ac { position:absolute; z-index:20; left:0; right:0; top:100%; margin-top:4px; max-height:230px;
             overflow-y:auto; background:var(--card); border:1px solid var(--line); border-radius:8px;
             box-shadow:0 8px 24px rgba(0,0,0,.45); }
    .cs-ac-item { display:block; width:100%; text-align:left; background:none; border:0; color:var(--txt);
                  padding:8px 10px; font-size:13px; font-weight:500; cursor:pointer; }
    .cs-ac-item:hover { background:rgba(255,255,255,.06); }
    .cs-ac-add { color:var(--acc); border-top:1px solid var(--line); }
    .cs-unreg { font-size:11px; color:var(--warn); border:1px solid var(--warn); border-radius:999px; padding:1px 7px; }

    .cs-stats { display:flex; gap:8px; flex-wrap:wrap; }
    .cs-stat { flex:1 1 70px; text-align:center; border:1px solid var(--line); border-radius:8px; padding:8px 6px; }
    .cs-stat span { display:block; font-size:18px; font-weight:700; }
    .cs-stat small { color:var(--muted); font-size:11px; }
    .ok-txt { color:var(--acc); }
    .err-txt { color:var(--miss); }
    .cs-mh { font-size:13px; color:var(--muted); margin:14px 0 4px; font-weight:600; }
    .cs-mm-list { display:flex; flex-direction:column; gap:8px; }
    .cs-mm { border:1px solid var(--line); border-radius:9px; padding:9px 11px; cursor:pointer; }
    .cs-mm:hover { border-color:var(--acc); }
    .cs-mm-top { display:flex; align-items:center; gap:8px; }
    .cs-mm-score { font-weight:700; font-size:16px; }
    .cs-mm-when { font-size:11px; }
    .cs-mm-line { margin-top:5px; font-size:13px; display:flex; gap:6px; flex-wrap:wrap; align-items:baseline; }
    .cs-mm-meta { font-size:11px; margin-top:3px; }
    .cs-res { display:inline-block; width:20px; height:20px; line-height:20px; text-align:center;
              border-radius:50%; font-size:11px; font-weight:700; border:1px solid var(--line); color:var(--muted); }
    .cs-res.cs-w { background:var(--acc); color:#07210f; border-color:var(--acc); }
    .cs-res.cs-d { border-color:var(--warn); color:var(--warn); }
    .cs-res.cs-l { border-color:var(--miss); color:var(--miss); }
    .cs-home { font-size:11px; color:var(--acc); }
    .cs-away { font-size:11px; color:var(--away); }

    /* Розділення вкладок на «турнірні» й «загальні»: Профіль, Групи, Новини не належать
       жодному турніру, і це має бути видно з першого погляду. */
    .tabs-cap { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em;
                margin:0 0 6px 2px; }
    .tabs { margin-bottom:12px; }
    .tabs-global { padding-top:2px; }

    /* Профіль у шапці — самостійний пункт меню, а не вкладка турніру. */
    header button.ghost.on { border-color:var(--acc); color:var(--acc); }

    /* ============ Картковий клуб ============ */
    .cd-lead { color:var(--acc); }
    .cd-picks { display:flex; flex-wrap:wrap; gap:6px; }
    .cd-pick { background:transparent; border:1px solid var(--line); color:var(--txt);
               border-radius:8px; padding:7px 12px; font-size:13px; font-weight:500; cursor:pointer; }
    .cd-pick.cd-lost { border-color:var(--miss); color:var(--miss); font-weight:700; }
    .cd-pick.cd-skip { opacity:.45; text-decoration:line-through; }
    .cd-mini { background:transparent; border:1px solid var(--line); color:var(--muted);
               border-radius:999px; padding:3px 10px; font-size:12px; font-weight:500; cursor:pointer; }
    .cd-mini.on { border-color:var(--warn); color:var(--warn); }
    .cd-details { margin-top:8px; }
    .cd-details summary { font-size:12px; cursor:pointer; }
    .cd-num { font-weight:700; color:var(--muted); font-size:13px; }
    .cd-summary { font-size:14px; }
