:root{
  --bg:#F6F7F9; --surface:#FFFFFF; --surface2:#F2F4F6; --line:#E9ECEF;
  --text:#1A1F24; --muted:#6E7781;
  --accent:#1F9D66; --accent-hover:#178354; --accent-soft:#E8F6EF; --accent-ink:#FFFFFF;
  --ok:#1F9D66; --warn:#D97706; --bad:#DC2626; --idle:#8A8F98;
  --p-mint:#E8F6EF; --p-violet:#EFEBFB; --p-pink:#FDEBF1; --p-yellow:#FFF6E0;
  --chip-ok:var(--p-mint); --chip-warn:var(--p-yellow); --chip-bad:var(--p-pink); --chip-idle:var(--surface2);
  --cat1:#1F9D66; --cat2:#7C5CD9; --seg-ink:#FFFFFF;
  --s1:#3D6EC1; --s2:#C75B1F; --s3:#7B5CB8; --s4:#1F9D66; --s5:#0E7C86; --s6:#A63D82;
  --shadow-card:0 1px 3px rgba(16,24,40,.06); --shadow-card-hi:0 4px 12px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#12181E; --surface:#1A222A; --surface2:#212A32; --line:#2A343E;
    --text:#E7EBEF; --muted:#8B97A3;
    --accent:#2FB57C; --accent-hover:#3FCB8E; --accent-soft:#17281F; --accent-ink:#0B140F;
    --ok:#2FB57C; --warn:#E0A73C; --bad:#E1685F; --idle:#6E7883;
    --p-mint:#152922; --p-violet:#241F35; --p-pink:#33202A; --p-yellow:#332A15;
    --chip-ok:var(--p-mint); --chip-warn:var(--p-yellow); --chip-bad:var(--p-pink); --chip-idle:var(--surface2);
    --cat1:#2FB57C; --cat2:#9B84E8; --seg-ink:#0B140F;
    --s1:#5585D6; --s2:#CE6A2E; --s3:#9678D1; --s4:#27996B; --s5:#35A9B3; --s6:#C767A8;
    --shadow-card:0 1px 3px rgba(0,0,0,.28); --shadow-card-hi:0 4px 14px rgba(0,0,0,.36);
  }
}
:root[data-theme="dark"]{
  --bg:#12181E; --surface:#1A222A; --surface2:#212A32; --line:#2A343E;
  --text:#E7EBEF; --muted:#8B97A3;
  --accent:#2FB57C; --accent-hover:#3FCB8E; --accent-soft:#17281F; --accent-ink:#0B140F;
  --ok:#2FB57C; --warn:#E0A73C; --bad:#E1685F; --idle:#6E7883;
  --p-mint:#152922; --p-violet:#241F35; --p-pink:#33202A; --p-yellow:#332A15;
  --chip-ok:var(--p-mint); --chip-warn:var(--p-yellow); --chip-bad:var(--p-pink); --chip-idle:var(--surface2);
  --cat1:#2FB57C; --cat2:#9B84E8; --seg-ink:#0B140F;
  --s1:#5585D6; --s2:#CE6A2E; --s3:#9678D1; --s4:#27996B; --s5:#35A9B3; --s6:#C767A8;
  --shadow-card:0 1px 3px rgba(0,0,0,.28); --shadow-card-hi:0 4px 14px rgba(0,0,0,.36);
}
*{box-sizing:border-box}
body{background:var(--bg); color:var(--text); font:15px/1.5 "PT Sans",system-ui,sans-serif; margin:0; padding:0; display:flex; min-height:100vh; align-items:flex-start}

