@font-face { font-family: 'GOST A'; src: url(../fonts/GOST_A.ttf) format('truetype'); font-display: swap; }
:root {
  --ink: #1d2733; --ink2: #5b6876; --ink3: #8a95a1; --line: #c9d1da; --line2: #e3e8ed; --paper: #ffffff; --band: #f2f5f8; --page: #e9edf1;
  --blue: #2b62b8; --blue2: #e8eff9; --red: #d4473f; --red2: #fbeceb; --orange: #e5962a; --orange2: #fdf3e4; --green: #2f9b57; --green2: #e7f4ec; --grey: #a3adb8;
  --f: 'GOST A', 'Arial Narrow', 'Roboto Condensed', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--f); font-size: 15.5px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: var(--f); font-size: 15px; color: var(--ink); }
button { cursor: pointer; }
h1, h2, h3 { font-weight: normal; margin: 0; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); } .green { color: var(--green); } .orange { color: var(--orange); }
.hidden { display: none !important; }

/* ---------- значки ---------- */
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- верхняя панель ---------- */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 6px 14px;
  background: #fff; border-bottom: 1px solid var(--line); min-height: 50px; }
.brand { font-size: 24px; color: var(--ink); letter-spacing: .5px; padding-right: 4px; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--blue); }
.tabs { display: flex; gap: 1px; background: var(--band); border-radius: 9px; padding: 3px; min-width: 0; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; color: var(--ink2); font-size: 15.5px; position: relative; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--blue); }
.tabs a.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.14); color: var(--blue); }
.tabs a .lbl { color: var(--ink); }
.tabs a.on .lbl { color: var(--blue); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 1px; border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11.5px; line-height: 17px; text-align: center; font-weight: normal; vertical-align: 1px; font-family: var(--f); }
.badge.soft { background: var(--blue); }
.badge:empty { display: none; }
.top .search { flex: 1; min-width: 120px; max-width: 320px; margin-left: auto; position: relative; }
.top .search .sicon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--ink3); display: flex; }
.top .search input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px 6px 32px; background: var(--band); }
.top .search input:focus { background: #fff; outline: none; border-color: var(--blue); }
.top .user { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.top .user form { margin: 0; display: flex; }
.top .user a.muted { color: var(--ink2); display: flex; }
.top .user a.muted:hover { color: var(--blue); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--ink2); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.linkbtn:hover { color: var(--blue); }
.ava.sm { width: 30px; height: 30px; font-size: 12.5px; }
.mbar { display: none; }

/* ---------- страница ---------- */
.page { max-width: 1560px; margin: 0 auto; padding: 16px 18px 40px; }
.phead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.phead h1 { font-size: 36px; line-height: 1; }
.phead .sub { color: var(--blue); font-size: 15px; letter-spacing: 1px; text-transform: uppercase; }
.phead .sp { flex: 1; }
.crumbs { color: var(--ink2); font-size: 14px; margin-bottom: 4px; }
.panel { background: #fff; border: 1px solid #d8dee5; border-radius: 6px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 21px; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; }
.panel h2 .muted { font-size: 14px; }
.panel h2 a.more { margin-left: auto; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.stack > * + * { margin-top: 14px; }
.msgs { max-width: 1560px; margin: 10px auto 0; padding: 0 18px; }
.msg { padding: 8px 12px; border-radius: 6px; background: var(--blue2); border: 1px solid #c6d6ef; margin-bottom: 6px; }
.msg.error { background: var(--red2); border-color: #f0c4c1; }
.msg.success { background: var(--green2); border-color: #bfe0cb; }
.empty { color: var(--ink2); padding: 14px 0; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 5px 11px; color: var(--ink); font-size: 15px; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn.main { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.main:hover { background: #24539c; color: #fff; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { padding: 2px 8px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
.fld { margin-bottom: 10px; }
.fld label, .lbl { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 3px; }
.inp, .fld input[type=text], .fld input[type=email], .fld input[type=password], .fld input[type=date], .fld input[type=number],
.fld input[type=url], .fld textarea, .fld select, .filters input, .filters select {
  width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; background: #fff; }
.fld textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(43,98,184,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 220px; }
.filters input[type=checkbox], .filters input[type=radio] { min-width: 0; width: auto; vertical-align: -2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg a, .seg button { border: 0; background: #fff; padding: 5px 11px; color: var(--ink); font-size: 14.5px; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line2); }
.seg a.on, .seg button.on { background: var(--blue); color: #fff; }
.seg a:hover { text-decoration: none; }
.chip { display: inline-block; padding: 0 7px; border-radius: 10px; background: var(--band); color: var(--ink2); font-size: 12.5px; line-height: 19px; white-space: nowrap; }
.chip.blue { background: var(--blue2); color: var(--blue); }
.chip.red { background: var(--red2); color: var(--red); }
.chip.green { background: var(--green2); color: var(--green); }
.chip.orange { background: var(--orange2); color: #b26d0e; }
a.chip:hover { text-decoration: none; filter: brightness(.96); }

/* ---------- таблицы ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: normal; color: var(--ink2); font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  padding: 6px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: #fff; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.late td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ---------- списки ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 7px 0; border-bottom: 1px solid var(--line2); display: flex; gap: 10px; align-items: baseline; }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--ink2); font-size: 13px; white-space: nowrap; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 5px; vertical-align: 2px; }
.ev { display: grid; grid-template-columns: 54px 92px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line2); font-size: 14.5px; }
.ev:last-child { border-bottom: 0; }
.ev .t { color: var(--ink2); font-size: 13px; }
.ev .k { font-size: 12px; }
.ev .who { color: var(--ink2); }
.ev.compact { grid-template-columns: 74px 1fr; }

/* ---------- сводка ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid #d8dee5; border-radius: 6px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; }
.kpi .k { font-size: 11px; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
.kpi .v { font-size: 26px; line-height: 1.1; }
.kpi .s { font-size: 13px; color: var(--ink2); }
.nodebars { display: grid; gap: 6px; }
.nodebar { display: grid; grid-template-columns: 26px minmax(120px, 1fr) 1.2fr 46px 84px; gap: 8px; align-items: center; font-size: 14.5px; }
.nodebar .n { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 13px; }
.nodebar .bar { height: 8px; background: #e6ebf0; border-radius: 4px; overflow: hidden; }
.nodebar .bar i { display: block; height: 100%; }
.nodebar .d { color: var(--ink2); font-size: 13px; text-align: right; }

/* ---------- обсуждения ---------- */
.posts { display: flex; flex-direction: column; gap: 2px; }
.post { display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line2); }
.post.new { background: #fffbea; }
.ava { width: 34px; height: 34px; border-radius: 50%; background: var(--blue2); color: var(--blue); display: grid; place-items: center; font-size: 14px; }
.post .hd { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.post .hd b { font-weight: normal; font-size: 16px; }
.post .hd .t { color: var(--ink2); font-size: 12.5px; }
.post .tx { margin-top: 3px; line-height: 1.38; overflow-wrap: anywhere; font-size: 15.5px; }
.post .att { margin-top: 5px; }
.post .tools { margin-left: auto; display: flex; gap: 6px; opacity: 0; }
.post:hover .tools { opacity: 1; }
.mention { color: var(--blue); background: var(--blue2); border-radius: 3px; padding: 0 2px; }
.reply textarea { width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; resize: vertical; }
.att-link { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; font-size: 13.5px; background: var(--band); }

/* ---------- задачи ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.col { background: #e2e7ec; border-radius: 8px; padding: 8px; min-height: 120px; }
.col.drop { outline: 2px dashed var(--blue); outline-offset: -2px; }
.col h3 { font-size: 17px; padding: 2px 4px 8px; display: flex; gap: 6px; align-items: baseline; }
.col h3 .muted { font-size: 13px; }
.tcard { background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 7px; box-shadow: 0 1px 2px rgba(0,0,0,.1);
  border-left: 4px solid var(--grey); cursor: grab; }
.tcard.high { border-left-color: var(--red); }
.tcard.normal { border-left-color: var(--blue); }
.tcard .tt { font-size: 15.5px; color: var(--ink); display: block; line-height: 1.25; }
.tcard .mt { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-size: 13px; color: var(--ink2); align-items: center; }
.tcard.dragging { opacity: .5; }

/* ---------- документы ---------- */
.doclayout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.cats { list-style: none; margin: 0; padding: 0; }
.cats a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.cats a:hover { background: #fff; text-decoration: none; }
.cats a.on { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cats .muted { font-size: 13px; }
.ficon { display: inline-grid; place-items: center; min-width: 40px; height: 22px; padding: 0 4px; border-radius: 4px; background: var(--band);
  color: var(--ink2); font-size: 11px; letter-spacing: .3px; border: 1px solid var(--line2); }
.ficon.k-pdf { background: #fbeceb; color: #b3362f; border-color: #f2cdca; }
.ficon.k-3d { background: #eef3fd; color: #2b62b8; border-color: #cfdcf3; }
.ficon.k-code { background: #edf7f0; color: #2f7d4c; border-color: #cbe6d4; }
.ficon.k-office { background: #e9f0fb; color: #285ea8; border-color: #c9d8ef; }
.ficon.k-altium, .ficon.k-kicad { background: #fdf3e4; color: #a7650c; border-color: #f0dcbc; }
.ficon.k-zip { background: #f3eefb; color: #6b45a8; border-color: #ddd0f0; }
.drop-zone { border: 2px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--ink2); background: #fafbfc; }
.drop-zone.over { border-color: var(--blue); background: var(--blue2); color: var(--blue); }
.viewer { background: #fff; border: 1px solid #d8dee5; border-radius: 6px; overflow: hidden; }
.viewer .vh { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line2); background: #fafbfc; flex-wrap: wrap; }
.viewer .vh .name { font-size: 16px; overflow-wrap: anywhere; }
.viewer .vb { position: relative; }
.viewer iframe.pdf { display: block; width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 0; }
.viewer .img { padding: 12px; text-align: center; background: repeating-conic-gradient(#f3f5f7 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.viewer .img img { max-width: 100%; max-height: calc(100vh - 220px); }
.viewer .v3d { width: 100%; height: calc(100vh - 200px); min-height: 520px; background: #f4f6f8; }
.viewer kicanvas-embed { display: block; width: 100%; height: calc(100vh - 200px); min-height: 520px; }
.viewer .docx { background: #e9edf1; padding: 14px 0; max-height: calc(100vh - 200px); min-height: 520px; overflow: auto; }
.viewer .note { padding: 22px; color: var(--ink2); line-height: 1.5; }
.viewer .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink2); background: rgba(255,255,255,.7); }
.code { margin: 0; overflow: auto; max-height: calc(100vh - 200px); min-height: 200px; font-family: var(--mono); font-size: 13px; line-height: 1.5; tab-size: 4; background: #fff; }
.code table { border-collapse: collapse; width: 100%; }
.code td { padding: 0 12px; white-space: pre; vertical-align: top; }
.code td.ln a { color: inherit; text-decoration: none; }
.code td.ln { color: #a8b1bb; text-align: right; user-select: none; border-right: 1px solid var(--line2); background: #fafbfc; width: 1%; padding: 0 10px; }
.code tr:target td, .code tr.hl td { background: #fff8d6; }
.ztree { font-size: 14px; max-height: calc(100vh - 200px); overflow: auto; }
.ztree a, .ztree span.dir { display: flex; gap: 6px; align-items: center; padding: 2px 6px; border-radius: 4px; color: var(--ink); white-space: nowrap; }
.ztree a:hover { background: var(--band); text-decoration: none; }
.ztree a.on { background: var(--blue2); color: var(--blue); }
.ztree span.dir { color: var(--ink2); }
.ztree .sz { margin-left: auto; color: var(--ink3); font-size: 12px; padding-left: 10px; }
.vers { font-size: 14px; }
.vers li { align-items: center; }

/* ---------- чат ---------- */
.chatwrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 100px); height: calc(100dvh - 100px); min-height: 380px; background: #fff; border: 1px solid #d8dee5; border-radius: 10px; overflow: hidden; }
.chat .stream { overflow-y: auto; padding: 12px 16px; background: #f6f8fa; overscroll-behavior: contain; }
.chat .day { text-align: center; margin: 14px 0 8px; }
.chat .day span { background: #e4e9ee; color: var(--ink2); font-size: 12.5px; padding: 2px 10px; border-radius: 10px; }
.chat .m { display: flex; gap: 8px; align-items: flex-end; margin: 3px 0; }
.chat .m .ava { width: 30px; height: 30px; font-size: 12px; }
.chat .m.cont .ava { visibility: hidden; }
.chat .bub { max-width: min(640px, 78%); background: #fff; border: 1px solid #e1e6eb; border-radius: 14px 14px 14px 4px; padding: 6px 10px 4px; position: relative; }
.chat .m.mine { flex-direction: row-reverse; }
.chat .m.mine .bub { background: #e3edfb; border-color: #cfdcf2; border-radius: 14px 14px 4px 14px; }
.chat .bub .who { font-size: 13px; color: var(--blue); margin-bottom: 1px; }
.chat .m.mine .bub .who, .chat .m.cont .bub .who { display: none; }
.chat .bub .tx { line-height: 1.38; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 15.5px; }
.chat .bub .t { float: right; font-size: 11.5px; color: var(--ink3); margin: 6px 0 0 10px; }
.chat .bub img.pic { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; margin: 4px 0; cursor: zoom-in; }
.chat .bub .att-link { margin-top: 4px; }
.chat form { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line2); align-items: flex-end; background: #fff; }
.chat textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px; padding: 9px 14px; min-height: 40px; max-height: 180px; line-height: 1.3; }
.chat .ib { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink2); flex: none; position: relative; overflow: hidden; }
.chat .ib:hover { color: var(--blue); border-color: var(--blue); }
.chat .ib.send { background: var(--blue); border-color: var(--blue); color: #fff; }
.chat .ib input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat .fileinfo { font-size: 13px; color: var(--ink2); padding: 0 14px 6px; background: #fff; }
.chat .fileinfo:empty { display: none; }
.chat .drop { position: absolute; inset: 0; background: rgba(43,98,184,.08); border: 2px dashed var(--blue); border-radius: 10px; display: none; place-items: center; color: var(--blue); font-size: 18px; z-index: 3; }
.chat.over .drop { display: grid; }
.chat { position: relative; }

/* ---------- комплектующие ---------- */
.parts-wrap { overflow: auto; max-height: calc(100vh - 230px); background: #fff; border: 1px solid #d8dee5; border-radius: 6px; }
.ptbl { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 1500px; width: 100%; }
.ptbl th { position: sticky; top: 0; z-index: 2; background: #fff; text-align: left; font-weight: normal; color: var(--ink2); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .3px; padding: 7px 4px; border-bottom: 1.5px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.ptbl th.sorted::after { content: ' ▾'; }
.ptbl th.sorted.rev::after { content: ' ▴'; }
.ptbl td { border-bottom: 1px solid var(--line2); padding: 0; vertical-align: middle; }
.ptbl tr.grp td { background: var(--band); padding: 6px 8px; font-size: 15px; border-bottom: 1px solid var(--line); position: sticky; top: 31px; z-index: 1; }
.ptbl input, .ptbl select { width: 100%; border: 1px solid transparent; background: transparent; padding: 5px 5px; font-size: 14px; border-radius: 3px; min-width: 0; }
.ptbl input:hover, .ptbl select:hover { border-color: var(--line2); background: #fff; }
.ptbl input:focus, .ptbl select:focus { border-color: var(--blue); background: #fff; }
.ptbl input.num { text-align: right; }
.ptbl tr.saving td { background: #fffbea; }
.ptbl tr.err td { background: var(--red2); }
.ptbl tr.late td.c-due input { color: var(--red); }
.ptbl td.act { white-space: nowrap; padding: 0 4px; }
.ptbl td.act a, .ptbl td.act button { border: 0; background: none; color: var(--ink3); font-size: 15px; padding: 2px 3px; }
.ptbl td.act a:hover, .ptbl td.act button:hover { color: var(--blue); text-decoration: none; }
.ptbl td.act button.del:hover { color: var(--red); }
.ptbl td.sum { padding: 0 8px; text-align: right; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-need select { color: var(--red); } .st-ordered select { color: #b26d0e; } .st-transit select { color: #b26d0e; }
.st-stock select { color: var(--green); } .st-mounted select { color: var(--green); } .st-nouse select { color: var(--grey); }
.ptbl tr.st-nouse td input { color: var(--grey); text-decoration: line-through; }
.psum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink2); margin: 8px 2px 0; }
.psum b { font-weight: normal; color: var(--ink); }
dialog { border: 0; border-radius: 8px; padding: 0; box-shadow: 0 10px 40px rgba(0,0,0,.25); max-width: 560px; width: calc(100% - 30px); }
dialog::backdrop { background: rgba(20,30,40,.25); }
dialog .dh { padding: 12px 16px; border-bottom: 1px solid var(--line2); font-size: 20px; display: flex; }
dialog .dh button { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--ink2); }
dialog .db { padding: 14px 16px; }

/* ---------- узел ---------- */
.nodehead { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; }
.track2 { display: grid; gap: 0; margin-top: 12px; position: relative; }
.track2 .st { text-align: center; font-size: 13px; position: relative; padding-top: 2px; }
.track2 .st .d { color: var(--ink2); font-size: 12px; }
.track2 .st .dot { width: 16px; height: 16px; border-radius: 50%; margin: 4px auto; border: 2px solid var(--grey); background: #fff; position: relative; z-index: 1; }
.track2 .st.done .dot { background: var(--green); border-color: var(--green); }
.track2 .st.work .dot { border-color: var(--orange); background: linear-gradient(90deg, var(--orange) 50%, #fff 50%); }
.track2 .st.late .dot { border-color: var(--red); }
.track2::before { content: ''; position: absolute; top: 25px; left: 6%; right: 6%; height: 2px; background: var(--line); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .panel { width: min(380px, calc(100% - 30px)); padding: 26px 26px 20px; }
.login h1 { font-size: 40px; margin-bottom: 2px; }

/* ---------- окна и всплывающие панели ---------- */
dialog.wide { max-width: 760px; }
dialog form.db { margin: 0; }
dialog.sheet { max-width: 520px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-grid a, .sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 10px; background: var(--band);
  color: var(--ink); border: 0; font-size: 14.5px; width: 100%; }
.sheet-grid a.on { background: var(--blue2); color: var(--blue); }
.sheet-grid a:hover { text-decoration: none; }
.sheet-grid form { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 200; font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* ---------- рабочее место составной части ---------- */
.nhead { background: #fff; border: 1px solid #d8dee5; border-radius: 10px; padding: 12px 16px 0; margin-bottom: 14px; }
.nhead .crumbs { margin-bottom: 6px; }
.nh-main { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nh-main h1 { font-size: 32px; line-height: 1.05; }
.desig { font-family: var(--mono); font-size: 12.5px; color: var(--blue); letter-spacing: .3px; }
.nh-main .sp { flex: 1; }
.ntabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.ntabs::-webkit-scrollbar { display: none; }
.ntabs a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; color: var(--ink2); border-bottom: 2.5px solid transparent; white-space: nowrap; font-size: 15.5px; }
.ntabs a:hover { color: var(--blue); text-decoration: none; }
.ntabs a.on { color: var(--blue); border-bottom-color: var(--blue); }
.ntabs .cnt { font-size: 12px; background: var(--band); color: var(--ink2); border-radius: 9px; padding: 0 6px; line-height: 18px; }
.ntabs a.on .cnt { background: var(--blue2); color: var(--blue); }
.kv2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kv2 a { display: block; background: var(--band); border-radius: 8px; padding: 10px 12px; color: var(--ink); }
.kv2 a:hover { text-decoration: none; background: var(--blue2); }
.kv2 .k { font-size: 12px; color: var(--ink2); display: flex; gap: 6px; align-items: center; }
.kv2 .v { font-size: 24px; line-height: 1.2; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* ---------- схема деления (ГОСТ 2.711) ---------- */
.stree { overflow-x: auto; padding: 6px 2px 10px; }
.stree ul { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; }
.stree > ul { padding-left: 0; }
.stree li { position: relative; padding: 6px 0 6px 0; }
.stree ul ul li::before { content: ''; position: absolute; left: -22px; top: 0; bottom: 0; border-left: 1.5px solid #9aa7b4; }
.stree ul ul li:last-child::before { bottom: auto; height: 34px; }
.stree ul ul li::after { content: ''; position: absolute; left: -22px; top: 34px; width: 22px; border-top: 1.5px solid #9aa7b4; }
.sbox { display: inline-grid; grid-template-columns: auto 1fr auto; align-items: stretch; background: #fff; border: 1.5px solid #3d4a57; min-width: 420px; max-width: 640px; position: relative; }
.sbox.root { border-width: 2px; min-width: 460px; }
.sbox .sd { grid-column: 1 / -1; border-bottom: 1px solid #3d4a57; padding: 3px 10px; font-family: var(--mono); font-size: 12.5px; color: var(--ink); display: flex; gap: 8px; align-items: center; min-height: 23px; }
.sbox .sd .kd { margin-left: auto; font-family: var(--f); font-size: 12px; color: var(--ink2); }
.sbox .sn { grid-column: 1 / 3; padding: 6px 10px 7px; }
.sbox .sn a { font-size: 18px; color: var(--ink); }
.sbox .sn a:hover { color: var(--blue); text-decoration: none; }
.sbox .ss { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.sbox .sa { grid-column: 3; display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.sbox .sa button, .sbox .sa a { border: 0; background: none; color: var(--ink3); padding: 4px; border-radius: 5px; display: flex; }
.sbox .sa button:hover, .sbox .sa a:hover { color: var(--blue); background: var(--band); }
.sbox .bar5 { position: absolute; left: 0; bottom: -1.5px; height: 3px; }
.slist { display: none; }

/* ---------- исходники ---------- */
.srcbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.srcbar .path { font-size: 16px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.srcbar .path a { color: var(--blue); }
.clone { display: flex; align-items: center; gap: 6px; background: var(--band); border-radius: 8px; padding: 4px 4px 4px 10px; font-family: var(--mono); font-size: 12.5px; max-width: 100%; }
.clone code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftree { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ftree td { padding: 7px 10px; border-bottom: 1px solid var(--line2); }
.ftree tr:hover td { background: #f8fafc; }
.ftree td.n a { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.ftree td.n a:hover { color: var(--blue); text-decoration: none; }
.ftree td.n .i { color: var(--ink3); }
.ftree tr.dir td.n .i { color: #d29b2b; }
.ftree td.sz { text-align: right; color: var(--ink2); white-space: nowrap; width: 1%; font-size: 13px; }
.lastc { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: var(--band); border-radius: 8px 8px 0 0; font-size: 14px; flex-wrap: wrap; }
.lastc .sha { font-family: var(--mono); font-size: 12.5px; }
.readme { white-space: pre-wrap; font-family: var(--f); font-size: 15.5px; line-height: 1.45; margin: 0; }
.commits li { align-items: center; }
.commits .sha { font-family: var(--mono); font-size: 12.5px; background: var(--band); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.diff { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; overflow: auto; max-height: 75vh; background: #fff; }
.diff .add { background: #e6f6ea; } .diff .del { background: #fdecec; } .diff .hunk { color: #6b7a8a; background: #f3f6f9; } .diff .fh { background: #eef2f7; font-weight: bold; }
.upzone { border: 2px dashed var(--line); border-radius: 10px; padding: 22px 14px; text-align: center; color: var(--ink2); background: #fafbfc; }
.upzone.over { border-color: var(--blue); background: var(--blue2); color: var(--blue); }
.upzone .big { font-size: 18px; color: var(--ink); }
.uplist { max-height: 180px; overflow: auto; font-size: 13px; color: var(--ink2); margin-top: 8px; text-align: left; font-family: var(--mono); }
.progress { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.term { background: #1d2733; color: #dfe6ee; border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.term .c { color: #8aa0b5; }

/* ---------- маркер в комплектации ---------- */
.hl-yellow { --hl: 255, 214, 10; } .hl-green { --hl: 110, 220, 120; } .hl-pink { --hl: 255, 120, 190; }
.hl-blue { --hl: 90, 180, 255; } .hl-orange { --hl: 255, 160, 60; }
tr[class*=hl-] td.c-name input, tr[class*=hl-] td.c-mpn input, .pcard[class*=hl-] .pn,
.mk[class*=hl-] { background:
  linear-gradient(104deg, rgba(var(--hl), 0) .9%, rgba(var(--hl), .9) 2.4%, rgba(var(--hl), .55) 5.8%, rgba(var(--hl), .3) 93%, rgba(var(--hl), .75) 96%, rgba(var(--hl), 0) 98%),
  linear-gradient(183deg, rgba(var(--hl), 0) 0%, rgba(var(--hl), .3) 7.9%, rgba(var(--hl), 0) 15%) !important;
  border-radius: 6px 3px 7px 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hlpick { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; gap: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.hlpick button { width: 30px; height: 26px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; display: grid; place-items: center; color: var(--ink2); }
.hlpick button.mk { border: 0; }
.ds { display: inline-flex; align-items: center; gap: 4px; }
.ds a.pdf { display: inline-flex; align-items: center; gap: 3px; background: #fbeceb; color: #b3362f; border-radius: 5px; padding: 1px 6px; font-size: 12.5px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.ds a.pdf:hover { text-decoration: none; filter: brightness(.95); }
.ds button { border: 0; background: none; color: var(--ink3); padding: 2px; display: flex; border-radius: 4px; }
.ds button:hover { color: var(--blue); background: var(--band); }
tr.dropping td { background: var(--blue2) !important; }
.pcards { display: none; }
.pcard { background: #fff; border: 1px solid #d8dee5; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pcard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard .pn { font-size: 17px; padding: 0 2px; }
.pcard .nm { color: var(--ink2); font-size: 14px; margin: 2px 0 6px; }
.pcard select, .pcard input { border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; background: #fff; font-size: 15px; }
.pcard .qty { width: 64px; text-align: right; }

/* ---------- доска обсуждений ---------- */
.tboard { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.tcol { background: #e2e7ec; border-radius: 12px; padding: 10px; min-height: 160px; }
.tcol.drop { outline: 2px dashed var(--blue); outline-offset: -3px; }
.tcol h3 { font-size: 18px; padding: 2px 4px 10px; display: flex; gap: 8px; align-items: center; }
.tcol h3 .muted { font-size: 13px; }
.tcol h3 .dot { width: 10px; height: 10px; border-radius: 50%; }
.tc { display: block; background: #fff; border-radius: 10px; padding: 10px 12px 10px 14px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  color: var(--ink); position: relative; cursor: grab; border-left: 5px solid var(--nc, var(--grey)); transition: transform .12s, box-shadow .12s; }
.tc:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.tc.dragging { opacity: .45; }
.tc .tt { font-size: 17px; line-height: 1.22; display: block; padding-right: 16px; }
.tc .ex { font-size: 13.5px; color: var(--ink2); margin-top: 5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc .ft { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); }
.tc .ppl { display: flex; margin-left: auto; }
.tc .ppl .ava { width: 24px; height: 24px; font-size: 10.5px; border: 2px solid #fff; margin-left: -6px; }
.tc .unread { position: absolute; top: 12px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.tc .pin { position: absolute; top: -7px; right: 14px; color: var(--red); }
.tc .dec { margin-top: 7px; font-size: 13.5px; background: var(--green2); color: #1f6b3c; border-radius: 6px; padding: 5px 8px; line-height: 1.3; }
.decision { background: var(--green2); border: 1px solid #bfe0cb; border-radius: 10px; padding: 12px 14px; }
.decision .k { font-size: 12px; color: #1f6b3c; text-transform: uppercase; letter-spacing: .4px; display: flex; gap: 6px; align-items: center; }
.decision .v { font-size: 17px; margin-top: 4px; white-space: pre-wrap; }
.stseg button { display: inline-flex; gap: 5px; align-items: center; }

/* ---------- доски для набросков ---------- */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.bcard { display: block; background: #fff; border: 1px solid #d8dee5; border-radius: 12px; overflow: hidden; color: var(--ink); transition: box-shadow .12s, transform .12s; }
.bcard:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-1px); }
.bcard .th { height: 150px; background: #f6f8fa center / contain no-repeat; border-bottom: 1px solid var(--line2); display: grid; place-items: center; color: var(--ink3); }
.bcard .bt { padding: 9px 12px; }
.bcard .bt b { font-weight: normal; font-size: 17px; display: block; }
.bcard .bt span { font-size: 13px; color: var(--ink2); }
.bcard.new { display: grid; place-items: center; min-height: 200px; border-style: dashed; color: var(--blue); background: transparent; font-size: 17px; }
body.fs .page { max-width: none; padding: 0; }
.bhead { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bhead input.btitle { border: 1px solid transparent; font-size: 19px; padding: 3px 6px; border-radius: 6px; min-width: 120px; flex: 0 1 360px; }
.bhead input.btitle:hover, .bhead input.btitle:focus { border-color: var(--line); outline: none; }
.bhead .who { display: flex; gap: 0; margin-left: auto; }
.bhead .who .ava { width: 28px; height: 28px; font-size: 11px; border: 2px solid #fff; margin-left: -6px; color: #fff; }
.bstage { height: calc(100vh - 100px); height: calc(100dvh - 100px); position: relative; }
.bstage .excalidraw { --color-primary: #2b62b8; --color-primary-darker: #24539c; --color-primary-darkest: #1d4580; --color-primary-light: #e8eff9; }
.bstate { font-size: 13px; color: var(--ink2); }

@media (max-width: 1500px) {
  .tabs a { padding: 5px 8px; gap: 5px; }
  .top .search { max-width: 240px; }
  .top .uname { display: none; }
}
@media (max-width: 1300px) {
  .tabs a .lbl { display: none; }
  .tabs a.on .lbl { display: inline; }
  .tabs a { padding: 6px 9px; }
  .top .search { max-width: 320px; }
}
@media (max-width: 1100px) {
  .grid2, .grid3 { grid-template-columns: 1fr !important; }
  .board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .chatwrap { grid-template-columns: 1fr; }
  .chatwrap aside { display: none; }
  .top .uname { display: none; }
}
@media (max-width: 860px) {
  .tabs a.on .lbl { display: none; }
}
@media (max-width: 760px) {
  html, body { font-size: 16px; }
  .top { padding: 6px 10px; gap: 8px; min-height: 48px; }
  .top .tabs, .hide-m { display: none !important; }
  .top .search { max-width: none; }
  .top .search input { font-size: 16px; }
  .brand { font-size: 21px; }
  .mbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff;
    border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .mbar a, .mbar button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 2px; color: var(--ink2); font-size: 11.5px;
    border: 0; background: none; position: relative; font-family: var(--f); }
  .mbar a:hover { text-decoration: none; }
  .mbar .i { width: 23px; height: 23px; }
  .mbar .on { color: var(--blue); }
  .mbar .badge { position: absolute; top: 0; left: 52%; font-size: 10.5px; line-height: 15px; min-width: 16px; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.fs { padding-bottom: 0; }
  body.fs .mbar { display: none; }
  .doclayout { grid-template-columns: 1fr; }
  .cats { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .cats a { white-space: nowrap; background: #fff; }
  .board { grid-template-columns: repeat(4, 84%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .board .col { scroll-snap-align: start; }
  .tboard { grid-template-columns: repeat(3, 86%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .tcol { scroll-snap-align: start; }
  .page { padding: 10px 8px 24px; }
  .phead { gap: 8px 12px; }
  .phead h1 { font-size: 28px; }
  .phead .sp { display: none; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .nodebar { grid-template-columns: 24px 1fr 46px; }
  .nodebar .bar, .nodebar .d { display: none; }
  .panel { padding: 12px; }
  .nhead { padding: 10px 12px 0; border-radius: 8px; }
  .nh-main h1 { font-size: 25px; }
  .chat { height: calc(100dvh - 48px - 62px - env(safe-area-inset-bottom)); border-radius: 0; border-left: 0; border-right: 0; margin: -10px -8px -24px; }
  body.chatpage .msgs { display: none; }
  .chat .bub { max-width: 84%; }
  .parts-wrap { display: none; }
  .pcards { display: block; }
  .filters input[type=search] { min-width: 0; flex: 1 1 100%; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; border-bottom: 1px solid var(--line2); padding: 6px 0; }
  .tbl.cards td { display: inline-block; border: 0; padding: 2px 6px; }
  .tbl.cards td.grow { display: block; }
  .sbox { min-width: 260px; }
  .sbox.root { min-width: 260px; }
  .stree ul { padding-left: 22px; }
  .stree ul ul li::before, .stree ul ul li::after { left: -14px; }
  .stree ul ul li::after { width: 14px; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 30px); }
  .ev { grid-template-columns: 46px 1fr; }
  .ev > span:nth-child(2) { display: none; }
  .bstage { height: calc(100dvh - 48px - 46px); }
  .bhead { padding: 4px 8px; }
  .viewer iframe.pdf, .viewer .v3d, .viewer kicanvas-embed { height: 62vh; min-height: 320px; }
  .code { max-height: 70vh; font-size: 12px; }
}
@media print {
  .top, .msgs, .noprint { display: none !important; }
  body { background: #fff; }
}
.i.flip { transform: rotate(180deg); }
.doclayout > * { min-width: 0; }
@media (max-width: 760px) {
  .bhead #bNode { display: none; }
  .bhead input.btitle { flex: 1 1 140px; font-size: 17px; }
  .bhead .bstate { font-size: 12px; }
}

/* комплектация: сетка как в таблице — колонки разделены, строки через одну подкрашены */
.ptbl th { background: #f3f6f9; border-bottom: 1px solid var(--line); }
.ptbl th + th, .ptbl td + td { border-left: 1px solid var(--line2); }
.ptbl tr.grp td + td { border-left: 0; }
.ptbl tbody tr:not(.grp):nth-child(even) td { background: #fafbfd; }
.ptbl tbody tr:not(.grp):hover td { background: #f1f6fd; }
.ptbl tbody tr.saving td { background: #fffbea; }
.ptbl tbody tr.err td { background: var(--red2); }

/* исходники: проводник слева */
.srcwrap { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.srctree { position: sticky; top: 62px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: #fff;
  border: 1px solid #d8dee5; border-radius: 6px; overflow: hidden; font-size: 14px; }
.srctree .sth { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line2); background: #fafbfc; color: var(--ink2); }
.srctree .sth a { color: var(--ink); }
.srctree .lnk { border: 0; background: none; color: var(--ink3); font-size: 12.5px; padding: 0; }
.srctree .lnk:hover { color: var(--blue); }
.srctree .stb { overflow: auto; padding: 4px 0 8px; }
.srctree ul { list-style: none; margin: 0; padding: 0; }
.srctree .str { display: flex; align-items: center; gap: 2px; padding-right: 8px; white-space: nowrap; }
.srctree .str:hover { background: var(--band); }
.srctree .str.on { background: var(--blue2); }
.srctree .str.on a { color: var(--blue); }
.srctree .str a { display: flex; align-items: center; gap: 5px; color: var(--ink); padding: 2px 0; min-width: 0; flex: 1; }
.srctree .str a span { overflow: hidden; text-overflow: ellipsis; }
.srctree .str a:hover { text-decoration: none; color: var(--blue); }
.srctree .str a .i { color: var(--ink3); }
.srctree .chev, .srctree .chev-sp { width: 18px; height: 18px; flex: none; border: 0; background: none; padding: 0; color: var(--ink3); display: grid; place-items: center; }
.srctree .chev .i { width: 13px; height: 13px; transition: transform .12s; }
.srctree .chev.open .i { transform: rotate(90deg); }
.srcbar .tree-toggle { display: none; }
.upbanner { display: flex; align-items: center; gap: 6px; padding: 8px 12px; margin-bottom: 10px; border-radius: 6px; background: var(--green2); color: var(--green); }
.upbanner a { color: var(--ink); }
@media (max-width: 900px) {
  .srcwrap { grid-template-columns: minmax(0, 1fr); }
  .srctree { display: none; position: static; max-height: 60vh; }
  body.show-srctree .srctree { display: flex; }
  .srcbar .tree-toggle { display: inline-flex; }
}
.srctree .str a.d .i { color: #d29b2b; }

/* ---------- обсуждения «как в Discord»: темы слева, лента в центре, доска справа ---------- */
.chan { display: flex; height: calc(100vh - 51px); height: calc(100dvh - 51px); background: #fff; border-top: 1px solid var(--line2); overflow: hidden; }
.chl { width: 270px; flex: none; display: flex; flex-direction: column; background: #f3f5f8; border-right: 1px solid var(--line2); min-height: 0; }
.chl-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; font-size: 18px; }
.chl-h b { font-weight: normal; }
.chl-q { display: flex; align-items: center; gap: 5px; margin: 0 10px 6px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; color: var(--ink3); }
.chl-q input { border: 0; outline: 0; padding: 5px 0; width: 100%; background: none; font-size: 14px; }
.chl-list { flex: 1; overflow-y: auto; padding: 2px 6px 10px; }
.chl .ch { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 6px; color: var(--ink2); font-size: 15px; min-width: 0; }
.chl .ch:hover { background: #e6eaf0; color: var(--ink); text-decoration: none; }
.chl .ch.on { background: #dfe7f3; color: var(--ink); }
.chl .ch.unread { color: var(--ink); font-weight: bold; }
.chl .ch .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chl .ch .nd { font-size: 11.5px; color: var(--ink3); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: normal; }
.chl .ch .hash { font-size: 18px; color: var(--ink3); width: 10px; text-align: center; }
.chl .ch .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin: 0 1px; }
.chl .dot.st-question { background: var(--orange); } .chl .dot.st-discuss { background: var(--blue); } .chl .dot.st-decided { background: var(--green); }
.chl .chg { margin: 12px 8px 3px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink3); }
.chl .chg span { margin-left: 4px; }
.chl .chg-empty { padding: 2px 10px; font-size: 13px; color: var(--ink3); }
.chl-f { display: flex; gap: 6px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line2); font-size: 13.5px; color: var(--ink2); }
.chm { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chm-h { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line2); min-height: 56px; flex-wrap: wrap; }
.chm-h .ttl { min-width: 0; flex: 1 1 200px; }
.chm-h h1 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chm-h .sub { font-size: 12.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chm-h .grow { display: none; }
.chm-h .stseg button { padding: 4px 9px; font-size: 13.5px; }
.chm-h .btn.on { background: var(--blue2); border-color: var(--blue); color: var(--blue); }
.chl-btn { display: none; }
.chm-dec { margin: 8px 14px 0; padding: 8px 12px; }
.chm-dec .v { font-size: 15.5px; }
.chan .chat { flex: 1; height: auto; min-height: 0; border: 0; border-radius: 0; }
/* сообщения: как в Discord — все слева, имя и время над текстом, картинки крупно */
.chat.dc .stream { background: #fff; padding: 10px 0 14px; }
.chat.dc .m { align-items: flex-start; flex-direction: row; gap: 12px; margin: 0; padding: 6px 16px 2px; position: relative; }
.chat.dc .m.cont { padding-top: 1px; }
.chat.dc .m:hover { background: #f6f8fb; }
.chat.dc .m.flash { background: #fff8d8; }
.chat.dc .m .ava { width: 36px; height: 36px; font-size: 13px; margin-top: 2px; }
.chat.dc .m.cont .ava { visibility: hidden; height: 4px; }
.chat.dc .bub, .chat.dc .m.mine .bub { background: none; border: 0; border-radius: 0; padding: 0; max-width: none; flex: 1; min-width: 0; }
.chat.dc .bub .who, .chat.dc .m.mine .bub .who { display: flex; gap: 8px; align-items: baseline; font-size: 15px; color: var(--ink); margin-bottom: 1px; }
.chat.dc .m.mine .bub .who { color: var(--blue); }
.chat.dc .m.cont .bub .who { display: none; }
.chat.dc .bub .who .t { float: none; margin: 0; font-size: 11.5px; color: var(--ink3); }
.chat.dc .bub .tc { display: none; position: absolute; left: 10px; top: 4px; width: 40px; text-align: right; font-size: 10.5px; color: var(--ink3); }
.chat.dc .m.cont:hover .bub .tc { display: block; }
.chat.dc .bub .tx { font-size: 15.5px; }
.chat.dc .bub .tx .ed { font-size: 11px; color: var(--ink3); }
.chat.dc .bub img.pic { max-width: min(520px, 100%); max-height: 360px; border-radius: 6px; border: 1px solid var(--line2); margin: 6px 0 4px; }
.chat.dc .mt { display: none; position: absolute; right: 14px; top: -8px; background: #fff; border: 1px solid var(--line2); border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.chat.dc .m:hover .mt { display: flex; }
.chat.dc .mt button { border: 0; background: none; padding: 4px 7px; color: var(--ink2); }
.chat.dc .mt button:hover { color: var(--blue); }
.chat.dc .edit textarea { width: 100%; border: 1px solid var(--blue); border-radius: 6px; padding: 6px 8px; font-size: 15px; resize: vertical; }
.chat.dc .edit .btns { margin-top: 4px; align-items: center; }
.chat .fileinfo { display: flex; align-items: center; gap: 8px; }
.chat .fileinfo img { max-height: 70px; max-width: 120px; border-radius: 5px; border: 1px solid var(--line2); }
.chat.dc form { padding: 8px 14px 12px; border-top: 0; }
.chat.dc textarea { border-radius: 10px; background: #f3f5f8; border-color: #e3e8ee; }
.chat.dc textarea:focus { background: #fff; border-color: var(--blue); outline: 0; }
/* доска рядом */
.chb { width: 46%; min-width: 280px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line2); position: relative; background: #fff; }
.chb-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line2); min-height: 44px; font-size: 14.5px; }
.chb-h .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.chb-h .bstate { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.chb-h .who { display: flex; gap: 3px; }
.chb-h .who .ava { width: 22px; height: 22px; font-size: 10px; color: #fff; }
.chb-h .grow { flex: 1; }
.chb-stage { flex: 1; min-height: 0; position: relative; }
.chb-rs { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
.chb-rs:hover { background: rgba(43, 98, 184, .2); }
dialog.imgview { max-width: 96vw; width: auto; background: transparent; box-shadow: none; padding: 0; }
dialog.imgview img { max-width: 94vw; max-height: 90vh; display: block; border-radius: 6px; }
dialog.imgview button { position: fixed; top: 12px; right: 12px; border: 0; border-radius: 50%; width: 38px; height: 38px; background: rgba(0,0,0,.6); color: #fff; }
dialog.imgview::backdrop { background: rgba(10, 14, 20, .82); }
@media (max-width: 1100px) {
  .chan.with-board .chl { display: none; }
  .chan.with-board .chl-btn { display: inline-flex; }
  body.show-chl .chan.with-board .chl { display: flex; position: absolute; z-index: 20; top: 51px; bottom: 0; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
}
@media (max-width: 900px) {
  .chl { display: none; }
  .chl-btn { display: inline-flex; }
  body.show-chl .chl { display: flex; position: fixed; z-index: 60; top: 48px; bottom: 0; left: 0; width: min(300px, 86vw); box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .chb { position: fixed; inset: 48px 0 0 0; width: auto !important; z-index: 70; }
  .chb-rs { display: none; }
  .chm-h { padding: 6px 8px; min-height: 0; gap: 6px; }
  .chm-h h1 { font-size: 18px; }
  .chm-h .stseg { order: 5; }
  #boardBtn .bl { display: none; }
  .chan { height: calc(100dvh - 48px - 62px - env(safe-area-inset-bottom)); }
  body.chanpage .page { padding: 0; }
  .chan .chat { margin: 0; height: auto; }
  .chat.dc .m { padding: 6px 10px 2px; gap: 9px; }
}
.post .att img.postpic { max-width: min(480px, 100%); max-height: 320px; border-radius: 6px; border: 1px solid var(--line2); display: block; margin-top: 6px; }
