/* Agent Board — цвет принадлежит агентам, всё остальное — чернила и графит. */
:root {
  --canvas: #ECEEF1; --surface: #FBFBFC; --sunk: #E3E6EB; --ink: #14171F; --graphite: #6A7080; --faint: #9BA1AF; --rule: #D9DCE3;
  --claude: #D9773F; --codex: #11957F; --chatgpt: #2F6FDB; --human: #5856D6; --other: #7A8194; --amber: #C98A12;
  --alarm: #D4483B; --pass: #1F8A5B;
  --ink-contrast: #FBFBFC;
  --focus: 0 0 0 3px color-mix(in srgb, var(--human) 35%, transparent);
  --shadow-card: 0 1px 0 rgba(20,23,31,.04), 0 1px 2px rgba(20,23,31,.06);
  --shadow-float: 0 24px 60px -12px rgba(20,23,31,.28);
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #101215; --surface: #171A1F; --sunk: #1E2228; --ink: #ECEEF2; --graphite: #8A90A0; --faint: #5F6573; --rule: #262A31;
    --claude: #E88A55; --codex: #2DB49A; --chatgpt: #5B8EF0; --human: #7B79F0; --other: #8A90A0; --alarm: #EE6355; --pass: #3AAE7A; --amber: #E0A63A;
    --ink-contrast: #101215;
    --shadow-card: 0 1px 0 rgba(0,0,0,.3); --shadow-float: 0 24px 60px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #101215; --surface: #171A1F; --sunk: #1E2228; --ink: #ECEEF2; --graphite: #8A90A0; --faint: #5F6573; --rule: #262A31;
  --claude: #E88A55; --codex: #2DB49A; --chatgpt: #5B8EF0; --human: #7B79F0; --other: #8A90A0; --alarm: #EE6355; --pass: #3AAE7A; --amber: #E0A63A;
  --ink-contrast: #101215; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--ink); font: 400 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.hidden { display: none !important; }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── знак: две плашки, передающие ход ── */
.mark { position: relative; width: 22px; height: 22px; flex: none; }
.mark i { position: absolute; width: 14px; height: 14px; border-radius: 4px; }
.mark i:first-child { left: 0; top: 0; background: var(--claude); }
.mark i:last-child { right: 0; bottom: 0; background: var(--codex); mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .mark i:last-child { mix-blend-mode: screen; } }
.mark.big { width: 44px; height: 44px; }
.mark.big i { width: 28px; height: 28px; border-radius: 8px; }

/* ── штамп агента ── */
.stamp { --k: var(--other); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--k); color: #fff; font: 600 9.5px/1 var(--display); letter-spacing: .02em; flex: none; }
.stamp.sm { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; }
.stamp.lg { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.stamp.empty { background: transparent; border: 1.5px dashed var(--faint); color: var(--faint); }
.who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.who .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--rule); background: var(--surface); padding: 7px 13px; border-radius: 8px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--faint); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); }
.btn.ink:hover { opacity: .88; }
.btn.pass { background: var(--pass); border-color: var(--pass); color: #fff; }
.btn.alarm { background: var(--alarm); border-color: var(--alarm); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--graphite); }
.btn.ghost:hover { color: var(--ink); background: var(--sunk); }
.btn.quiet-danger { border-color: transparent; background: transparent; color: var(--alarm); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; border: none; background: none; width: 28px; height: 28px; border-radius: 7px; color: var(--graphite); }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.link { border: none; background: none; color: var(--graphite); padding: 0; font-size: 13px; }
.link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── поля ── */
input, select, textarea { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 11px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--human); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.fld { display: grid; gap: 6px; }
.fld > span { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--graphite); }
.fld .hint { font: 400 12px/1.4 var(--body); text-transform: none; letter-spacing: 0; color: var(--faint); }
.error { color: var(--alarm); font-size: 13px; min-height: 1em; }