/* ── Сайдбар ─────────────────────────────────────────────────────── */
.sidebar{width:220px; flex:none; background:var(--surface); border-right:1px solid var(--line); min-height:100vh; display:flex; flex-direction:column; padding:20px 14px; position:sticky; top:0; align-self:flex-start}
.sidebar-logo{display:flex; align-items:flex-start; gap:10px; margin:0 6px 24px}
.sidebar-logo .lg-em{font-size:26px; line-height:1}
.sidebar-logo .lg-t{font:700 15px "Spectral",Georgia,serif; color:var(--text)}
.sidebar-logo .lg-s{font:11px "PT Mono",monospace; color:var(--muted); margin-top:3px; line-height:1.4}
nav.pages{display:flex; flex-direction:column; gap:3px}
nav.pages a{display:flex; align-items:center; gap:10px; font:13px "PT Sans",sans-serif; color:var(--muted); text-decoration:none; padding:10px 12px; border-radius:12px}
nav.pages a:hover{background:var(--accent-soft); color:var(--text)}
nav.pages a[hidden]{display:none} /* t32: атрибут hidden от renderNav() обязан побеждать display:flex — иначе роль видит чужие пункты */
nav.pages a.here{background:var(--accent); color:#fff; font-weight:700}
.sidebar-quote{margin-top:auto; background:var(--accent-soft); color:var(--text); font-size:12px; line-height:1.5; padding:12px 14px; border-radius:12px}
@media (max-width:900px){
  body{flex-direction:column}
  .sidebar{position:static; width:100%; min-height:auto; flex-direction:row; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 16px; border-right:0; border-bottom:1px solid var(--line)}
  .sidebar-logo{margin:0 auto 0 0}
  nav.pages{flex-direction:row; flex-wrap:wrap; gap:4px}
  .sidebar-quote{display:none}
}

.wrap{flex:1; min-width:0; max-width:1180px; margin:0; padding:22px 28px 60px}

/* ── Верхняя полоса контента ────────────────────────────────────── */
.topbar{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px}
.topbar h1{font:700 22px "Spectral",Georgia,serif; margin:0; color:var(--text)}
.topbar-right{display:flex; align-items:center; gap:14px; font:12px "PT Mono",monospace; color:var(--muted)}
#conn.live{color:var(--ok)}
#conn.err{color:var(--bad)}
#who select{border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font:12px "PT Sans",sans-serif; padding:4px 8px}
.meinfo{font:12px "PT Sans",sans-serif; color:var(--text)}
.logoutbtn{border:1px solid var(--line); border-radius:8px; background:var(--surface2); color:var(--text); font:12px "PT Sans",sans-serif; padding:4px 10px; cursor:pointer}
.logoutbtn:hover{background:var(--line)}

h2{font:600 19px "Spectral",Georgia,serif; margin:28px 0 12px; text-wrap:balance}
h2 small{font:11px "PT Mono",monospace; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; margin-left:10px}
.lines{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:16px}
.card{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px 18px; position:relative; overflow:hidden; box-shadow:var(--shadow-card)}
.card::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--stripe,var(--idle))}
.card.ok{--stripe:var(--ok)} .card.warn{--stripe:var(--warn)} .card.crit{--stripe:var(--bad)} .card.idle{--stripe:var(--idle)}
.card .nm{font-weight:700}
.card .own{font:11px "PT Mono",monospace; color:var(--muted); margin:2px 0 8px}
.card .hl{font-size:13.5px}
.card .upd{font:11px "PT Mono",monospace; color:var(--muted); margin-top:8px}
.card .metric{font:13px "PT Mono",monospace; margin-top:8px; color:var(--text)}
.card.crit .metric{color:var(--bad); font-weight:700}
.accounts{background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card)}
.accounts .arow{display:flex; gap:12px; padding:13px 18px; border-top:1px solid var(--line); align-items:baseline}
.accounts .arow:first-child{border-top:0}
.accounts .dot{width:9px; height:9px; border-radius:50%; flex:none; align-self:center}
.accounts .ok .dot{background:var(--ok)} .accounts .warn .dot{background:var(--warn)} .accounts .crit .dot{background:var(--bad)}
.accounts .at{flex:1; min-width:0}
.accounts .at .ti{font-weight:700}
.accounts .at .de{font-size:13px; color:var(--muted)}
.accounts .crit .at .de{color:var(--bad)}
.accounts .m{font:13px "PT Mono",monospace; white-space:nowrap}
.accounts .crit .m{color:var(--bad); font-weight:700}
.cols{display:grid; grid-template-columns:minmax(0,7fr) minmax(0,5fr); gap:24px; align-items:start}
@media (max-width:900px){.cols{grid-template-columns:1fr}}
.dec{background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card)}
.dec .row{display:flex; gap:12px; padding:14px 18px; border-top:1px solid var(--line); align-items:flex-start}
.dec .row:first-child{border-top:0}
.dec .n{font:13px "PT Mono",monospace; color:var(--muted); min-width:22px; padding-top:2px}
.dec .t{flex:1; min-width:0}
.dec .t .ti{font-weight:700}
.dec .t .de{font-size:13px; color:var(--muted); margin-top:2px}
.dec .t .res{font-size:13px; margin-top:6px; padding:7px 10px; background:var(--surface2); border-radius:10px}
.chip{font:11px "PT Sans",sans-serif; font-weight:700; padding:4px 10px; border-radius:20px; white-space:nowrap; align-self:flex-start; margin-top:2px}
.chip.open{background:var(--chip-warn); color:var(--warn)}
.chip.accepted{background:var(--chip-ok); color:var(--ok)}
.chip.declined{background:var(--chip-bad); color:var(--bad)}
.chip.discuss{background:var(--chip-idle); color:var(--muted)}
.acts{display:flex; gap:6px; margin-top:8px; flex-wrap:wrap}
.acts button, .send{font:12px "PT Sans",sans-serif; border:1px solid var(--line); background:var(--surface2); color:var(--text); border-radius:10px; padding:6px 12px; cursor:pointer}
.acts button:hover{border-color:var(--accent)}
.acts button:focus-visible, .send:focus-visible, textarea:focus-visible, input:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.acts .ok-b{color:var(--ok)} .acts .no-b{color:var(--bad)}
.panel{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px 18px; box-shadow:var(--shadow-card)}
textarea, input[type=text], input[type=password], input[type=date]{width:100%; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); font:14px "PT Sans",sans-serif; padding:9px 10px}
textarea{min-height:74px; resize:vertical}
.frow{display:flex; gap:8px; margin-top:8px; align-items:center}
.frow input{max-width:180px}
.send{background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:700; padding:8px 18px}
.send:hover:not(:disabled){background:var(--accent-hover); border-color:var(--accent-hover)}
.send:disabled{opacity:.5; cursor:default}
.hint{font:12px "PT Mono",monospace; color:var(--muted); margin-top:8px}

/* ── Чат: голосовой ввод — кнопка-микрофон рядом с textarea (слово Дмитрия
   12.09). Красная точка пульсирует, пока идёт запись — переиспользуем
   @keyframes hqpulse, объявленный ниже у .pulse (порядок в CSS не важен). ── */
.ctextrow{display:flex; gap:8px; align-items:center}
.ctextrow textarea{flex:1; min-width:0}
.micbtn{flex:none; width:40px; height:40px; border:1px solid var(--line); background:var(--surface2); color:var(--text); border-radius:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:17px; line-height:1; padding:0; position:relative}
.micbtn:hover:not(:disabled){border-color:var(--accent)}
.micbtn:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.micbtn:disabled{opacity:.5; cursor:default}
.micbtn.on{background:var(--accent); border-color:var(--accent); color:var(--accent-ink)}
.micdot{display:none; position:absolute; top:4px; right:4px; width:8px; height:8px; border-radius:50%; background:var(--bad); animation:hqpulse 1.1s ease-in-out infinite}
.micbtn.on .micdot{display:block}
@media(prefers-reduced-motion:reduce){.micdot{animation:none}}
.micinterim{font:13px "PT Sans",sans-serif; color:var(--muted); font-style:italic; margin-top:6px; padding:0 2px; white-space:pre-wrap; word-break:break-word}
.micerr{font:12px "PT Mono",monospace; color:var(--bad); margin-top:6px}

