/* Рабочая панель MPKBETS. Дизайн: docs/design/panel/README.md, эталон — docs/design/panel/mpkbets-panel.html.
   Шрифты раздаются самим сервером: CSP не пускает внешние источники. */
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(geologica-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geologica'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(geologica-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(jetbrains-mono-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Компоновка: «Панель» — обзор на один экран (показатели сверху; сигнал и задания слева, 60 аккаунтов в центре,
   новое задание и живое исполнение справа). Разделы дают подробности по каждому блоку. */
:root {
  --canvas: #0B0D12; --panel: #12151C; --panel2: #181C25; --sunk: #0E1117;
  --line: #1F242E; --line2: #2B313D; --ink: #E7EAF0; --muted: #9AA3B2; --faint: #7F8899;
  --accent: #F2C14E; --accent-ink: #1C1606; --sel: #7AA7FF; --sel-bg: rgba(122,167,255,.10);
  --ok: #6FD6A0; --ok-bg: rgba(111,214,160,.12); --warn: #F2B45A; --warn-bg: rgba(242,180,90,.13);
  --err: #F08A80; --err-bg: rgba(240,138,128,.13); --info: #7AA7FF; --info-bg: rgba(122,167,255,.12);
  --mute-bg: #1C212B; --scrim: rgba(3,5,9,.6); --shadow: 0 1px 2px rgba(0,0,0,.35); --pop: 0 24px 60px rgba(0,0,0,.55);
  --f-ui: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-num: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --canvas: #EEF0F4; --panel: #FFFFFF; --panel2: #F6F7FA; --sunk: #F3F5F8;
    --line: #E3E6EC; --line2: #D1D6DF; --ink: #121620; --muted: #515A6A; --faint: #666F80;
    --accent: #F2C14E; --accent-ink: #1C1606; --sel: #2F5FD0; --sel-bg: #EDF2FD;
    --ok: #16704A; --ok-bg: #E2F3EA; --warn: #875404; --warn-bg: #FBF0D9; --err: #B03A2E; --err-bg: #FCEAE7;
    --info: #2F5FD0; --info-bg: #E8EFFC; --mute-bg: #EEF0F4; --scrim: rgba(18,22,32,.3);
    --shadow: 0 1px 2px rgba(18,22,32,.06); --pop: 0 24px 60px rgba(18,22,32,.18); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --canvas: #EEF0F4; --panel: #FFFFFF; --panel2: #F6F7FA; --sunk: #F3F5F8;
  --line: #E3E6EC; --line2: #D1D6DF; --ink: #121620; --muted: #515A6A; --faint: #666F80;
  --accent: #F2C14E; --accent-ink: #1C1606; --sel: #2F5FD0; --sel-bg: #EDF2FD;
  --ok: #16704A; --ok-bg: #E2F3EA; --warn: #875404; --warn-bg: #FBF0D9; --err: #B03A2E; --err-bg: #FCEAE7;
  --info: #2F5FD0; --info-bg: #E8EFFC; --mute-bg: #EEF0F4; --scrim: rgba(18,22,32,.3);
  --shadow: 0 1px 2px rgba(18,22,32,.06); --pop: 0 24px 60px rgba(18,22,32,.18); color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 13.5px/1.45 var(--f-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.01em; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--sel); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .strong { font-weight: 600; }
.cap { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
.scroll { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Шапка и навигация */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: 56px; display: flex; align-items: center; gap: 18px; padding-inline: 16px; background: var(--canvas); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 11px var(--f-ui); letter-spacing: -.03em; }
.brand-name { font-weight: 700; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px; overflow-x: auto; min-width: 0; flex: 1; scrollbar-width: none; }
.nav a { height: 34px; padding: 0 10px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--panel2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); }
.nav .cnt { font: 600 11px var(--f-num); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; }
.top-r { display: flex; align-items: center; gap: 10px; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.view { padding: 12px 16px 24px; min-width: 0; }

/* Базовые элементы */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.card-h { min-height: 46px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 14px; font-weight: 600; }
.card-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.t-ok { color: var(--ok); background: var(--ok-bg); } .t-warn { color: var(--warn); background: var(--warn-bg); }
.t-err { color: var(--err); background: var(--err-bg); } .t-info { color: var(--info); background: var(--info-bg); }
.t-mute { color: var(--muted); background: var(--mute-bg); }
.btn { height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.chip { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line2); background: transparent; font: 500 11.5px var(--f-num); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel); color: var(--sel); }
.field { height: 34px; border-radius: 9px; border: 1px solid var(--line2); background: var(--sunk); padding: 0 10px; width: 100%; font-size: 13px; font-weight: 500; }
.field:focus { border-color: var(--sel); outline: none; box-shadow: 0 0 0 3px var(--sel-bg); }
.field.big { height: 46px; font: 600 21px var(--f-num); padding: 0 12px; }
.lbl { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { height: 26px; padding: 0 10px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-weight: 500; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button .n { font: 500 11px var(--f-num); color: var(--faint); }
.seg button[aria-pressed="true"] { background: var(--panel2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--sel); margin: 0; cursor: pointer; }
input[type=checkbox]:disabled { cursor: not-allowed; opacity: .3; }
.link { color: var(--sel); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }
.kf-ok { color: var(--ok); } .kf-low { color: var(--muted); } .kf-none { color: var(--faint); }
.search-f { position: relative; width: 210px; max-width: 100%; }
.search-f svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--faint); }
.search-f input { padding-left: 34px; }
.meter { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--mute-bg); }
.meter i { display: block; height: 100%; transition: width .4s; }
.kv { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.kv > span:first-child { color: var(--muted); }
.warnline { font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 9px; padding: 8px 10px; }
.empty { padding: 28px 14px; text-align: center; color: var(--muted); }
.flash { animation: flash 1.2s ease-out; }
tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--info-bg); } to { background: transparent; } }