/* ── вход ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login-title { font: 600 30px/1.1 var(--display); letter-spacing: -.01em; margin: 6px 0 0; }
.login-lead { margin: -4px 0 8px; color: var(--graphite); font-size: 15px; }

/* ── каркас ── */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100vh; }
.sidebar { display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; border-right: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 14px/1 var(--display); padding: 2px 8px 22px; letter-spacing: -.01em; }
.nav { display: grid; gap: 1px; margin-bottom: 22px; }
.nav-item, .project-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 7px 8px; border-radius: 8px; color: var(--graphite); font-weight: 500; }
.nav-item:hover, .project-item:hover { background: var(--sunk); color: var(--ink); }
.nav-item.active, .project-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.nav-item .lbl, .project-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font: 500 11px/1 var(--mono); color: var(--faint); }
.count.hot { color: #fff; background: var(--alarm); padding: 3px 6px; border-radius: 99px; }
.side-title { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px 8px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.project-list { display: grid; gap: 1px; }
.project-item .hash { font-family: var(--mono); color: var(--faint); width: 16px; text-align: center; }
.side-empty { padding: 4px 8px; color: var(--faint); font-size: 13px; }
.side-foot { margin-top: auto; padding: 14px 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { display: flex; align-items: flex-end; gap: 16px; padding: 22px 28px 16px; }
.topbar h1 { font: 600 22px/1.15 var(--display); letter-spacing: -.015em; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-wrap { flex: 1; min-width: 0; }
.sub { margin-top: 6px; color: var(--graphite); font-size: 13px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.sub .mono { font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions input { width: 190px; padding: 6px 10px; }
.menu-btn { display: none; }
.view { flex: 1; overflow: auto; padding: 4px 28px 28px; }

/* ── полоса «чей ход» ── */
.turns { display: flex; gap: 10px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.turns::-webkit-scrollbar { display: none; }
.turn { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; min-width: 0; text-align: left; flex: none; transition: border-color .12s, box-shadow .12s; }
.turn:hover { border-color: var(--faint); }
.turn.on, .turn.s-working.on, .turn.s-due.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), 0 4px 14px -6px color-mix(in srgb, var(--ink) 40%, transparent); }
.turn.s-working { border-color: var(--pass); box-shadow: inset 0 0 0 1px var(--pass); }
.turn.s-due { border-color: color-mix(in srgb, var(--amber) 75%, var(--rule)); }
.turn.s-offline { opacity: .72; }
.turn .what { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.turn .n { font: 600 24px/1 var(--display); letter-spacing: -.02em; }
.turn .meta { display: grid; gap: 4px; min-width: 0; }
.turn .nm { font-weight: 600; font-size: 13px; }
.turn .what { font-size: 12px; color: var(--graphite); white-space: nowrap; }
.turn.quiet .n { color: var(--faint); }
.turns-label { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 8px; }

/* ── доска ── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 0; min-height: calc(100% - 96px); border-top: 1px solid var(--rule); }
.column { display: flex; flex-direction: column; min-width: 0; padding: 0 8px; border-right: 1px solid var(--rule); }
.column:first-child { padding-left: 0; }
.column:last-child { border-right: none; padding-right: 0; }
.column.slim { grid-column: span 1; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 10px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); position: sticky; top: 0; background: var(--canvas); z-index: 1; }
.column-head .count { margin-left: auto; }
.column.alarm .column-head { color: var(--alarm); }
.column-body { display: grid; gap: 8px; align-content: start; padding-bottom: 12px; }
.column-empty { border: 1px dashed var(--rule); border-radius: 10px; padding: 14px; color: var(--faint); font-size: 12.5px; text-align: center; }

.card { --k: var(--rule); position: relative; display: grid; gap: 8px; padding: 11px 12px 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-card); cursor: pointer; transition: border-color .12s, transform .12s; text-align: left; width: 100%; }
.card:hover { border-color: var(--faint); }
.card.rework { border-left: 3px solid var(--alarm); padding-left: 10px; }
.card.blocked { background: repeating-linear-gradient(-45deg, var(--surface) 0 8px, color-mix(in srgb, var(--alarm) 5%, var(--surface)) 8px 16px); }
.card-top { display: flex; align-items: center; gap: 8px; font: 400 11.5px/1 var(--mono); color: var(--faint); }
.card-top .proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-top .right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.card-top .ticks { margin-left: 0; }
.prio { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.prio.urgent { color: #fff; background: var(--alarm); padding: 3px 6px; border-radius: 4px; }
.prio.high { color: var(--alarm); }
.prio.low { color: var(--faint); }
.prio.normal { display: none; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--ink); }
.card-foot { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.card-foot .turn-line { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; color: var(--graphite); }
.card-foot .turn-line b { color: var(--ink); font-weight: 600; flex: none; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot .turn-line .verb { flex: 0 10 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot .turn-line b + .verb::before { content: '· '; color: var(--faint); }
.ticks { margin-left: auto; display: inline-flex; gap: 2px; align-items: center; }
.ticks i { width: 5px; height: 10px; border-radius: 1.5px; background: var(--rule); }
.ticks i.on { background: var(--pass); }
.branch { display: inline-flex; align-items: center; gap: 5px; font: 400 11.5px/1.2 var(--mono); color: var(--graphite); min-width: 0; }
.branch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch svg.i { width: 12px; height: 12px; }
.done-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid var(--rule); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; color: var(--graphite); font-size: 12.5px; }
.done-row:hover { color: var(--ink); }
.done-row .mono { color: var(--faint); font-size: 11px; }
.done-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; text-decoration-color: var(--faint); }

/* ── статус ── */
.status { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--graphite); padding: 5px 8px; border-radius: 6px; background: var(--sunk); white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.in_progress, .status.review { color: var(--ink); }
.status.changes_requested, .status.blocked { color: var(--alarm); background: color-mix(in srgb, var(--alarm) 10%, transparent); }
.status.done { color: var(--pass); background: color-mix(in srgb, var(--pass) 10%, transparent); }
.status.review::before { background: transparent; border: 1.5px solid currentColor; width: 5px; height: 5px; }

/* ── входящие ── */
.inbox { display: grid; gap: 28px; max-width: 980px; }
.inbox-hero { display: flex; align-items: baseline; gap: 14px; }
.inbox-hero .n { font: 600 56px/1 var(--display); letter-spacing: -.03em; }
.inbox-hero .n.zero { color: var(--faint); }
.inbox-hero .lbl { color: var(--graphite); font-size: 15px; max-width: 360px; }
.group { display: grid; gap: 6px; }
.group-head { display: flex; align-items: center; gap: 10px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); padding-bottom: 6px; }
.group-head.alarm { color: var(--alarm); }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: var(--faint); }
.row .id { font: 400 12px/1 var(--mono); color: var(--faint); }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t small { display: block; font-weight: 400; color: var(--graphite); font-size: 12px; margin-top: 2px; }
.row .when { font: 400 11.5px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.onboard { display: grid; gap: 14px; padding: 22px 24px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.onboard h3 { margin: 0; font: 600 16px/1.2 var(--display); }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--sunk); font: 600 10px/1 var(--display); }

/* ── лента ── */
.feed { max-width: 860px; display: grid; }
.feed-day { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 18px 0 8px; }
.feed-day:first-child { padding-top: 0; }
.ev { display: grid; grid-template-columns: 46px 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.ev time { font: 400 11.5px/22px var(--mono); color: var(--faint); }
.ev .txt { line-height: 22px; }
.ev .task-link { font-family: var(--mono); font-size: 12px; border: none; background: none; padding: 0 4px 0 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }

/* ── агенты ── */
.agents { display: grid; gap: 22px; max-width: 1240px; }
.agent-grid { columns: 290px; column-gap: 12px; }
.agent-grid > .agent { break-inside: avoid; margin-bottom: 12px; }
.agent-group { display: grid; gap: 4px; }
.agent-group .group-head { flex-wrap: wrap; }
.group-sub { font: 400 12.5px/1.3 var(--body); text-transform: none; letter-spacing: 0; color: var(--faint); margin-left: 4px; }
.agent { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.agent.s-working { border-color: var(--pass); box-shadow: inset 0 0 0 1px var(--pass); }
.agent.s-due { border-color: color-mix(in srgb, var(--amber) 70%, var(--rule)); }
.agent.s-offline { background: color-mix(in srgb, var(--surface) 60%, var(--canvas)); }
.agent-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.agent-id { min-width: 0; }
.agent-top .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-top .kind { font: 400 11.5px/1.3 var(--mono); color: var(--graphite); }
.agent-top .kind b { color: var(--ink); font-weight: 500; }
.agent-state { display: grid; gap: 4px; }
.agent-state .detail { font-size: 12.5px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent-desc { font-size: 12.5px; color: var(--graphite); }
.caps { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--graphite); }
.agent-stats b { color: var(--ink); font-weight: 600; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--rule); padding-top: 10px; min-width: 0; }
.agent-actions .quiet-danger { margin-left: auto; }

/* ── живое состояние ── */
.state { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--graphite); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.state.working { color: var(--pass); }
.state.working::before { background: var(--pass); animation: beat 1.6s ease-in-out infinite; }
.state.due { color: var(--amber); }
.state.due::before { background: var(--amber); }
.state.review { color: var(--chatgpt); }
.state.review::before { background: transparent; border: 1.5px solid currentColor; width: 5px; height: 5px; }
.state.idle::before { background: transparent; border: 1.5px solid var(--pass); width: 5px; height: 5px; }
.state.offline { color: var(--faint); }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pass) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.count.live { color: var(--pass); }

.connect { display: grid; gap: 14px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.connect h3 { margin: 0; font: 600 16px/1.2 var(--display); }
.connect p { margin: 0; color: var(--graphite); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--sunk); border-radius: 9px; flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 500; color: var(--graphite); font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.code { position: relative; }
.code pre { margin: 0; padding: 14px 16px; padding-right: 96px; background: var(--ink); color: var(--ink-contrast); border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: 12.5px; line-height: 1.6; }
.code .btn { position: absolute; top: 8px; right: 8px; background: transparent; color: var(--ink-contrast); border-color: color-mix(in srgb, var(--ink-contrast) 25%, transparent); }
.code .btn:hover { border-color: var(--ink-contrast); }
.code-label { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); margin-bottom: 8px; }
.secret { padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--claude) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--claude) 35%, var(--rule)); display: grid; gap: 10px; }

/* ── карточка задачи ── */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-backdrop, .modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 30%, transparent); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(800px, 100%); background: var(--surface); overflow-y: auto; box-shadow: var(--shadow-float); animation: slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.d-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.d-bar .id { font: 400 12.5px/1 var(--mono); color: var(--graphite); }
.d-bar .spacer { flex: 1; }
.d-body { padding: 22px 28px 48px; }
.d-title { font: 600 23px/1.25 var(--display); letter-spacing: -.015em; margin: 0 0 16px; }
.baton { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--k) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--k) 30%, var(--rule)); margin-bottom: 14px; }
.baton .txt { flex: 1; min-width: 0; }
.baton .txt b { font-weight: 600; }
.baton .txt small { display: block; color: var(--graphite); font-size: 12.5px; }
.baton.none { --k: var(--faint); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 20px; margin: 22px 0 8px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.fact .k { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 7px; }
.fact .v { font-size: 13.5px; word-break: break-word; min-width: 0; }
.fact .v .mono { font-size: 12.5px; }
.fact .v.none { color: var(--faint); }
.block-note { padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--alarm) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--alarm) 30%, var(--rule)); margin-bottom: 14px; }
.block-note b { color: var(--alarm); }
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: center; gap: 10px; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); margin: 0 0 12px; }
.sec-h .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.md { line-height: 1.65; word-wrap: break-word; font-size: 14px; }
.md > :first-child { margin-top: 0; }
.md pre { background: var(--sunk); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.md code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.md pre code { background: none; padding: 0; }
.md h2, .md h3, .md h4, .md h5 { font: 600 14px/1.3 var(--body); margin: 18px 0 6px; }
.md p { margin: 6px 0; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.checklist { display: grid; gap: 0; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; padding: 11px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.check:last-child { border-bottom: none; }
.check:hover { background: var(--canvas); }
.check input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; border: 1.5px solid var(--faint); border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--pass); border-color: var(--pass); }
.check input:checked::after { content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check.done .ctext { color: var(--graphite); }
.check .by { font-size: 12px; color: var(--faint); margin-top: 2px; }
.empty-line { color: var(--faint); font-size: 13px; }
.thread { display: grid; gap: 0; }
.msg { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.msg:first-child { padding-top: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.msg-head b { font-weight: 600; }
.msg-head time { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.tag { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; padding: 4px 7px; border-radius: 5px; background: var(--sunk); color: var(--graphite); }
.tag.report { background: var(--ink); color: var(--ink-contrast); }
.tag.approve { background: var(--pass); color: #fff; }
.tag.request_changes { background: var(--alarm); color: #fff; }
.tests { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--canvas); }
.tests .k { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 6px; }
.composer { display: grid; gap: 8px; margin-top: 14px; }
.composer .row-end { display: flex; justify-content: flex-end; }
.history { display: grid; gap: 0; font-size: 12.5px; color: var(--graphite); }
.history div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 5px 0; }
.history time { font: 400 11.5px/1.6 var(--mono); color: var(--faint); }
.chip { display: inline-flex; align-items: center; font: 400 11.5px/1 var(--mono); padding: 4px 7px; border-radius: 5px; background: var(--sunk); color: var(--graphite); }

/* ── модалки ── */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; background: var(--surface); border-radius: 16px; width: min(660px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 28px; box-shadow: var(--shadow-float); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal-card h2 { margin: 0 0 18px; font: 600 19px/1.2 var(--display); letter-spacing: -.01em; }
.form { display: grid; gap: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; align-items: center; }
.form-actions .grow { flex: 1; }



@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 16; inset: 0 auto 0 0; width: 264px; background: var(--canvas); transform: translateX(-100%); transition: transform .2s; }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: color-mix(in srgb, var(--ink) 30%, transparent); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 14px 16px 12px; flex-wrap: wrap; align-items: center; }
  .title-wrap { flex: 1 1 calc(100% - 48px); }
  .topbar h1 { font-size: 19px; }
  .top-actions { width: 100%; }
  .top-actions input { flex: 1; width: auto; min-width: 0; }
  .view { padding: 4px 16px 24px; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; border-top: none; }
  .column { padding: 0; border-right: none; }
  .column-head { position: static; }
  .row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .row .when { display: none; }
  .d-bar, .d-body { padding-left: 18px; padding-right: 18px; }
  .d-title { font-size: 19px; }
  .modal-card { padding: 22px 18px; }
  .inbox-hero .n { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── выбор галочками ── */
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-item { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.pick-item:hover { border-color: var(--faint); }
.pick-item input { position: absolute; opacity: 0; width: 0; height: 0; padding: 0; border: 0; }
.pick-item:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); }
.pick-item:has(input:focus-visible) { box-shadow: var(--focus); }
.pick-item svg.i { width: 13px; height: 13px; }
.hint-line { margin: 0; font-size: 12.5px; color: var(--graphite); }
.chip svg.i { width: 11px; height: 11px; }

/* ── доступы ── */
.vault { display: grid; gap: 8px; max-width: 1100px; }
.vrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.v-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v-name svg.i { color: var(--faint); }
.v-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; color: var(--graphite); font-size: 12px; }
.v-meta a { color: var(--graphite); }
.v-notes { margin-top: 6px; font-size: 12.5px; color: var(--graphite); }
.v-pass { display: flex; align-items: center; gap: 6px; min-width: 0; }
.v-pass .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-pass .masked { letter-spacing: .1em; color: var(--faint); }
.v-pass .none { color: var(--faint); letter-spacing: 0; font-family: var(--body); font-size: 12.5px; }
.v-scope { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.muted-s { font-size: 12px; color: var(--faint); }
.v-act { display: flex; gap: 2px; }

/* ── настройка ── */
.setup { display: grid; gap: 14px; max-width: 920px; }
.step { display: grid; gap: 12px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.step h3 { margin: 0; font: 600 15px/1.25 var(--display); letter-spacing: -.01em; }
.step p { margin: 0; color: var(--graphite); }

@media (max-width: 900px) {
  .vrow { grid-template-columns: 1fr auto; }
  .v-pass, .v-scope { grid-column: 1 / -1; }
  .v-act { grid-row: 1; grid-column: 2; }
}
.filter-bar { display: flex; align-items: center; gap: 12px; margin: -8px 0 14px; font-size: 12.5px; color: var(--graphite); }

/* ── лимиты подписки ── */
.limits { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); }
.lim { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "n p r" "b b b"; gap: 4px 8px; align-items: baseline; font-size: 12px; }
.lim + .lim { margin-top: 4px; }
.lim-n { grid-area: n; } .lim-p { grid-area: p; } .lim-r { grid-area: r; text-align: right; } .lim-bar { grid-area: b; }
.lim-n { color: var(--graphite); }
.lim-bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.lim-bar i { display: block; height: 100%; background: var(--pass); border-radius: 3px; }
.lim.high .lim-bar i { background: var(--amber); }
.lim.full .lim-bar i { background: var(--alarm); }
.lim-p { font: 600 12px/1 var(--mono); }
.lim.full .lim-p, .lim.full .lim-r { color: var(--alarm); }
.lim-r { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.lim-upd { font-size: 11px; color: var(--faint); }
.state.limited { color: var(--alarm); }
.state.limited::before { background: var(--alarm); border-radius: 2px; }
.agent.s-limited { border-color: color-mix(in srgb, var(--alarm) 60%, var(--rule)); }
.turn.s-limited { border-color: color-mix(in srgb, var(--alarm) 60%, var(--rule)); }


/* ═════════ 1.4: уведомления, анимации, свёрнутые агенты, статистика, офис ═════════ */
:root { --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.45,.5,1); }

/* стопка уведомлений */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column-reverse; gap: 8px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast { --tone: var(--ink); position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-left: 3px solid var(--tone); border-radius: 12px; box-shadow: var(--shadow-float); overflow: hidden; pointer-events: auto; font-size: 13px; animation: toastIn .42s var(--spring) both; }
.toast.click { cursor: pointer; }
.toast.click:hover { border-color: var(--faint); border-left-color: var(--tone); }
.toast.pass { --tone: var(--pass); } .toast.alarm, .toast.err { --tone: var(--alarm); } .toast.review { --tone: var(--chatgpt); }
.toast.err { background: var(--alarm); color: #fff; border-color: var(--alarm); }
.toast-body { display: grid; gap: 2px; min-width: 0; line-height: 1.4; }
.toast-body b { font-weight: 600; }
.toast-body span { color: var(--graphite); overflow-wrap: anywhere; }
.toast.err .toast-body span, .toast:not(:has(b)) .toast-body span { color: inherit; }
.toast-life { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tone); opacity: .5; transform-origin: left; animation: life var(--life) linear forwards; }
.toast.out { animation: toastOut .26s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px) scale(.97); margin-bottom: -60px; } }
@keyframes life { to { transform: scaleX(0); } }

/* переход между разделами и живые элементы */
.view.enter > * { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.card { transition: border-color .15s, transform .18s var(--ease), box-shadow .18s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgba(20,23,31,.25); }
.card.fresh { animation: fresh 2.4s var(--ease); }
@keyframes fresh { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--human) 60%, transparent); transform: scale(1.015); } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--human) 18%, transparent); } 100% { box-shadow: var(--shadow-card); } }
.turn { transition: border-color .15s, box-shadow .15s, transform .18s var(--ease); }
.turn:hover { transform: translateY(-1px); }
.row { transition: background .12s, transform .15s var(--ease); }
.nav-item { transition: background .12s, color .12s; }
.btn { transition: background .12s, border-color .12s, transform .1s; }
.btn:active { transform: scale(.97); }
.modal-backdrop, .drawer-backdrop { animation: fadeIn .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.count.hot { animation: hotPop .5s var(--spring); }
@keyframes hotPop { from { transform: scale(.4); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* колокольчик */
.side-foot .bell { margin-left: auto; }
.side-foot .bell.on { color: var(--pass); }

/* нужна помощь */
.state.help { color: var(--alarm); }
.state.help::before { background: var(--alarm); animation: sos 1.1s ease-in-out infinite; }
@keyframes sos { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--alarm) 60%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.agent.s-help, .turn.s-help { border-color: var(--alarm); box-shadow: inset 0 0 0 1px var(--alarm), 0 0 0 4px color-mix(in srgb, var(--alarm) 12%, transparent); }
.help-box { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--alarm) 8%, var(--surface)); font-size: 13px; }
.help-box p { margin: 0; }
.help-box .btn { justify-self: start; }
.help-q { padding: 12px 14px; border-radius: 10px; background: var(--canvas); }
.help-q p { margin: 4px 0 0; }
.btn.alarm { background: var(--alarm); border-color: var(--alarm); color: #fff; }
.help-row .btn { pointer-events: none; }
.muted-s { font-size: 12px; color: var(--faint); }

/* свёрнутые карточки агентов */
.agent { gap: 10px; padding: 0; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.agent > .agent-state, .agent > .help-box { margin: 0 16px; }
.agent > .agent-state { margin-bottom: 14px; }
.agent > .help-box { margin-bottom: 14px; margin-top: -4px; }
.agent-head { display: flex; gap: 12px; align-items: center; width: 100%; min-width: 0; padding: 14px 14px 0 16px; border: none; background: none; text-align: left; color: inherit; cursor: pointer; }
.agent-head .agent-id { flex: 1; min-width: 0; display: grid; }
.agent-head .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-head .kind { font: 400 11.5px/1.3 var(--mono); color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-head .kind b { color: var(--ink); font-weight: 500; }
.chev { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--faint); flex: none; transition: transform .3s var(--ease), background .12s, color .12s; }
.agent-head:hover .chev { background: var(--sunk); color: var(--ink); }
.agent.open .chev { transform: rotate(180deg); }
.agent-state .detail { -webkit-line-clamp: 1; }
.agent.open .agent-state .detail { -webkit-line-clamp: 3; }
.agent-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .36s var(--ease); }
.agent.open .agent-more { grid-template-rows: 1fr; }
.agent-more-in { min-height: 0; overflow: hidden; display: grid; gap: 12px; padding: 0 16px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .3s var(--ease), padding .36s var(--ease); }
.agent.open .agent-more-in { opacity: 1; transform: none; padding: 0 16px 16px; transition-delay: .06s; }
.agent > .agent-more { margin-top: -10px; }
.agent .agent-desc { display: block; -webkit-line-clamp: unset; }
.mini-lim { display: grid; gap: 3px; width: 44px; flex: none; }
.ml { display: block; height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; }
.ml i { display: block; height: 100%; background: var(--pass); }
.ml.high i { background: var(--amber); } .ml.full i { background: var(--alarm); }

/* мини-статистика */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.ms { display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; text-align: left; position: relative; overflow: hidden; }
.view.enter .ms, #miniStats.anim .ms { animation: viewIn .4s var(--ease) both; }
.ms:nth-child(2) { animation-delay: .04s; } .ms:nth-child(3) { animation-delay: .08s; } .ms:nth-child(4) { animation-delay: .12s; } .ms:nth-child(5) { animation-delay: .16s; }
.ms-n { font: 600 26px/1 var(--display); letter-spacing: -.02em; }
.ms.pass .ms-n { color: var(--pass); } .ms.alarm .ms-n { color: var(--alarm); }
.ms-l { font-size: 12.5px; color: var(--graphite); }
.ms-sub { font-size: 11.5px; color: var(--faint); }
.ms-sub b { color: var(--ink); }
.ms.more { place-content: center; color: var(--graphite); cursor: pointer; border-style: dashed; background: none; }
.ms.more:hover { color: var(--ink); border-color: var(--faint); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; margin-top: 4px; }
.spark i { flex: 1; background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 1.5px; transform-origin: bottom; }
.view.enter .spark i, #miniStats.anim .spark i { animation: grow .6s var(--ease) both; }
.ms.pass .spark i { background: color-mix(in srgb, var(--pass) 55%, transparent); }
.spark i:last-child { background: var(--ink); } .ms.pass .spark i:last-child { background: var(--pass); }
.spark i.z { opacity: .4; }
@keyframes grow { from { transform: scaleY(0); } }
.stats { display: grid; gap: 14px; max-width: 1180px; }
.mini-stats.big { margin-bottom: 0; }
.panel { padding: 18px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; display: grid; gap: 12px; align-content: start; }
.panel-h { display: flex; align-items: center; gap: 10px; font: 600 14px/1.2 var(--display); flex-wrap: wrap; }
.legend { margin-left: auto; display: flex; gap: 6px 14px; align-items: center; font: 400 12px/1 var(--body); color: var(--graphite); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; }
.chart { position: relative; }
.bars { width: 100%; height: 220px; display: block; overflow: visible; border-bottom: 1px solid var(--rule); }
.bars rect { transform-box: fill-box; transform-origin: bottom; }
.view.enter .bars rect { animation: grow .7s var(--ease) both; }
.bars .hit { fill: transparent; animation: none; }
.bars .day:hover .hit { fill: var(--sunk); }
.bars .day.today .hit { fill: color-mix(in srgb, var(--human) 6%, transparent); }
.b-created { fill: color-mix(in srgb, var(--graphite) 35%, transparent); background: color-mix(in srgb, var(--graphite) 35%, transparent); }
.b-sub { fill: var(--chatgpt); background: var(--chatgpt); }
.b-ok { fill: var(--pass); background: var(--pass); }
.xt { position: relative; height: 22px; font: 400 11px/1 var(--mono); color: var(--faint); }
.xt span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; }
.stats-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.stack i { transform-origin: left; }
.view.enter .stack i, .view.enter .ag-bar i { animation: growX .7s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }
.stack-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--graphite); }
.stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend i { width: 9px; height: 9px; border-radius: 3px; }
.stack-legend b { color: var(--ink); font-weight: 600; }
.st-todo { background: color-mix(in srgb, var(--graphite) 40%, transparent); } .st-in_progress { background: var(--pass); } .st-review { background: var(--chatgpt); } .st-changes_requested { background: var(--amber); } .st-blocked { background: var(--alarm); }
.ag-row { display: grid; grid-template-columns: auto minmax(0, 120px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.ag-row .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-bar { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.ag-bar i { display: block; height: 100%; border-radius: 4px; transform-origin: left; }
.ag-n { font: 400 12px/1 var(--mono); color: var(--graphite); white-space: nowrap; }

/* 3D-офис */
.app.office-mode .view { padding: 0 16px 16px; display: flex; }
.office { position: relative; flex: 1; min-height: 480px; border-radius: 16px; overflow: hidden; background: #0d1420; border: 1px solid var(--rule); user-select: none; }
.office canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.office canvas:active { cursor: grabbing; }
.office-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #9fb0c8; font-size: 14px; }
.o-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.o-tag { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 4px; pointer-events: auto; cursor: pointer; will-change: transform; }
.o-name { font: 600 11px/1 var(--body); color: #fff; background: rgba(12,16,24,.72); padding: 4px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.o-name i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.o-bubble { font: 600 11px/1.2 var(--body); padding: 6px 9px; border-radius: 10px 10px 10px 3px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: bob 2.4s ease-in-out infinite; }
.o-bubble.help { background: var(--alarm); color: #fff; animation: bob 1s ease-in-out infinite, sosGlow 1s ease-in-out infinite; }
.o-bubble.due { background: var(--amber); color: #1a1200; }
.o-bubble.review { background: #e9f0ff; color: #1b3d86; }
.o-bubble.limited { background: #2a2f3a; color: #ffb4ab; }
.o-bubble.working { background: rgba(255,255,255,.92); color: #14171f; font-weight: 500; }
.o-tag.sel .o-name { background: #fff; color: #14171f; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes sosGlow { 50% { box-shadow: 0 0 0 6px rgba(212,72,59,.25), 0 6px 18px rgba(0,0,0,.35); } }
.o-hud { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.o-hud span { font: 500 11.5px/1 var(--body); color: #e8eef8; background: rgba(12,16,24,.6); padding: 6px 10px; border-radius: 99px; backdrop-filter: blur(4px); }
.o-hud b { font-weight: 700; }
.o-clock { position: absolute; right: 14px; top: 14px; font: 600 13px/1 var(--mono); color: #e8eef8; background: rgba(12,16,24,.6); padding: 7px 11px; border-radius: 99px; pointer-events: none; }
.o-panel { position: absolute; right: 14px; bottom: 14px; top: 52px; width: min(340px, calc(100% - 28px)); background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-float); padding: 16px; overflow-y: auto; display: grid; gap: 12px; align-content: start; animation: panelIn .3s var(--spring); }
@keyframes panelIn { from { opacity: 0; transform: translateX(24px); } }
.o-panel .x { position: absolute; right: 10px; top: 10px; }
.o-panel .o-top { display: flex; gap: 10px; align-items: center; padding-right: 30px; }
.o-panel .o-top .nm { font-weight: 600; }
.o-panel .o-top .kind { font: 400 11.5px/1.3 var(--mono); color: var(--graphite); }
.o-panel .o-tasks { display: grid; gap: 6px; }
.o-panel .o-task { display: grid; gap: 2px; text-align: left; border: 1px solid var(--rule); background: var(--canvas); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; }
.o-panel .o-task:hover { border-color: var(--faint); }
.o-panel .o-task small { color: var(--graphite); font-family: var(--mono); font-size: 11px; }
.o-panel .sec-h { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.o-legend { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 380px); pointer-events: none; }
.o-legend span { font: 400 11px/1 var(--body); color: #c9d4e6; background: rgba(12,16,24,.55); padding: 5px 9px; border-radius: 99px; }
@media (max-width: 900px) { .o-legend { display: none; } .office { min-height: 420px; } }
.agent-grid { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.agent-grid > .agent { margin-bottom: 0; }
.ymax { position: absolute; left: 0; top: -2px; font: 400 11px/1 var(--mono); color: var(--faint); }
.chart { padding-top: 14px; } .chart::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; border-top: 1px dashed var(--rule); }

/* ═════════ 1.5: офис — компактные метки, мобильная версия ═════════ */
.office { background: linear-gradient(180deg, #a9c9ea 0%, #dbe7f2 100%); }
.office.dusk { background: linear-gradient(180deg, #3b4a8a 0%, #e8a07a 100%); }
.office.night { background: radial-gradient(ellipse at 50% 0%, #1b2a4f 0%, #070b16 70%); }
.o-labels { z-index: 1; }
.o-hud, .o-clock, .o-legend { z-index: 3; }
.o-panel { z-index: 5; }
.o-tag { gap: 3px; transition: opacity .2s; }
.o-name { display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px/1 var(--body); padding: 4px 7px 4px 6px; background: rgba(12,16,24,.62); }
.o-name i.dot, .o-legend i.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0; flex: none; background: #8a93a6; }
.dot.working { background: #2ecc71 !important; box-shadow: 0 0 0 2px rgba(46,204,113,.3); }
.dot.due { background: #f5a623 !important; }
.dot.help { background: #ff4d4f !important; animation: sos 1s ease-in-out infinite; }
.dot.review { background: #5b8def !important; }
.dot.limited { background: #ff7a59 !important; }
.dot.offline { background: #55606f !important; }
.o-tag.s-offline .o-name { opacity: .75; }
.o-badge { font: 800 9.5px/1 var(--body); padding: 2px 5px; border-radius: 99px; margin-left: 1px; }
.o-badge.help { background: #ff4d4f; color: #fff; animation: bob 1s ease-in-out infinite; }
.o-badge.due { background: #f5a623; color: #1a1200; }
.o-badge.limited { background: #ffd84d; color: #3a2a00; }
.o-tip { display: none; max-width: 260px; font: 500 11.5px/1.35 var(--body); color: #14171f; background: #fff; padding: 7px 10px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); white-space: normal; text-align: left; }
.o-tag.hov .o-tip, .o-tag.sel .o-tip { display: block; animation: panelIn .18s var(--ease); }
.o-tag.hov .o-name, .o-tag.sel .o-name { background: #fff; color: #14171f; }
.o-hud .sos { background: #D4483B; }
.o-legend span { display: inline-flex; align-items: center; gap: 6px; }
.o-grab { display: none; }
@media (max-width: 700px) {
  .app.office-mode .view { padding: 0 8px 8px; }
  .office { min-height: calc(100dvh - 150px); border-radius: 12px; }
  .o-hud { left: 8px; top: 8px; right: 70px; }
  .o-hud span { font-size: 10.5px; padding: 5px 8px; }
  .o-clock { right: 8px; top: auto; bottom: 8px; font-size: 11px; padding: 6px 8px; }
  .o-hud { right: 8px; }
  .o-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 62%; border-radius: 16px 16px 0 0; animation: sheetIn .3s var(--spring); }
  .o-grab { display: block; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: -6px 0 2px; }
  .o-tip { max-width: 200px; }
  .app.office-mode .topbar { padding: 14px 12px 10px; }
  .app.office-mode .sub { display: none; }
}
@keyframes sheetIn { from { transform: translateY(40%); opacity: 0; } }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 8px; vertical-align: 1px; background: var(--faint); }
.live-dot.on { background: var(--pass); animation: beat 2.4s ease-in-out infinite; }
.live-dot.off { background: var(--amber); }

/* ═════════ 1.6: точки вместо табличек, переключатель офисов ═════════ */
.office canvas { cursor: grab; }
.office canvas.grabbing { cursor: grabbing; }
.o-tag { gap: 4px; }
.o-pin { display: block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); background: #8a93a6; }
.o-pin.working { animation: pinPulse 1.8s ease-in-out infinite; }
.o-pin.help { width: 14px; height: 14px; animation: sos 1s ease-in-out infinite; }
@keyframes pinPulse { 50% { box-shadow: 0 0 0 5px rgba(46,204,113,.25), 0 2px 6px rgba(0,0,0,.35); } }
.office:not(.names) .o-tag:not(.hov):not(.sel):not(.s-help) .o-name { display: none; }
.o-tag .o-name { font: 600 11px/1 var(--body); padding: 5px 9px 5px 7px; background: rgba(255,255,255,.94); color: #14171f; border: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); backdrop-filter: none; }
.o-tag.s-help .o-name { background: #ff4d4f; color: #fff; }
.o-tag .o-name i.dot { width: 8px; height: 8px; }
.o-switch { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; display: flex; gap: 2px; padding: 3px; background: rgba(12,16,24,.55); border-radius: 11px; backdrop-filter: blur(6px); max-width: calc(100% - 340px); overflow-x: auto; scrollbar-width: none; }
.o-switch button { border: none; background: none; color: #e8eef8; font: 500 12px/1 var(--body); padding: 7px 11px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.o-switch button:hover { background: rgba(255,255,255,.14); }
.o-switch .nm-toggle { margin-left: 4px; border-left: 1px solid rgba(255,255,255,.18); border-radius: 0 8px 8px 0; }
.o-switch .nm-toggle.on { background: #fff; color: #14171f; border-radius: 8px; }
@media (max-width: 900px) { .o-switch { top: auto; bottom: 52px; max-width: calc(100% - 16px); } }