.msg{border-top:1px solid var(--line); padding:10px 2px}
.msg:first-child{border-top:0}
.msg .mh{font:11px "PT Mono",monospace; color:var(--muted); display:flex; gap:8px}
.msg .mh .who{color:var(--accent)}
.msg .mb{margin-top:3px; white-space:pre-wrap}
.msg.done .mh .st{color:var(--ok)}
.feed .msg .mb{font-size:13.5px}
.empty{color:var(--muted); font-size:13px; padding:10px 2px}
.tiles{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:12px 0}
@media(max-width:900px){.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
.tile{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:12px 14px; box-shadow:var(--shadow-card); display:flex; gap:10px; align-items:center; height:86px}
.tile:hover{box-shadow:var(--shadow-card-hi)}
.tile .tico{width:36px; height:36px; flex:none; border-radius:10px; background:var(--surface2); display:flex; align-items:center; justify-content:center; font-size:16px}
.tile.mint .tico{background:var(--p-mint)} .tile.violet .tico{background:var(--p-violet)} .tile.pink .tico{background:var(--p-pink)} .tile.yellow .tico{background:var(--p-yellow)}
.tile .tbody{min-width:0}
.tile .tv{font:700 22px "Spectral",Georgia,serif; font-variant-numeric:tabular-nums}
.tile .tl{font:12px "PT Sans",sans-serif; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tile .td{font-size:11px; color:var(--muted); margin-top:3px}
.tile.na .tv{color:var(--idle)}
.chatbox{background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card); display:flex; flex-direction:column; height:60vh; min-height:360px}
.chatlog{flex:1; overflow-y:auto; padding:10px 16px}
.chatform{border-top:1px solid var(--line); padding:12px 16px}
.rule{font-size:13px; color:var(--muted); background:var(--surface2); border-radius:10px; padding:8px 10px; margin-bottom:12px}
.viz{background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card); padding:12px 16px; overflow-x:auto}
.viz svg{display:block; width:100%; max-width:760px; height:auto; margin:0 auto}
.viz .edges line{stroke:var(--line); stroke-width:2}
.viz .edges text{fill:var(--muted); font:10px "PT Mono",monospace; text-anchor:middle}
.viz .node circle{stroke:var(--surface); stroke-width:2}
.viz .node.ok circle{fill:var(--ok)} .viz .node.warn circle{fill:var(--warn)} .viz .node.crit circle{fill:var(--bad)} .viz .node.idle circle{fill:var(--idle)}
.viz .node text{text-anchor:middle}
.viz .node .nm{fill:var(--text); font:700 12.5px "PT Sans",sans-serif}
.viz .node .sub{fill:var(--muted); font:10px "PT Mono",monospace}
.finrow{margin:12px 0}
.finlabel{font-weight:700; font-size:13.5px; margin-bottom:5px}
.finbar{display:flex; gap:2px; height:30px; border-radius:10px; overflow:hidden; background:var(--surface2)}
.finbar .seg{display:flex; align-items:center; padding:0 8px; font:11px "PT Mono",monospace; color:var(--seg-ink); white-space:nowrap; overflow:hidden; border-radius:2px}
.finbar .seg.c1{background:var(--cat1)} .finbar .seg.c2{background:var(--cat2)} .finbar .seg.w{background:var(--bad)}
.finbar .rest{display:flex; align-items:center; padding:0 8px; font:11px "PT Mono",monospace; color:var(--muted)}
.finnote{font:11px "PT Mono",monospace; color:var(--muted); margin-top:4px}
footer{margin-top:44px; font:11px "PT Mono",monospace; color:var(--muted); text-align:center}
.tsec{font:700 12px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; padding:10px 14px 4px; border-top:1px solid var(--line)} .tsec:first-child{border-top:0}