/* Таблицы */
.tw { overflow: auto; min-height: 0; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.grid th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 10px; height: 36px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th.r, .grid td.r { text-align: right; }
.grid th:first-child, .grid td:first-child { padding-left: 14px; }
.grid th:last-child, .grid td:last-child { padding-right: 14px; }
.grid tbody tr:hover td { background: var(--panel2); }
.grid tbody tr.plan td { background: var(--sel-bg); }
.grid tbody tr.off td { color: var(--muted); }
.grid tbody tr.click { cursor: pointer; }
.sortbtn { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; }
.sortbtn:hover, .sortbtn[data-on] { color: var(--ink); }
.an { font: 600 12.5px var(--f-num); white-space: nowrap; }
.as { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kfv { font: 600 14px var(--f-num); }
.kfd { font: 11px var(--f-num); margin-left: 6px; }

/* Показатели */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; color: var(--ink); border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--line2); background: var(--panel2); }
.kpi .v { font: 600 20px/1.15 var(--f-num); letter-spacing: -.03em; }
.kpi .l { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

/* Панель */
.hub { display: grid; grid-template-columns: 330px minmax(0, 1fr) 356px; grid-template-rows: auto minmax(0, 1fr); gap: 12px; height: calc(100dvh - 56px - 36px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 640px; }
.hub .kpis { grid-column: 1 / -1; }
.hub .col { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.hub .fill { flex: 1; min-height: 0; }
.drop { width: 92px; height: 68px; border-radius: 10px; border: 1px dashed var(--line2); background: var(--sunk); display: grid; place-items: center; color: var(--faint); cursor: pointer; overflow: hidden; position: relative; flex: none; }
.drop:hover, .drop.over { border-color: var(--sel); color: var(--sel); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex: 1; min-width: 0; }
.mini-fields .field { height: 30px; font-size: 12px; padding: 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.bigdrop { display: block; min-height: 92px; border-radius: 12px; border: 1.5px dashed var(--line2); background: var(--sunk); cursor: pointer; overflow: hidden; position: relative; flex: none; transition: border-color .15s, background .15s; }
.bigdrop:hover, .bigdrop.over { border-color: var(--sel); background: var(--sel-bg); }
.bigdrop-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; color: var(--faint); }
.bigdrop:hover .bigdrop-in, .bigdrop.over .bigdrop-in { color: var(--sel); }
.bigdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--sunk); }
/* Высота одна на все вкладки (по самой длинной — «1-й тайм»), чтобы форма не прыгала; колонки тянутся по высоте. */
.ogroups { display: flex; flex-direction: column; gap: 10px; height: 384px; flex: none; }
.orows { display: flex; flex-direction: column; gap: 8px; }
.orows .chip { height: 32px; }
.orows.compact { flex: none; }
.orows.compact .chip { height: 26px; }
.ocols { display: grid; gap: 8px; flex: 1; min-height: 0; }
.ocol { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; }
.ocol .chip { flex: 1 1 0; min-height: 26px; max-height: 32px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; }
.otabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.otabs button { position: relative; justify-content: center; padding: 0 4px; }
.otabs .dot2 { position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--sel); }
.ogroup { display: flex; flex-direction: column; gap: 4px; }
.ogrid { display: grid; gap: 5px; }
.sigbody > * { flex: none; }
.sigbody > .bigdrop { flex: 1 1 auto; min-height: 112px; max-height: 280px; }
.sigbody > #hub-match { margin-top: -6px; }
.imgbtns { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 1; }
.imgbtn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.imgbtn:hover { border-color: var(--sel); color: var(--sel); }
#hub-match, #hub-outcome { text-align: center; }
.ogrid .chip { padding: 0 4px; overflow: hidden; text-overflow: ellipsis; }
.btn.go { height: 44px; font-size: 14px; background: var(--ink); color: var(--canvas); border-color: var(--ink); flex: none; }
.btn.go:hover { opacity: .9; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.prog .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--mute-bg); overflow: hidden; }
.prog .bar i { display: block; height: 100%; transition: width .3s; }
.tl { overflow-y: auto; }
.ti { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; width: 100%; }
.ti:hover { background: var(--panel2); }
.ti[aria-current="true"] { background: var(--sel-bg); }
.ti .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ti .r3 { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.acc-card .tw { flex: 1; }
.acc-card table { min-width: 660px; }
.acc-card .grid td { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.acc-tb { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.foot { padding: 8px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.conds { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) auto 58px; gap: 8px; align-items: baseline; font: 12px var(--f-num); padding: 4px 0; border-bottom: 1px dashed var(--line); }
.frow .n1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; gap: 2px; height: 8px; border-radius: 3px; overflow: hidden; background: var(--mute-bg); }
.stack i { display: block; height: 100%; background: var(--ink); }
.chain { overflow-y: auto; padding: 4px 0; }
.step { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 14px; align-items: start; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 10px var(--f-num); }
.step .why { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); }
.step .acts { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.step.now { background: var(--info-bg); }
.step.next { opacity: .7; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Разделы */
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.page-h h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.page-h p { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.hide-empty:empty { display: none; }
.clock { white-space: nowrap; display: inline-block; min-width: 13.5em; text-align: right; font-variant-numeric: tabular-nums; }
/* Фиксированная ширина, чтобы меняющиеся секунды не сдвигали соседей */
.badge.live { width: 142px; justify-content: flex-start; }
#live-age { font-size: 11.5px; }
.usermenu { position: relative; }
button.avatar { cursor: pointer; color: var(--ink); font: 600 12px var(--f-ui); padding: 0; }
button.avatar:hover, button.avatar[aria-expanded="true"] { border-color: var(--sel); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--pop); z-index: 50; padding: 6px; }
.menu-h { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.menu-h .avatar { width: 38px; height: 38px; flex: none; }
.menu-i { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; }
.menu-i:hover, .menu-i:focus-visible { background: var(--panel2); outline: none; }
.menu-i svg { color: var(--muted); }
.menu-i.danger { color: var(--err); } .menu-i.danger svg { color: var(--err); }
.menu-f { padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; font-size: 11.5px; color: var(--faint); }
.signout { position: fixed; inset: 0; z-index: 70; background: var(--canvas); display: grid; place-items: center; padding: 16px; }
.signout-box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--pop); }
@media (max-width: 760px) { .clock { display: none; } }
.ctable .tl-left { text-align: left !important; white-space: normal; min-width: 320px; }
.sysgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 640px) { .sysgrid { grid-template-columns: minmax(0, 1fr); } }
/* Таблица на всю ширину: свободное место делится поровну между промежутками, значения по центру столбца */
.eqtable { width: auto; }
.ctable th, .ctable td { text-align: center !important; }
.ctable .accchips { justify-content: center; }
.eqtable th, .eqtable td { white-space: nowrap; padding-left: var(--padx, 14px); padding-right: var(--padx, 14px); }
.eqtable td { height: 44px; }
.eqtable th.wrap { white-space: normal; line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
.addform { display: flex; flex-direction: column; gap: 12px; }
.addgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.eyebtn { position: absolute; right: 4px; top: 3px; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.eyebtn:hover { color: var(--ink); background: var(--panel2); }
.tagpill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--sel-bg); color: var(--sel); border: 1px solid var(--sel); font: 600 12px var(--f-num); letter-spacing: .02em; }
.accchips { display: flex; flex-wrap: wrap; gap: 4px; }
.accchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--mute-bg); font: 500 11.5px var(--f-num); white-space: nowrap; }
.accchip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.accchip i.t-ok, .accchip i.t-warn, .accchip i.t-err, .accchip i.t-info, .accchip i.t-mute { background-color: currentColor; }
.metapills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mp { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 500; font-size: 12.5px; }
.mp svg { color: var(--faint); }
.mp.strongp { border-color: var(--line2); background: var(--panel2); }
.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; align-items: start; }
.split > .card:first-child { position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); max-height: calc(100dvh - 92px); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.mets { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px; }
.mets .v { font: 600 20px var(--f-num); margin-top: 4px; }
.tsteps table { min-width: 820px; }
.jl { list-style: none; margin: 0; padding: 0 14px; max-height: 560px; overflow-y: auto; }
.jl li { display: grid; grid-template-columns: 58px 8px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.jl .d { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; background: currentColor; }
.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--err-bg); color: var(--err); }
.grid td.cbcell { cursor: default; width: 48px; }
.grid td.cbcell:hover input { outline: 2px solid var(--sel-bg); outline-offset: 3px; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--sel-bg); border-bottom: 1px solid var(--line); }
.sys { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.big-state { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-state b { font: 600 22px var(--f-num); }
.tog { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tog:last-child { border-bottom: 0; }

/* Выдвижная карточка и сообщения */
.modal { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.modal-box { pointer-events: auto; max-height: calc(100dvh - 32px); overflow-y: auto; width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--pop); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-a { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--pop); z-index: 41; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer-h { padding: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.drawer-b { padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.drawer-f .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; height: 36px; font-size: 12.5px; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.dl { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--canvas); border-radius: 12px; padding: 10px 12px 10px 16px; display: flex; gap: 14px; align-items: center; z-index: 60; box-shadow: var(--pop); max-width: calc(100% - 32px); }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; height: 28px; padding: 0 10px; cursor: pointer; font-weight: 600; font-size: 12px; white-space: nowrap; }

@media (max-width: 1520px) { .brand-name { display: none; } .top { gap: 12px; } }
@media (max-width: 1240px) {
  .hub { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; height: auto; }
  .hub .center { grid-column: 1 / -1; order: -1; }
  .hub .kpis { order: -2; }
  .hub .acc-card { height: 560px; }
  .hub .tl, .hub .chain { max-height: 420px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
@media (max-width: 980px) {
  .split, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .split > .card:first-child { position: static; max-height: 420px; }
}
@media (max-width: 760px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 10px; }
  .brand-name, .live-txt, .theme-txt { display: none; }
  .view { padding: 12px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Дополнения рабочей панели ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Окна на <dialog>: выдвижная карточка справа (.drawer) или окно по центру (.modal) */
dialog.sheet { margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
/* Классы .drawer/.modal из прототипа задают display — закрытый <dialog> обязан оставаться скрытым */
dialog.sheet:not([open]) { display: none !important; }
dialog.sheet[open] { display: block; z-index: auto; pointer-events: auto; place-items: normal; padding: 0; box-shadow: none; border-left: 0; background: transparent; }
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet.drawer { position: fixed; inset: 0 0 0 auto; height: 100dvh; width: min(440px, 100%); }
dialog.sheet.drawer .sheet-box { height: 100%; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--pop); display: flex; flex-direction: column; }
dialog.sheet.modal { position: fixed; inset: 0; margin: auto; width: min(520px, calc(100% - 32px)); height: fit-content; }
dialog.sheet.modal.wide { width: min(780px, calc(100% - 32px)); }
dialog.sheet.modal .sheet-box { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--pop); display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.sheet-h { padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 18px; font-weight: 600; }
.sheet-h .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sheet-b { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.sheet-f { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet-f .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; height: 36px; font-size: 12.5px; }
dialog.modal .sheet-f { justify-content: flex-end; }
dialog.modal .sheet-f .btn { flex: 0 0 auto; padding: 0 14px; }
.sheet-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }

/* Вход */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--canvas); }
.signin-box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--pop); }
.signin-box h1 { font-size: 20px; font-weight: 600; }

/* Тестовый режим */
.demo-banner { padding: 7px 16px; background: var(--warn-bg); color: var(--warn); font-size: 12.5px; font-weight: 500; text-align: center; border-bottom: 1px solid var(--line); }

/* Сообщения формы, пояснения, заглушки */
.form-error { color: var(--err); font-size: 12.5px; min-height: 0; }
.form-error:empty { display: none; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.note svg { flex: none; margin-top: 1px; color: var(--faint); }
.stub { border: 1px dashed var(--line2); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); background: var(--sunk); }
.stub b { color: var(--ink); font-weight: 600; }
.stub-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--faint); border: 1px dashed var(--line2); }

/* Переключатель */
.switch { width: 38px; height: 22px; border-radius: 999px; border: 1px solid var(--line2); background: var(--mute-bg); position: relative; cursor: pointer; flex: none; padding: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--faint); transition: left .15s, background .15s; }
.switch.on { background: var(--sel-bg); border-color: var(--sel); }
.switch.on::after { left: 18px; background: var(--sel); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* Прогресс поиска: неопределённая шкала */
.prog .bar i.run { width: 35% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* Поле скриншота как кнопка */
button.bigdrop { width: 100%; font: inherit; color: inherit; padding: 0; }
.bigdrop .imgbtns { z-index: 2; }
.hub-selects { display: flex; gap: 6px; flex-wrap: wrap; }
.hub-selects .field { height: 28px; font-size: 12px; width: auto; max-width: 240px; padding: 0 8px; }
.table-note { font-size: 12px; color: var(--muted); padding: 0 14px 8px; }
.quote-loading { color: var(--info); }
.task-caption { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Таблица Панели: фиксированная раскладка по долям, длинный текст обрезается многоточием */
.hub-table { table-layout: fixed; width: 100%; min-width: 640px; }
.hub-table th, .hub-table td { padding-left: 6px; padding-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-table th:first-child, .hub-table td:first-child { padding-left: 10px; }
.hub-table .an { display: block; overflow: hidden; text-overflow: ellipsis; }
.hub-table td .link { max-width: 100%; }
/* Live: минимальная ширина держит секунды на месте, длинные состояния («восстанавливаем связь») расширяют плашку */
.badge.live { width: auto; min-width: 150px; }
/* Вкладки списка заданий помещаются в одну строку колонки 360px */
.split > .card .seg { flex-wrap: nowrap; }
.split > .card .seg button { padding: 0 7px; }