.strip{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.schip{font:12px "PT Sans",sans-serif;font-weight:600;padding:5px 12px;border-radius:20px;background:var(--surface2)}
.schip.ok{background:var(--chip-ok);color:var(--ok)} .schip.warn{background:var(--chip-warn);color:var(--warn)} .schip.crit{background:var(--chip-bad);color:var(--bad);font-weight:700} .schip.idle{background:var(--chip-idle);color:var(--muted)}
.deck{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start} @media(max-width:1000px){.deck{grid-template-columns:1fr}}
.deck-main{display:flex;flex-direction:column;gap:16px;min-width:0} .deck-side{display:flex;flex-direction:column;gap:16px;min-width:0}
h3{font:600 15px "Spectral",Georgia,serif;margin:0 0 8px} .alllink{font:11px "PT Sans",sans-serif;color:var(--accent);text-decoration:none;margin-left:8px}
.trow{display:flex;align-items:center;gap:8px;padding:7px 8px;border-top:1px solid var(--line);font-size:13.5px} .trow:first-child{border-top:0} .trow .tdone{width:22px;height:22px;flex:none;border:1px solid var(--line);border-radius:10px;background:var(--surface2);cursor:pointer;color:var(--ok)} .trow .tt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .trow .tmeta{font:11px "PT Mono",monospace;color:var(--muted);white-space:nowrap} .trow.late .tt{color:var(--bad)}
.pane{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px 18px;box-shadow:var(--shadow-card)}
.chatbox.compact{height:340px;min-height:280px}
.compactfeed .msg{padding:6px 2px} .compactfeed .mb{font-size:12.5px;max-height:70px;overflow:hidden}
.lrow{display:flex;align-items:center;gap:8px;padding:6px 2px;font-size:13.5px} .lrow .dot{width:9px;height:9px;border-radius:50%;flex:none} .lrow .dot.ok{background:var(--ok)} .lrow .dot.warn{background:var(--warn)} .lrow .dot.crit{background:var(--bad)} .lrow .dot.idle{background:var(--idle)} .lrow .ln{font-weight:700} .lrow .lown{font:11px "PT Mono",monospace;color:var(--muted)}
.taskform{display:flex;gap:6px;margin-bottom:8px} .taskform input[type=text]{min-width:0} .taskform #ttitle{flex:2} .taskform #tassignee{flex:1;max-width:110px} .taskform #tdue{max-width:130px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font:12px "PT Sans",sans-serif;padding:7px} .taskform #taddbtn{flex:none;width:34px;font-weight:700}

.bandtitle{margin-top:16px} .prods{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px;margin:8px 0 4px} .prod{display:flex;gap:10px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 14px;box-shadow:var(--shadow-card)} .prod .pdot{width:14px;height:14px;border-radius:50%;flex:none} .prod.ok .pdot{background:var(--ok);box-shadow:0 0 0 4px var(--chip-ok)} .prod.crit .pdot{background:var(--bad);box-shadow:0 0 0 4px var(--chip-bad)} .prod .pn{font-weight:700;font-size:13.5px} .prod .pm{font:11px "PT Mono",monospace;color:var(--muted)} .tabs{display:flex;gap:4px;margin-bottom:8px} .tab{font:12px "PT Sans",sans-serif;border:1px solid var(--line);background:var(--surface2);color:var(--muted);border-radius:10px;padding:5px 14px;cursor:pointer;text-decoration:none;display:inline-block} .tab.active{color:#fff;background:var(--accent);border-color:var(--accent);font-weight:700} .dg{border-top:1px solid var(--line);padding:8px 2px} .dg:first-child{border-top:0} .dgh{font:11px "PT Mono",monospace;color:var(--muted)} .dgb{font-size:13px;margin-top:2px} .chatform select{border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font:13px "PT Sans",sans-serif;padding:7px}
.plan{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px 16px;margin-bottom:12px;box-shadow:var(--shadow-card)} .plan .ph{display:flex;align-items:center;gap:8px;margin-bottom:8px} .plan .ph .dot{width:10px;height:10px;border-radius:50%} .plan .ph .dot.ok{background:var(--ok)}.plan .ph .dot.warn{background:var(--warn)}.plan .ph .dot.crit{background:var(--bad)}.plan .ph .dot.idle{background:var(--idle)} .pcols{display:grid;grid-template-columns:1fr 1fr;gap:16px} @media(max-width:700px){.pcols{grid-template-columns:1fr}} .pt{font:700 11px "PT Mono",monospace;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:4px} .plan ul{margin:0;padding-left:18px;font-size:13.5px} .plan li{margin:3px 0}

.crew{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px;margin-bottom:20px} .crew-card{display:flex;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:14px;box-shadow:var(--shadow-card)} .crew-card .ava{width:56px;height:56px;flex:none} .crew-card .ava img{width:56px;height:56px;border-radius:50%;object-fit:cover;display:block} .ava-letter{display:flex;width:56px;height:56px;border-radius:50%;align-items:center;justify-content:center;font:700 22px "Spectral",Georgia,serif;color:#fff} .crew-card .cn{font-weight:700} .crew-card .cr{font-size:12px;color:var(--muted);margin:1px 0 6px} .crew-card .st{font:11px "PT Mono",monospace;display:inline-flex;align-items:center;gap:5px} .crew-card .st.busy{color:var(--warn)} .crew-card .st.free{color:var(--ok)} .pulse{width:8px;height:8px;border-radius:50%;background:currentColor;animation:hqpulse 2s ease-in-out infinite} @media(prefers-reduced-motion:reduce){.pulse{animation:none}} @keyframes hqpulse{0%,100%{opacity:1}50%{opacity:.35}} .crew-card .bt{display:block;font-size:12px;color:var(--text);margin-top:2px}

.res.ceo{border-left:3px solid var(--accent); background:var(--accent-soft)}

.crew-card .st.off{color:var(--muted)}

.crew-write{display:inline-block; margin-top:8px; font:12px "PT Sans",sans-serif; color:var(--accent); text-decoration:none; border:1px solid var(--line); border-radius:10px; padding:5px 12px}
.crew-write:hover{border-color:var(--accent); background:var(--accent-soft)}

.mh .dstat{margin-left:auto; font:11px "PT Mono",monospace}
.mh .dstat.pending{color:var(--warn)}
.mh .dstat.done{color:var(--ok)}

.prod.big{align-items:flex-start} .prod.big .pdot{margin-top:4px} .prod .pbody{min-width:0;flex:1} .prod .pagents{font:11px "PT Mono",monospace;color:var(--warn);margin-top:6px}
.prods{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}

.pagents.quiet{color:var(--muted)}

.asks{background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card)}
.ask{padding:14px 18px; border-top:1px solid var(--line)}
.ask:first-child{border-top:0}
.askt{font-weight:700}
.askd{font-size:13px; color:var(--muted); margin-top:2px}
.askform{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; align-items:flex-end}
.askform textarea{flex:1; min-width:220px; min-height:44px}
.askform .send{flex:none}
.askans{font-size:13px; margin-top:6px; padding:7px 10px; background:var(--surface2); border-radius:10px}
.ask.done .askt{color:var(--muted)}
.askdone-row{padding:10px 18px; border-top:1px solid var(--line); font:12px "PT Mono",monospace; color:var(--muted); cursor:pointer}
.askdone-row:hover{color:var(--text)}
.askdone-list .ask{background:var(--surface2)}

/* ── Мои задачи: единый блок (вопросы + решения + задачи Дмитрия) ── */
.wi{padding:14px 18px; border-top:1px solid var(--line)}
.wi:first-child{border-top:0}
.wih{margin-bottom:4px; display:flex; gap:6px; align-items:center; flex-wrap:wrap}
.tchip{font:11px "PT Sans",sans-serif; font-weight:700; padding:3px 10px; border-radius:20px; display:inline-block}
.tchip.mint{background:var(--p-mint); color:var(--ok)}
.tchip.violet{background:var(--p-violet); color:var(--cat2)}
.tchip.yellow{background:var(--p-yellow); color:var(--warn)}
.wit{font-weight:700}
.wid{font-size:13px; color:var(--muted); margin-top:2px}
.wid details.inl{display:inline}
.wid details.inl summary{display:inline; cursor:pointer; color:var(--accent); font-weight:600; list-style:none}
.wid details.inl summary::-webkit-details-marker{display:none}
.wi .res{font-size:13px; margin-top:6px; padding:7px 10px; background:var(--surface2); border-radius:10px}
.decres{margin-top:8px}
.decres textarea{min-height:40px}
.wclosed-row{padding:10px 18px; border-top:1px solid var(--line); font:12px "PT Mono",monospace; color:var(--muted); cursor:pointer}
.wclosed-row:hover{color:var(--text)}
.wclosed-list .wi{background:var(--surface2)}

/* ── Главная: «Мои задачи» в нижнем ряду левой зоны — две колонки карточек,
   каждая со своей границей (было: единый список с border-top-разделителями) ── */
#mywork{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; background:none; border:none; box-shadow:none; border-radius:0}
#mywork .wi{border-top:none; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px 18px; box-shadow:var(--shadow-card)}
#mywork .wclosed-list{grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px}
#mywork .wclosed-row, #mywork .empty{grid-column:1 / -1}
@media(max-width:900px){
  #mywork{grid-template-columns:minmax(0,1fr)}
  #mywork .wclosed-list{grid-template-columns:minmax(0,1fr)}
}

/* ── Главная: hero-баннер (аватар + приветствие + мини-виджеты дата/линии) ── */
.hero{background:linear-gradient(135deg, var(--accent-soft), var(--surface) 72%); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-card); padding:18px 22px; display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; margin-bottom:0}
.hero-left{display:flex; align-items:center; gap:14px; min-width:0}
.hero-ava{width:72px; height:72px; border-radius:50%; flex:none; overflow:hidden; box-shadow:var(--shadow-card)}
.hero-ava img{width:100%; height:100%; object-fit:cover; display:block}
.hero-text{min-width:0}
.hero-greet{font:700 24px "Spectral",Georgia,serif; color:var(--text)}
.hero-quote{font:12.5px "PT Sans",sans-serif; color:var(--muted); margin-top:4px}
.hero-widgets{display:flex; gap:10px; flex:none}
.hw-card{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:10px 16px; min-width:96px; text-align:center; box-shadow:var(--shadow-card)}
.hw-num{font:700 24px "Spectral",Georgia,serif; color:var(--text); font-variant-numeric:tabular-nums}
.hw-sub{font:11px "PT Sans",sans-serif; color:var(--muted); margin-top:2px; text-transform:capitalize; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px}
.strip.mini{margin:10px 0 4px; gap:6px}
.strip.mini .schip{padding:3px 10px; font-size:11px}
.widget-sub{font:11px "PT Mono",monospace; color:var(--muted); margin:-4px 0 8px}

/* ── Главная: продукт за сутки — компактный виджет-список (строка + точечный
   лидер + число), источник вынесен один раз в подпись заголовка ──────── */
.metrics{display:flex; flex-direction:column; gap:0; margin:0}
.mrow{display:flex; align-items:baseline; gap:6px; padding:6px 0; font-size:13px; border-top:1px solid var(--line)}
.mrow:first-child{border-top:0}
.mrow .ml{color:var(--text)}
.mrow .mfill{flex:1; border-bottom:1px dotted var(--line); margin:0 2px; align-self:center; transform:translateY(-3px)}
.mrow .mv{flex:none; font:700 13px "PT Mono",monospace; font-variant-numeric:tabular-nums}
.mrow-sub{font:700 11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:10px 0 2px; border-top:1px solid var(--line)}
.mrow-sub:first-child{border-top:0}

/* доводка приёмки: суффикс единиц в крупном значении метрики */
.tvs{font-size:14px;font-weight:600;color:var(--muted)}

/* ── Главная: график «Динамика» — переключатели, SVG-линии, легенда, тултип ── */
.chartpanel{margin:8px 0 16px}
.charttabs{display:flex; flex-wrap:wrap; gap:14px 20px; margin-bottom:12px}
.chartwrap{position:relative}
.cchart-svg{width:100%; height:200px; display:block}
.cgrid{stroke:var(--line); stroke-width:1}
.caxis{fill:var(--muted); font:11px "PT Mono",monospace}
.caxis.cy{text-anchor:end}
.caxis.cx{text-anchor:middle}
.cline{fill:none; stroke-width:2}
.cpt{stroke:var(--surface); stroke-width:1}
.ccross{stroke:var(--muted); stroke-width:1; stroke-dasharray:3 3}
.chartempty{padding:70px 0; text-align:center; font-size:13px}
.chartlegend{display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:12px; font-size:12.5px; color:var(--text)}
.clg{display:inline-flex; align-items:center; gap:6px}
.clg-empty{color:var(--muted); opacity:.7}
.cdot{width:9px; height:9px; border-radius:50%; flex:none; display:inline-block}
.charttip{position:absolute; pointer-events:none; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow-card-hi); padding:8px 10px; font-size:12px; min-width:150px; z-index:5}
.ctipday{font:700 11px "PT Mono",monospace; color:var(--muted); margin-bottom:5px}
.ctiprow{display:flex; align-items:center; gap:6px; padding:1.5px 0; white-space:nowrap}
.ctiprow b{margin-left:auto; padding-left:10px; font-variant-numeric:tabular-nums}

/* ── Главная: «Себестоимость такта» — стат-ряд последнего дня, разбивка по
   видам, сверка со счётчиком релея, две мини-диаграммы по дням (столбики +
   линия, каждая на своей оси — см. правило в renderTaktCost/renderMiniChart
   hq.js: разный масштаб $всего/$среднее не сводим в одну ось) и сворачиваемая
   таблица обращений последнего дня (тот же приём "wclosed-row", что у «Мои
   задачи»). ──────────────────────────────────────────────────────────── */
.tcost-stats{display:flex; flex-wrap:wrap; gap:10px; margin:6px 0 10px}
.tcost-stat{background:var(--surface2); border-radius:12px; padding:8px 14px; text-align:center; min-width:84px}
.tcost-stat-num{font:700 17px "Spectral",Georgia,serif; color:var(--text); font-variant-numeric:tabular-nums}
.tcost-stat-sub{font:11px "PT Sans",sans-serif; color:var(--muted); margin-top:2px}
.tcost-vidrow{display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12.5px; margin-bottom:8px}
.tcost-vidrow b{font-weight:700}
.tcost-bad{background:var(--chip-bad); color:var(--bad); font-weight:700; font-size:12.5px; border-radius:10px; padding:8px 12px; margin-bottom:8px}
.tcost-sverka{display:flex; flex-wrap:wrap; gap:6px 18px; font:12px "PT Mono",monospace; color:var(--muted); margin-bottom:10px}
.tcost-sverka b{color:var(--text)}
.tcost-minicharts{display:flex; flex-wrap:wrap; gap:16px; margin-bottom:4px}
.tcost-mini{flex:1 1 220px; min-width:200px}
.tcost-mini-title{font:11px "PT Mono",monospace; color:var(--muted); margin-bottom:2px}
.tcost-minicharts .cchart-svg{height:110px}
.tcost-minicharts .cbar{opacity:.85}
.tcost-table-wrap{background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow-x:auto; margin-top:2px}
table.tcosttable{width:100%; border-collapse:collapse; font-size:12.5px; min-width:600px}
table.tcosttable th{text-align:left; font:700 11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:8px 10px; border-bottom:1px solid var(--line); white-space:nowrap}
table.tcosttable td{padding:7px 10px; border-top:1px solid var(--line); white-space:nowrap}
table.tcosttable tr:first-child td{border-top:0}

/* ── Календарь по исполнителям ──────────────────────────────────── */
.calnav{display:inline-flex; align-items:center; gap:8px; font:13px "PT Sans",sans-serif; color:var(--muted); margin-left:10px; vertical-align:middle}
.calnav button{border:1px solid var(--line); background:var(--surface2); color:var(--text); border-radius:8px; width:26px; height:26px; cursor:pointer; line-height:1}
.calnav button:hover{border-color:var(--accent)}
.calnav #calmonth{min-width:120px; display:inline-block; text-align:center; text-transform:capitalize; font-weight:700}
.calpanel{padding:14px 16px}
.calweekdays{display:grid; grid-template-columns:repeat(7,1fr); gap:4px; font:11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; margin-bottom:4px; text-align:center}
.calweeks{display:flex; flex-direction:column; gap:4px}
.calweek{display:grid; grid-template-columns:repeat(7,1fr); gap:4px}
.calcell{min-height:60px; border:1px solid var(--line); border-radius:10px; padding:6px; cursor:pointer; background:var(--surface2)}
.calcell:hover{border-color:var(--accent)}
.calcell.out{opacity:.4}
.calcell.today{border-color:var(--accent); background:var(--accent-soft)}
.calcell.sel{box-shadow:0 0 0 2px var(--accent) inset}
.calcell .caln{font:12px "PT Mono",monospace; color:var(--muted)}
.calcell.today .caln{color:var(--accent); font-weight:700}
.caldots{display:flex; gap:3px; margin-top:6px; flex-wrap:wrap}
.caldot{width:7px; height:7px; border-radius:50%; display:inline-block; flex:none}
.callegend{display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:12px; font-size:12.5px; color:var(--text)}
.callg{display:inline-flex; align-items:center; gap:6px}
.caldel{border:none; background:none; color:var(--bad); cursor:pointer; font-size:14px; margin-left:6px; line-height:1}
#caldaypanel .frow input[type=text]{max-width:none; flex:2}
#caldaypanel .frow select{border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); font:13px "PT Sans",sans-serif; padding:8px}

/* мини-календарь на главной (виджет в правой колонке) */
.calgrid.mini .calcell{min-height:28px; padding:3px; border-radius:6px; cursor:default}
.calgrid.mini .calcell:hover{border-color:var(--line)}
.calgrid.mini .caln{font-size:10px}
.calgrid.mini .caldots{margin-top:2px}
.calup-title{font:700 11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:10px 0 4px}
.calup-row{display:flex; align-items:center; gap:6px; padding:4px 2px; font-size:13px}
.calup-date{font:11px "PT Mono",monospace; color:var(--muted); flex:none}
.calup-t{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

/* ── Главная: быстрые действия ──────────────────────────────────── */
.quickrow{display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:8px 0 16px}
@media(max-width:700px){.quickrow{grid-template-columns:repeat(2,1fr)}}
.qtile{display:flex; flex-direction:column; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px 10px; box-shadow:var(--shadow-card); cursor:pointer; text-decoration:none; color:var(--text); font:600 12.5px "PT Sans",sans-serif}
.qtile:hover{box-shadow:var(--shadow-card-hi); border-color:var(--accent)}
.qico{width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:18px}

/* ── Глобальный поиск (топбар) ──────────────────────────────────── */
.topbar-search{position:relative; flex:1; max-width:380px; min-width:160px}
.topbar-search input{width:100%; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font:13px "PT Sans",sans-serif; padding:8px 12px}
.searchresults{position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-card-hi); max-height:360px; overflow-y:auto; z-index:20}
.sres{display:flex; align-items:center; gap:8px; padding:9px 12px; border-top:1px solid var(--line); text-decoration:none; color:var(--text); font-size:13px}
.sres:first-child{border-top:0}
.sres:hover{background:var(--surface2)}
.sline{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.sline mark{background:var(--p-yellow); color:var(--text); border-radius:3px; padding:0 1px}
.hqhit{outline:2px solid var(--accent); outline-offset:2px; border-radius:10px}

/* ── Команда: приглашение, доступ, отключение (мягкие пилюли-статусы) ── */
.chip.invited{background:var(--chip-warn); color:var(--warn); margin-left:6px; margin-top:0}
.chip.suspended{background:var(--chip-idle); color:var(--muted); margin-left:6px; margin-top:0}
.crew-card.suspended{opacity:.55}
.crew-admin{display:flex; gap:6px; margin-top:8px; flex-wrap:wrap}
.crew-admin .mini{font:11px "PT Sans",sans-serif; border:1px solid var(--line); background:var(--surface2); color:var(--text); border-radius:8px; padding:4px 10px; cursor:pointer}
.crew-admin .mini:hover{border-color:var(--accent)}
.crew-admin .mini.danger{color:var(--bad)}
.invtext{background:var(--surface2); border-radius:10px; padding:8px 10px; margin-top:8px; font-size:12px}
.invtext-body{white-space:normal; line-height:1.5; margin-bottom:6px; color:var(--text)}
.invtext .mini{font:11px "PT Sans",sans-serif; border:1px solid var(--line); background:var(--surface); color:var(--accent); border-radius:8px; padding:4px 10px; cursor:pointer}
.crewtoolbar{margin-bottom:14px}
#inviteForm{margin-bottom:20px}
.inviteform{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.inviteform input, .inviteform select{width:auto; max-width:220px; flex:1; min-width:140px}

/* ── Команда: вкладки «Карточки» / «Воркспейс» / «Структура» ───────── */
#teamtabs{margin-bottom:18px}
.teamtabpanel{margin-top:4px}

/* «Структура» — рендер и стили в structure.js / structure.css (14.09,
   данные из static/structure.json вместо констант в hq.js). */

/* ── Команда → «Воркспейс»: контакты слева, общий чат справа ───────── */
.wsgrid{display:grid; grid-template-columns:260px minmax(0,1fr); gap:16px; align-items:start}
@media(max-width:900px){.wsgrid{grid-template-columns:1fr}}
.wscontacts{min-width:0}
.wsgroup{margin-bottom:18px}
.wsgroup:last-child{margin-bottom:0}
.wsgrouphead{font:700 11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px}
.wsgrouphead label{display:flex; align-items:center; gap:8px; cursor:pointer}
.wslist{display:flex; flex-direction:column}
.wsrow{display:flex; align-items:center; gap:8px; padding:6px 2px; font-size:13px; cursor:pointer}
.wsava{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; color:#fff; font:700 12px "PT Sans",sans-serif; flex:none}
.wschatpane{min-width:0}
.wschatbox{height:64vh; min-height:420px}
#wsto{margin-right:auto; align-self:center}

/* ── Чат: роботы — полноценные авторы (буква-аватар, цвет из ASSIGNEE_COLORS),
   Тимур·CEO — 🏢, люди — нейтральная буква ─────────────────────────────── */
.cava{display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; font:700 10px "PT Sans",sans-serif; color:#fff; flex:none}
.cava.neutral{background:var(--idle)}
.cava.ceo{background:none; width:auto; height:auto; font-size:13px}

/* ── Главная: «Команда сейчас» — присутствие + последние события ────── */
.tnline{font:12px "PT Sans",sans-serif; color:var(--muted); margin-bottom:8px}
.tnavas{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px}
.tnava{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; background:var(--idle); color:#fff; font:700 12px "PT Sans",sans-serif; opacity:.5}
.tnava.on{background:var(--ok); opacity:1}
.tnrow{display:flex; justify-content:space-between; align-items:baseline; gap:8px; padding:6px 0; border-top:1px solid var(--line); font-size:12.5px}
.tnrow:first-child{border-top:0}
.tntext{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tntime{font:11px "PT Mono",monospace; color:var(--muted); flex:none; white-space:nowrap}

/* ── Главная: плотная мозаика (образец Flowora) — сетка 2/3 + сквозная
   правая панель 340px, внутри левой зоны мозаика графика и нижний ряд ── */
#hqhome{max-width:none}
#hqhome .hqgrid{display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:12px; align-items:start; margin-top:12px}
@media(max-width:1100px){#hqhome .hqgrid{grid-template-columns:1fr}}
#hqhome .hqmain{display:flex; flex-direction:column; gap:12px; min-width:0}
#hqhome .hqside{display:flex; flex-direction:column; gap:12px; min-width:0}
#hqhome .mosaic{display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:12px; align-items:start}
@media(max-width:1300px){#hqhome .mosaic{grid-template-columns:1fr}}
#hqhome .mosaic-charts{display:flex; flex-direction:column; gap:12px; min-width:0}
#hqhome .mosaic-side{display:flex; flex-direction:column; gap:12px; min-width:0}
#hqhome .bottomrow{display:grid; grid-template-columns:minmax(0,1fr); gap:12px}
#hqhome .pane, #hqhome .panel, #hqhome .card{padding:14px 16px}
#hqhome .secondary{margin-top:4px}
#hqhome .chartpanel{margin:0}
#hqhome .briefpane .brieftext{font-size:13.5px; line-height:1.5; white-space:pre-line}
#hqhome .briefpane details{margin-top:10px}
#hqhome .briefpane > details > summary{cursor:pointer; font:600 13px "PT Sans",sans-serif; color:var(--text)}
#hqhome .briefpane details.briefhistitem{margin-top:0; border-top:1px solid var(--line); padding:7px 2px}
#hqhome .briefpane details.briefhistitem:first-child{border-top:0}
#hqhome .briefpane details.briefhistitem summary{cursor:pointer; font:12.5px "PT Sans",sans-serif; color:var(--muted)}
#hqhome .briefpane .briefhistfull{font-size:13px; white-space:pre-line; margin-top:6px}
#hqhome .briefpane .briefagentsfoot{margin-top:10px; padding-top:8px; border-top:1px solid var(--line); font-size:12px; color:var(--muted)}

/* ── Главная: «Проды» — компактный список (имя · глава · счётчик) ──── */
#hqhome .prods.compact{display:flex; flex-direction:column; gap:8px; margin:8px 0 0}
.prodc{display:flex; align-items:center; gap:10px; background:var(--surface2); border:1px solid var(--line); border-radius:12px; padding:10px 12px}
.prodc .pdot{width:10px; height:10px; border-radius:50%; flex:none; background:var(--idle)}
.prodc.ok .pdot{background:var(--ok); box-shadow:0 0 0 3px var(--chip-ok)}
.prodc.crit .pdot{background:var(--bad); box-shadow:0 0 0 3px var(--chip-bad)}
.prodc.warn .pdot{background:var(--warn); box-shadow:0 0 0 3px var(--chip-warn)}
.prodc .pcbody{min-width:0; flex:1}
.prodc .pcn{font-weight:700; font-size:13.5px}
.prodc .pchead{display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--muted); margin-top:2px}
.prodc .pcava{display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; color:#fff; font:700 10px "PT Sans",sans-serif; flex:none}
.prodc .pcsum{font-size:11.5px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.prodc .pcage{font-size:11px; color:var(--muted); margin-top:2px}
.prodc .pccount{flex:none; font:700 13px "PT Mono",monospace; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:3px 10px}

/* ── Главная: «Мои задачи» — компактная строка, клик разворачивает
   карточку на месте (существующая механика внутри; расположение блока —
   ниже, в нижнем ряду левой зоны, две колонки) ── */
.wirow{display:flex; align-items:center; gap:8px; padding:11px 0; cursor:pointer}
.wicheck{width:16px; height:16px; border-radius:50%; border:1.5px solid var(--line); flex:none}
.wititle{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600}
.wi.open .wicheck{border-color:var(--accent)}
.wi.open .wid, .wi.open .askform, .wi.open .decres, .wi.open .acts, .wi.open .res{margin-left:24px}

/* ── Главная: «Тимур · ИИ-штаб» — обычная светлая панель кабинета, тонкая
   мятная полоска-шапка держит идентичность вместо тёмного градиента
   (фаундер 10.09: «текст с фоном сливается и фон — вырви глаз») ── */
.cto-pane{background:var(--surface); border-color:var(--line); color:var(--text)}
.cto-pane h3{margin:-16px -18px 12px; padding:12px 18px; border-radius:16px 16px 0 0; background:var(--accent-soft); color:var(--text); display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.cto-pane .ctosub{font:11px "PT Mono",monospace; color:var(--muted); font-weight:400}
.cto-pane .chatbox{background:transparent; border:none; box-shadow:none; height:auto; min-height:0}
.cto-pane .chatlog{max-height:160px; overflow-y:auto; padding:4px 0}
.cto-pane .msg{border-top:1px solid var(--line); padding:6px 2px}
.cto-pane .msg.own{background:var(--accent-soft); border-top:none; border-radius:8px; padding:6px 8px; margin:2px -2px}
.cto-pane .msg .mh{color:var(--muted)}
.cto-pane .msg .mh .who{color:var(--muted)}
.cto-pane .msg .mb{color:var(--text); font-size:12.5px}
.cto-pane .empty{color:var(--muted)}
.cto-pane .chatform{border-top:1px solid var(--line); padding-top:10px; margin-top:6px}

/* ── Топбар: колокольчик «Мои задачи» + аватар Дмитрия ─────────────── */
.tbell{position:relative; border:1px solid var(--line); background:var(--surface); border-radius:10px; width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px}
.tbell:hover{border-color:var(--accent)}
.tbell-badge{position:absolute; top:-5px; right:-5px; background:var(--bad); color:#fff; font:700 10px "PT Mono",monospace; border-radius:10px; min-width:16px; height:16px; padding:0 3px; display:flex; align-items:center; justify-content:center; line-height:1}
.tavatar{width:32px; height:32px; border-radius:50%; object-fit:cover; flex:none; border:1px solid var(--line)}

/* по слову Дмитрия: чат выделен зелёной рамкой */
#hqhome .cto-pane{border:2px solid var(--accent)}

/* ── Финансы: два периметра, таблицы по месяцам, карточки итогов ──── */
.finbanner{background:var(--chip-warn); color:var(--warn); font-weight:700; font-size:13.5px; border-radius:12px; padding:12px 16px; margin-bottom:20px}
.findeck{display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start}
@media(max-width:1000px){.findeck{grid-template-columns:1fr}}
.finperim{display:flex; flex-direction:column; gap:16px; min-width:0}
.finhead{display:flex; align-items:baseline; gap:10px; flex-wrap:wrap}
.finhead h2{font:700 20px "Spectral",Georgia,serif; margin:0}
.finsub{font:12px "PT Mono",monospace; color:var(--muted)}
.finperiod{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:14px 18px; box-shadow:var(--shadow-card)}
.finperiod h3{font:600 14px "Spectral",Georgia,serif; margin:0 0 8px}
.fintable{width:100%; border-collapse:collapse; font-size:13.5px}
.fintable tr{border-top:1px solid var(--line)}
.fintable tr:first-child{border-top:0}
.fintable td{padding:6px 4px}
.fintable td:first-child{padding-left:2px}
.fintable .finval{text-align:right; white-space:nowrap; font:13px "PT Mono",monospace; font-variant-numeric:tabular-nums; padding-right:2px}
.fintable tr.fin-income td{color:var(--ok)}
.fintable tr.fin-total td{font-weight:700; background:var(--accent-soft)}
.fintable tr.fin-total.neg td{color:var(--bad)}
.finchip{display:inline-block; font:10px "PT Sans",sans-serif; font-weight:700; color:var(--muted); background:var(--surface2); border-radius:20px; padding:1px 7px; margin-left:6px; vertical-align:middle}
.finstage{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px 18px; box-shadow:var(--shadow-card); display:flex; flex-wrap:wrap; gap:20px}
.finstage h3{width:100%; font:600 14px "Spectral",Georgia,serif; margin:0 0 4px}
.finbig{min-width:150px}
.finbignum{font:700 22px "Spectral",Georgia,serif; font-variant-numeric:tabular-nums}
.finbignum.neg{color:var(--bad)}
.finbiglabel{font:12px "PT Sans",sans-serif; color:var(--muted); margin-top:2px}
.finbignote{font:11px "PT Mono",monospace; color:var(--muted); margin-top:2px; max-width:220px}
.fininputs{background:var(--accent-soft)}
.finnote-block{background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:14px 18px; box-shadow:var(--shadow-card); font-size:12.5px}
.finnote-block h3{font:600 13px "Spectral",Georgia,serif; margin:0 0 6px}
.findriver{margin:3px 0; color:var(--muted)}
.finfoot{margin-top:24px; font:11px "PT Mono",monospace; color:var(--muted); text-align:center}

/* ── t32, этап ③: таблицы данных (роли/журнал/риски) — общий стиль строк ── */
table.datatable{width:100%; border-collapse:collapse; font-size:13px}
table.datatable th{text-align:left; font:700 11px "PT Mono",monospace; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:8px 10px; border-bottom:1px solid var(--line); white-space:nowrap}
table.datatable td{padding:7px 10px; border-top:1px solid var(--line); vertical-align:top}
table.datatable tr:first-child td{border-top:0}
tr.riskrow{cursor:pointer}
tr.riskrow:hover{background:var(--surface2)}
tr.riskhist td{background:var(--surface2); font-size:12.5px}
.risk-hist-row{padding:3px 0}
.chip.sev-low{background:var(--chip-ok); color:var(--ok)}
.chip.sev-mid{background:var(--chip-warn); color:var(--warn)}
.chip.sev-high{background:var(--chip-bad); color:var(--bad); font-weight:700}

/* ── t39 ②: страница «Документы» ─────────────────────────────────────── */
.hint.err{color:var(--bad)}
.docsel{border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); font:13px "PT Sans",sans-serif; padding:8px; max-width:220px}
.docfilters .frow input[type=text]{max-width:260px}
.dropzone{border:2px dashed var(--line); border-radius:14px; padding:22px 16px; text-align:center; color:var(--muted); font-size:13px; cursor:pointer}
.dropzone:hover, .dropzone.drag{border-color:var(--accent); background:var(--accent-soft); color:var(--text)}
.dropzone .send{margin-top:10px}
tr.docrow.doc-withdrawn{opacity:.55}
tr.docrow.doc-highlight{background:var(--accent-soft)}
tr.dochist td{background:var(--surface2); font-size:12.5px}
.doc-hist-row{padding:3px 0}
.hist-toggle{font:11px "PT Mono",monospace; border:none; background:none; color:var(--accent); cursor:pointer; padding:0 0 0 6px}
.chip.partners{background:var(--chip-warn); color:var(--warn)}
.chip.withdrawn{background:var(--chip-idle); color:var(--muted); margin-left:4px}
.doc-acts{white-space:nowrap}
