:root {
  --bg: #f2f6fb; --surface: #ffffff; --surface2: #f6f9fd; --border: #dde6f1; --border2: #c6d4e6;
  --text: #15223a; --muted: #5f7190; --faint: #93a3bd;
  --accent: #1599f9; --accent-2: #2aa8ff; --accent-deep: #0d41a5; --accent-weak: #e3f1ff; --accent-text: #0b5bb8;
  --danger: #e0443f; --danger-weak: #fdeaea; --warn: #e08a00; --warn-weak: #fff3dc; --ok: #13a36a; --ok-weak: #dff6ec;
  --st-backlog: #9fb0c8; --st-todo: #2aa8ff; --st-doing: #f0a020; --st-review: #7c5cff; --st-done: #16b26f;
  --shadow: 0 1px 2px rgba(13,65,165,.06), 0 6px 18px rgba(13,65,165,.07);
  --shadow-lg: 0 10px 40px rgba(13,65,165,.22);
  --radius: 12px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1626; --surface: #152036; --surface2: #1a2740; --border: #253554; --border2: #334a73;
  --text: #e6edf8; --muted: #9db0cc; --faint: #6a7fa3;
  --accent: #2aa8ff; --accent-2: #5cbcff; --accent-deep: #0d41a5; --accent-weak: #16305a; --accent-text: #8fd0ff;
  --danger: #ff6b66; --danger-weak: #3d1f24; --warn: #ffb547; --warn-weak: #3a2c12; --ok: #3dd68c; --ok-weak: #123627;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
}}
:root[data-theme="dark"] {
  --bg: #0e1626; --surface: #152036; --surface2: #1a2740; --border: #253554; --border2: #334a73;
  --text: #e6edf8; --muted: #9db0cc; --faint: #6a7fa3;
  --accent: #2aa8ff; --accent-2: #5cbcff; --accent-deep: #0d41a5; --accent-weak: #16305a; --accent-text: #8fd0ff;
  --danger: #ff6b66; --danger-weak: #3d1f24; --warn: #ffb547; --warn-weak: #3a2c12; --ok: #3dd68c; --ok-weak: #123627;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 650; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border2); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent-text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface2); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.icon { padding: 6px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { width: 100%; padding: 8px 10px; border: 1px solid var(--border2); border-radius: 8px; background: var(--surface); outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
textarea.input { resize: vertical; min-height: 80px; }
label.f { display: block; margin-bottom: 10px; } label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.chk { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge.role { background: var(--accent-weak); color: var(--accent-text); }
.badge.p1 { background: var(--danger-weak); color: var(--danger); } .badge.p2 { background: var(--warn-weak); color: var(--warn); }
.badge.p4 { color: var(--faint); }
.badge.due.over { background: var(--danger-weak); color: var(--danger); } .badge.due.today { background: var(--warn-weak); color: var(--warn); }
.badge.blocked { background: var(--surface2); color: var(--muted); border: 1px dashed var(--border2); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--faint); flex: none; letter-spacing: .3px; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; } .avatar.empty { background: transparent; border: 1px dashed var(--border2); color: var(--faint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chip.on { border-color: var(--accent); background: var(--accent-weak); color: var(--accent-text); }
.chip:hover { border-color: var(--accent); }
kbd { font: 11px/1 ui-monospace, Menlo, monospace; padding: 2px 5px; border: 1px solid var(--border2); border-bottom-width: 2px; border-radius: 4px; background: var(--surface2); color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---- layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: 6px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; display: block; } .brand .logo img { width: 100%; height: 100%; display: block; } .brand { color: var(--accent-deep); letter-spacing: .2px; }
.nav { display: flex; gap: 2px; }
.nav a { white-space: nowrap; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface2); color: var(--text); } .nav a.on { background: var(--accent-weak); color: var(--accent-text); }
.quick { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.quick input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border2); border-radius: 9px; background: var(--bg); outline: none; }
.quick input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-weak); }
.quick .plus { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.quick .hint { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--muted); z-index: 30; display: none; }
.quick input:focus + .plus + .hint { display: block; }
.quick .hint b { color: var(--text); }
.bell { position: relative; } .bell .n { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.banner { display: flex; align-items: center; gap: 12px; padding: 9px 16px; background: var(--warn-weak); color: var(--text); border-bottom: 1px solid var(--border); }
.banner.danger { background: var(--danger-weak); }
.filters { display: flex; align-items: center; gap: 8px; padding: 10px 16px; flex-wrap: wrap; }
.filters .sep { width: 1px; height: 20px; background: var(--border); }
.filters #search { width: 150px; padding: 5px 10px; border-radius: 999px; }
.filters select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; }
main { padding: 0 16px 40px; }

/* ---- board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: calc(100vh - 170px); align-items: start; }
.col { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 150px); }
.col.over { border-color: var(--accent); background: var(--accent-weak); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; position: sticky; top: 0; }
.col-h .cnt { color: var(--muted); font-weight: 500; } .col-h .add { margin-left: auto; }
.col-h .wip { font-size: 11px; color: var(--warn); font-weight: 600; }
.cards { padding: 4px 8px 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--pc, var(--border2)); border-radius: 9px; padding: 9px 10px 8px; box-shadow: 0 1px 1px rgba(0,0,0,.03); cursor: pointer; transition: box-shadow .12s, transform .12s; }
.card:hover { box-shadow: var(--shadow); border-color: var(--border2); border-left-color: var(--pc, var(--border2)); }
.card.dragging { opacity: .4; transform: rotate(1.5deg); }
.card .t { font-weight: 500; line-height: 1.35; margin-bottom: 6px; word-break: break-word; }
.card .pr { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; display: flex; gap: 5px; align-items: center; }
.card .meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.card .meta .avatar { margin-left: auto; }
.card.done .t { color: var(--muted); text-decoration: line-through; }
.card.blocked-card { opacity: .7; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(128,128,160,.06) 8px 10px), var(--surface); }
.card.mine { box-shadow: inset 0 0 0 1px var(--accent-weak); }
.cl-mini { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.cl-mini.full { color: var(--ok); }

/* ---- list */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface2); cursor: pointer; user-select: none; white-space: nowrap; }
table.list th.sorted { color: var(--accent-text); }
table.list td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:hover td { background: var(--surface2); }
table.list tr.grp td { background: var(--surface2); font-weight: 600; padding: 6px 12px; font-size: 12.5px; }
table.list .tt { cursor: pointer; font-weight: 500; }
table.list select.st { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12.5px; }
.st-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.st-pill .dot { width: 9px; height: 9px; }

/* ---- my */
.my { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.panel h3 .cnt { background: var(--surface2); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.focus { border: 2px solid var(--st-doing); }
.focus.none { border-style: dashed; border-color: var(--danger); background: var(--danger-weak); }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--border); }
.trow:last-child { border-bottom: 0; } .trow:hover { background: var(--surface2); }
.trow .t { flex: 1; font-weight: 500; min-width: 0; } .trow .t .pr { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.trow.big .t { font-size: 16px; }

/* ---- calendar */
.cal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal .dh { background: var(--surface2); padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.cal .d { background: var(--surface); min-height: 108px; padding: 6px; }
.cal .d.out { background: var(--surface2); opacity: .6; } .cal .d.wk { background: var(--surface2); }
.cal .d .n { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.cal .d.today .n b { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal .d .n .plus { opacity: 0; cursor: pointer; } .cal .d:hover .n .plus { opacity: 1; }
.cal .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; background: var(--accent-weak); color: var(--accent-text); border-left: 3px solid var(--pc, var(--accent)); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.done { opacity: .5; text-decoration: line-through; } .cal .ev.over { background: var(--danger-weak); color: var(--danger); }

/* ---- team */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.member { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.member.idle { border-color: var(--danger); }
.member .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.member .hd .nm { font-weight: 600; } .member .hd .rl { font-size: 12px; color: var(--muted); }
.member .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.member .stats div { background: var(--surface2); border-radius: 8px; padding: 6px; text-align: center; }
.member .stats b { display: block; font-size: 17px; } .member .stats span { font-size: 11px; color: var(--muted); }
.member .stats .bad b { color: var(--danger); }
.member .idle-msg { color: var(--danger); font-weight: 500; font-size: 13px; }

/* ---- projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.proj { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--pc); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.proj:hover { box-shadow: var(--shadow); }
.proj .nm { font-weight: 600; font-size: 15px; } .proj .cl { color: var(--muted); font-size: 12.5px; }
.bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin: 10px 0 6px; } .bar i { display: block; height: 100%; background: var(--ok); }

/* ---- drawer & modal */
.overlay { position: fixed; inset: 0; background: rgba(10,12,24,.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer .dh { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.drawer .dh .id { color: var(--faint); font-size: 12.5px; margin-right: auto; font-family: ui-monospace, monospace; }
.drawer .body { overflow-y: auto; padding: 16px 20px 40px; flex: 1; }
.title-in { width: 100%; font-size: 19px; font-weight: 650; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; margin: 0 -8px 10px; background: transparent; outline: none; }
.title-in:hover { border-color: var(--border); } .title-in:focus { border-color: var(--accent); background: var(--surface); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; align-items: center; margin-bottom: 16px; font-size: 13.5px; }
.props .k { color: var(--muted); font-size: 12.5px; }
.props select, .props input { padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; max-width: 100%; }
.props select:hover, .props input:hover { border-color: var(--border); background: var(--surface2); }
.props select:focus, .props input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.sec { margin: 18px 0; } .sec > h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.desc { white-space: pre-wrap; word-break: break-word; cursor: text; min-height: 24px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; border: 1px solid transparent; }
.desc:hover { border-color: var(--border); } .desc.empty-d { color: var(--faint); }
.desc ul { margin: 4px 0; padding-left: 20px; } .desc code { font: 12.5px ui-monospace, monospace; background: var(--surface2); padding: 1px 4px; border-radius: 4px; }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.cl-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ok); }
.cl-item .tx { flex: 1; } .cl-item.done .tx { color: var(--muted); text-decoration: line-through; }
.cl-item .del { opacity: 0; } .cl-item:hover .del { opacity: 1; }
.cl-add { display: flex; gap: 6px; margin-top: 6px; }
.cmt { display: flex; gap: 10px; margin-bottom: 12px; } .cmt .b { flex: 1; } .cmt .who { font-weight: 600; font-size: 13px; } .cmt .when { color: var(--faint); font-size: 11.5px; margin-left: 6px; }
.cmt .tx { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.act { font-size: 12.5px; color: var(--muted); padding: 3px 0; display: flex; gap: 8px; } .act .when { color: var(--faint); flex: none; width: 92px; }
.modal { position: fixed; z-index: 42; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 20px 22px; }
.modal h2 { font-size: 17px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.step { display: grid; grid-template-columns: 24px 1fr 130px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.step .n { color: var(--faint); font-size: 12px; text-align: center; }
.notifs { position: absolute; right: 60px; top: 46px; width: min(380px, calc(100vw - 20px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 35; }
.notifs .hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.notif { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.notif:hover { background: var(--surface2); } .notif.unread { background: var(--accent-weak); } .notif .when { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13px; animation: slide .15s; } .toast.err { background: var(--danger); color: #fff; }
.auth { max-width: 360px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 28px; box-shadow: var(--shadow); }
.auth h1 { font-size: 20px; margin-bottom: 4px; } .auth .err { color: var(--danger); font-size: 13px; margin-top: 8px; }
.umenu { position: absolute; right: 12px; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 35; min-width: 220px; padding: 6px; }
.umenu button, .umenu a { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 7px; color: var(--text); } .umenu button:hover, .umenu a:hover { background: var(--surface2); }
.umenu .hd { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; } .tabs a.on { color: var(--accent-text); border-color: var(--accent); }
.urow { display: grid; grid-template-columns: 1fr 1fr 130px 60px auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); } .urow.off { opacity: .5; }
.pipe { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pipe .st { display: grid; grid-template-columns: 24px 130px 1fr 70px 30px; gap: 6px; margin-bottom: 4px; align-items: center; }
.pipe .st input, .pipe .st select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12.5px; width: 100%; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; } .nav { order: 3; width: 100%; overflow-x: auto; } .quick { order: 2; max-width: none; flex: 1; }
  .my { grid-template-columns: 1fr; } .props { grid-template-columns: 1fr; gap: 2px; } .props .k { margin-top: 6px; }
  .board { grid-auto-columns: 82vw; } .cal .d { min-height: 70px; } .grid2 { grid-template-columns: 1fr; }
  .urow { grid-template-columns: 1fr 1fr; } .step { grid-template-columns: 24px 1fr; } .notifs { right: 8px; }
  table.list .hm { display: none; }
}

/* ---- крупные задачи */
.works-h { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.work { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--border2)); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.work:hover { box-shadow: var(--shadow); }
.work .hd { display: flex; align-items: flex-start; gap: 8px; } .work .hd .t { font-weight: 600; font-size: 15px; flex: 1; line-height: 1.3; }
.work .pr { font-size: 12px; color: var(--muted); }
.work.accept { border-color: var(--st-review); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--surface); box-shadow: inset 0 0 0 1px var(--st-review); }
.work.archived { opacity: .75; }
.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; }
.stepper .s { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; background: var(--surface2); }
.stepper .s.done { border-color: var(--st-done); color: var(--ok); background: var(--ok-weak); }
.stepper .s.doing { border-color: var(--st-doing); color: var(--warn); background: var(--warn-weak); font-weight: 600; }
.stepper .s.review { border-color: var(--st-review); color: var(--accent-text); background: var(--accent-weak); font-weight: 600; }
.stepper .s.todo { border-color: var(--st-todo); color: var(--text); background: var(--surface); font-weight: 500; }
.stepper .arr { color: var(--faint); padding: 0 3px; font-size: 11px; }
.work .ft { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.work .ft .avs { display: flex; } .work .ft .avs .avatar { margin-left: -6px; border: 2px solid var(--surface); width: 22px; height: 22px; font-size: 9px; } .work .ft .avs .avatar:first-child { margin-left: 0; }
.unread { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.work .lm { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .work .lm b { color: var(--text); font-weight: 500; }
.nav a .unread { margin-left: 4px; font-size: 10px; padding: 0 5px; vertical-align: 1px; }

/* страница крупной задачи */
.wpage { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; height: calc(100vh - 70px); }
.wpage .side { overflow-y: auto; padding-bottom: 30px; }
.wpage .side .panel { margin-bottom: 12px; }
.wtitle { font-size: 20px; font-weight: 650; line-height: 1.3; margin-bottom: 4px; }
.wmeta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wstatus { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.wstatus.active { background: var(--warn-weak); color: var(--warn); } .wstatus.accept { background: var(--accent-weak); color: var(--accent-text); } .wstatus.done { background: var(--ok-weak); color: var(--ok); }
.stage { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stage:last-child { border-bottom: 0; }
.stage .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface2); color: var(--muted); border: 2px solid var(--border2); }
.stage.done .num { background: var(--ok); border-color: var(--ok); color: #fff; } .stage.doing .num { border-color: var(--st-doing); color: var(--warn); } .stage.review .num { border-color: var(--st-review); color: var(--accent-text); } .stage.todo .num { border-color: var(--st-todo); color: var(--st-todo); }
.stage .t { font-weight: 500; cursor: pointer; } .stage .t:hover { color: var(--accent-text); }
.stage .sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stage .sub select { font-size: 12px; padding: 1px 4px; border: 1px solid transparent; border-radius: 5px; background: transparent; max-width: 170px; } .stage .sub select:hover { border-color: var(--border); }
.stage .act { display: flex; gap: 4px; }
.stage.done .t { color: var(--muted); }
.wdesc { white-space: pre-wrap; font-size: 13.5px; }
.members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.members .m { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 8px 2px 2px; border: 1px solid var(--border); border-radius: 999px; }

/* ---- чат */
.chat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-height: 0; height: 100%; overflow: hidden; }
.chat.compact { height: 520px; }
.chat .ch { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.chat .ch .tabs { margin: 0; border: 0; } .chat .ch .tabs a { padding: 4px 8px; font-size: 12.5px; }
.chat .pins { background: var(--accent-weak); border-bottom: 1px solid var(--border); padding: 6px 12px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.chat .pins b { color: var(--accent-text); } .chat .pins .tx { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.chat .msgs.drop { outline: 2px dashed var(--accent); outline-offset: -8px; }
.daysep { text-align: center; font-size: 11.5px; color: var(--muted); margin: 10px 0 6px; position: relative; } .daysep span { background: var(--surface); padding: 0 8px; position: relative; } .daysep:before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.newsep { text-align: center; font-size: 11.5px; color: var(--accent-text); margin: 6px 0; } .newsep span { background: var(--accent-weak); padding: 1px 10px; border-radius: 999px; }
.msg { display: flex; gap: 8px; padding: 3px 6px; border-radius: 8px; position: relative; }
.msg:hover { background: var(--surface2); } .msg.hl { background: var(--warn-weak); }
.msg .avatar { margin-top: 2px; } .msg.cont .avatar { visibility: hidden; height: 0; margin: 0; }
.msg .b { flex: 1; min-width: 0; }
.msg .who { font-weight: 600; font-size: 13px; } .msg .when { color: var(--faint); font-size: 11px; margin-left: 6px; } .msg .ed { color: var(--faint); font-size: 11px; margin-left: 4px; }
.msg .tx { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; } .msg .tx .mention { color: var(--accent-text); background: var(--accent-weak); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.msg.cont .who, .msg.cont .when { display: none; } .msg.cont .b { padding-left: 0; }
.msg .quote { border-left: 3px solid var(--accent); background: var(--surface2); padding: 3px 8px; border-radius: 0 6px 6px 0; font-size: 12.5px; margin: 2px 0 4px; cursor: pointer; } .quote b { color: var(--accent-text); display: block; font-size: 12px; }
.msg.system { justify-content: center; } .msg.system .b { flex: none; text-align: center; font-size: 12px; color: var(--muted); background: var(--surface2); padding: 3px 10px; border-radius: 999px; }
.msg.deleted .tx { color: var(--faint); font-style: italic; }
.msg .pin-mark { color: var(--accent-text); font-size: 11px; margin-left: 6px; }
.msg .tools { position: absolute; right: 8px; top: -12px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); z-index: 2; }
.msg:hover .tools { display: flex; } .msg .tools button { border: 0; background: none; padding: 3px 6px; border-radius: 6px; font-size: 14px; line-height: 1; } .msg .tools button:hover { background: var(--surface2); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.att-img { display: block; max-width: min(100%, 360px); max-height: 300px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; cursor: zoom-in; }
.att-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); font-size: 12.5px; color: var(--text); max-width: 100%; } .att-file .ic { font-size: 18px; } .att-file .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; } .att-file .sz { color: var(--faint); font-size: 11px; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; } .react.my { border-color: var(--accent); background: var(--accent-weak); } .react:hover { border-color: var(--accent); }
.picker { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: flex; gap: 2px; } .picker button { border: 0; background: none; font-size: 18px; padding: 4px 6px; border-radius: 6px; } .picker button:hover { background: var(--surface2); }
.chat .composer { border-top: 1px solid var(--border); padding: 8px 10px; position: relative; }
.chat .composer .ctx { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 8px; border-left: 3px solid var(--accent); background: var(--surface2); border-radius: 0 6px 6px 0; margin-bottom: 6px; } .ctx .tx { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat .composer .pend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; } .pend .p { position: relative; } .pend img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); } .pend .f { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pend .x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 11px; line-height: 1; padding: 0; }
.chat .composer .in { display: flex; gap: 6px; align-items: flex-end; }
.chat .composer textarea { flex: 1; resize: none; max-height: 160px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border2); border-radius: 10px; background: var(--bg); outline: none; line-height: 1.4; }
.chat .composer textarea:focus { border-color: var(--accent); background: var(--surface); }
.chat .composer .hintrow { font-size: 11px; color: var(--faint); margin-top: 4px; display: flex; gap: 10px; }
.mentions { position: absolute; bottom: 100%; left: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 50; min-width: 220px; padding: 4px; } .mentions div { padding: 6px 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; } .mentions div.on, .mentions div:hover { background: var(--accent-weak); }
.chat .jump { position: absolute; right: 16px; bottom: 90px; z-index: 3; }
.chat .files-list .att-file { margin: 0 6px 6px 0; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; cursor: zoom-out; } .lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 6px; } .lightbox a { position: absolute; bottom: 14px; color: #fff; font-size: 13px; }
.msg.uploading { opacity: .6; }
@media (max-width: 900px) {
  .wpage { grid-template-columns: 1fr; height: auto; } .wpage .side { overflow: visible; } .chat { height: 70vh; } .chat.compact { height: 460px; } .works { grid-template-columns: 1fr; }
}
.wpage .side, .wpage #work-chat { min-width: 0; }
.stage .act { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) { .stage { grid-template-columns: 28px 1fr; } .stage .act { grid-column: 2; justify-content: flex-start; } }
.chat .ch .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg.system .b { flex: 0 1 auto; max-width: 100%; white-space: normal; }

/* ---- передача этапа */
.handoff { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); font-size: 12.5px; grid-column: 1 / -1; }
.handoff.check { border-color: var(--st-review); background: var(--accent-weak); }
.handoff.ready { border-color: var(--st-doing); background: var(--warn-weak); }
.handoff .hd { font-weight: 600; margin-bottom: 4px; }
.handoff .row { margin-top: 6px; flex-wrap: wrap; }
.handoff input { padding: 4px 6px; border: 1px solid var(--border2); border-radius: 6px; background: var(--surface); font-size: 12.5px; }
.handoff input[type=number] { width: 70px; } .handoff input[type=date] { width: 140px; }
.checks { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.checks .c { display: flex; gap: 6px; align-items: baseline; } .checks .c.accepted { color: var(--ok); } .checks .c.returned { color: var(--danger); } .checks .c span.cm { color: var(--muted); }
.stage .plan { font-size: 12px; color: var(--muted); }
.badge.head { background: var(--warn-weak); color: var(--warn); }
.stage .plan, .stage .handoff { grid-column: 2 / -1; }
.checks .c { display: block; } .checks .c b { margin: 0 3px; }

/* ---- таймер, участники, лента, команда */
.avatar img, img.avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.timerw { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--ok-weak); color: var(--ok); font-weight: 600; font-size: 12.5px; max-width: 320px; }
.timerw .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--text); font-weight: 500; } .timerw .d { font-variant-numeric: tabular-nums; min-width: 66px; text-align: right; } .timerw .dot { background: var(--ok); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.btn.start { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.stop { background: var(--danger); border-color: var(--danger); color: #fff; }
.avs { display: inline-flex; } .avs .avatar { margin-left: -6px; border: 2px solid var(--surface); } .avs .avatar:first-child { margin-left: 0; } .avs .avatar.run { box-shadow: 0 0 0 2px var(--ok); }
.spent { font-size: 12px; color: var(--muted); } .spent b { color: var(--text); } .spent.over b { color: var(--danger); }
.nav .sep { width: 1px; background: var(--border); margin: 4px 4px; } .nav a.sec { color: var(--faint); font-size: 13px; }
.feed { max-width: 860px; } .feed .f { display: flex; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; } .feed .f:hover { background: var(--surface2); }
.feed .f .when { color: var(--faint); font-size: 11.5px; width: 92px; flex: none; padding-top: 2px; } .feed .f .w { color: var(--accent-text); font-weight: 600; } .feed .f .tx { color: var(--text); } .feed .f.sys .tx { color: var(--muted); }
.now-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.now-grid .panel { margin: 0; } .trow .tm { font-size: 12px; color: var(--muted); white-space: nowrap; }
.member .hd .st { margin-left: auto; font-size: 12px; } .member .hd .st.run { color: var(--ok); font-weight: 600; } .member .hd .st.idle { color: var(--danger); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips .avatar { cursor: default; }
.pick { display: inline-flex; gap: 4px; align-items: center; } .pick select { font-size: 12px; padding: 2px 4px; border: 1px dashed var(--border2); border-radius: 6px; background: transparent; }
.avatar-edit { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .avatar-edit .avatar { width: 64px; height: 64px; font-size: 22px; }
@media (max-width: 860px) { .now-grid { grid-template-columns: 1fr; } .timerw { max-width: 160px; } }

/* ---- переосмысление: входящие, страница крупной задачи, этапы */
.hbtn { white-space: nowrap; }
.inbox { max-width: 900px; }
.inbox .sec-h { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.inbox .sec-h .cnt { background: var(--surface2); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.ib { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 6px; cursor: pointer; }
.ib:hover { border-color: var(--accent); } .ib.new { border-left: 3px solid var(--accent); } .ib.act { border-left: 3px solid var(--warn); }
.ib .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface2); font-size: 14px; }
.ib .ic.check { background: var(--accent-weak); } .ib .ic.ready, .ib .ic.plan { background: var(--warn-weak); } .ib .ic.accept { background: var(--ok-weak); }
.ib .b { flex: 1; min-width: 0; } .ib .t { font-weight: 500; } .ib .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib .when { font-size: 11.5px; color: var(--faint); flex: none; }
.ib .badges { display: flex; gap: 4px; flex: none; }
.badge.at { background: var(--danger-weak); color: var(--danger); } .badge.need { background: var(--warn-weak); color: var(--warn); }
.now-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0 6px; background: var(--surface2); font-size: 13.5px; }
.now-card.me { border-color: var(--warn); background: var(--warn-weak); } .now-card.accept { border-color: var(--ok); background: var(--ok-weak); }
.now-card .hd { font-weight: 600; margin-bottom: 4px; } .now-card .actions { margin: 8px 0 0; }
.stage { display: block; padding: 8px 0; }
.stage .srow { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.stage .srow .t { flex: 1; min-width: 0; font-weight: 600; } .stage.done .srow .t { color: var(--muted); font-weight: 500; }
.stage .srow .chev { color: var(--faint); font-size: 11px; width: 14px; }
.stage .stline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 0 36px; font-size: 13px; }
.stage .stline .msg { color: var(--muted); } .stage .stline .msg.me { color: var(--text); font-weight: 500; }
.stage .sbody { margin: 8px 0 4px 36px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); font-size: 13px; }
.stage .sbody h5 { margin: 10px 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); } .stage .sbody h5:first-child { margin-top: 0; }
.stage .sbody .desc { background: var(--surface); } .stage .sbody .cl-add .input { background: var(--surface); }
.stage .sbody .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.stage .sbody .meta input { padding: 3px 6px; border: 1px solid var(--border2); border-radius: 6px; background: var(--surface); font-size: 12.5px; }
.stage.hl .srow .t { color: var(--accent-text); }
.btn.lg { padding: 9px 16px; font-size: 14px; }
.who-waits { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .stage .stline, .stage .sbody { margin-left: 0; } }

/* ---- синяя тема, доводка */
.topbar { box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(13,65,165,.05); }
.nav a { border-radius: 9px; padding: 7px 11px; }
.nav a.on { background: var(--accent-weak); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--border2); }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: var(--accent); box-shadow: 0 1px 2px rgba(21,153,249,.35); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.start { background: linear-gradient(180deg, #22b877, var(--ok)); border-color: var(--ok); }
.btn { border-radius: 9px; }
.panel, .work, .proj, .member, .ib, table.list { border-color: var(--border); box-shadow: 0 1px 2px rgba(13,65,165,.04); }
.card { border-radius: 10px; }
.chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-text); }
.wstatus.active { background: var(--accent-weak); color: var(--accent-deep); } .wstatus.accept { background: var(--warn-weak); color: var(--warn); }
.now-card.me { border-color: var(--accent); background: var(--accent-weak); } .now-card.me .hd { color: var(--accent-text); }
.stage .num { border-color: var(--border2); } .stage.todo .num, .stage.hl .num { border-color: var(--accent); color: var(--accent-text); }
.stage .stline .msg.me { color: var(--accent-text); }
.unread { background: var(--accent); }

.auth { box-shadow: var(--shadow-lg); } .auth h1 { color: var(--accent-text); }
.auth .brand-big { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .auth .brand-big img { width: 44px; height: 44px; border-radius: 10px; }
.lead { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); } .lead .avatar { width: 18px; height: 18px; font-size: 8px; }
.stepper .s.doing { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-weak); }

/* ---- верхнее меню */
.topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; height: 60px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 4px 18px rgba(13,65,165,.06); }
.brand { gap: 10px; font-size: 16px; font-weight: 700; margin: 0; color: var(--accent-deep); }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 6px rgba(21,153,249,.35); }
.nav { display: flex; justify-content: center; min-width: 0; }
.navgroup { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); max-width: 100%; }
.nav a.sec-inline { display: none; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; line-height: 1; transition: background .12s, color .12s; box-shadow: none; }
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 2px 8px rgba(21,153,249,.35); }
.nav a .unread { margin: 0; background: #fff; color: var(--accent-text); min-width: 18px; padding: 0 6px; font-size: 10.5px; line-height: 17px; }
.nav a:not(.on) .unread { background: var(--accent); color: #fff; } .nav a:not(.on) .unread.warn { background: var(--warn); }
.nav a.on .unread.warn { background: #fff; color: var(--warn); }
.nav .sep { display: none; }
.nav .more { position: relative; display: inline-flex; } .nav .more .chev { font-size: 10px; opacity: .7; }
.nav .more .menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; flex-direction: column; gap: 2px; }
.nav .more.open .menu { display: flex; } .nav .more > a { cursor: pointer; }
.nav .more .menu a { border-radius: 8px; padding: 8px 10px; color: var(--text); } .nav .more .menu a:hover { background: var(--surface2); } .nav .more .menu a.on { background: var(--accent-weak); color: var(--accent-text); box-shadow: none; }
.tools-r { display: flex; align-items: center; gap: 6px; justify-self: end; }
.hbtn { padding: 8px 14px; border-radius: 999px; font-size: 13.5px; } .hbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.tools-r .btn.icon { width: 38px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.tools-r .btn.icon:hover, .tools-r .btn.icon.on { background: var(--accent-weak); color: var(--accent-text); border-color: transparent; }
.tools-r .btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.umenu-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid transparent; }
.umenu-btn:hover { background: var(--surface2); border-color: var(--border); }
.umenu-btn .avatar { width: 30px; height: 30px; font-size: 12px; } .umenu-btn .uname { font-weight: 600; font-size: 13.5px; color: var(--text); } .umenu-btn .chev { font-size: 10px; color: var(--faint); }
.bell .n { top: 2px; right: 2px; }
.timerw { margin-right: 4px; }
@media (max-width: 1100px) { .nav a .lbl { display: none; } .nav a { padding: 8px 11px; } .nav a.on .lbl { display: inline; } }
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto 1fr auto; height: auto; padding: 8px 12px; row-gap: 6px; }
  .nav { grid-column: 1 / -1; justify-content: flex-start; } .navgroup { width: 100%; overflow-x: auto; scrollbar-width: none; } .navgroup::-webkit-scrollbar { display: none; }
  .nav .more { display: none; } .nav a.sec-inline { display: inline-flex; }
  .umenu-btn .uname, .umenu-btn .chev, .hbtn .hm { display: none; } .hbtn { padding: 8px 11px; }
}
.filters .quick { flex: 1 1 240px; min-width: 200px; max-width: 420px; }

/* ---- мобильная версия: без горизонтального скролла */
html, body { max-width: 100%; overflow-x: hidden; }
.work, .proj, .member, .ib, .panel, .now-card, .stage, .trow, .card { min-width: 0; }
.works { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.stepper { min-width: 0; } .stepper .s { flex: none; }
.my > div, .wpage > div, .now-grid > div { min-width: 0; }
.list-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; } .list-wrap table.list { min-width: 640px; }
.works-h h2, .inbox h2 { white-space: nowrap; }
@media (max-width: 860px) {
  main { padding: 0 12px 70px; }
  .banner { padding: 8px 12px; gap: 8px; } .banner .muted { display: none; } .banner .btn { margin-left: auto; }
  .filters { padding: 8px 12px; gap: 6px; }
  .filters .quick { flex: 1 1 100%; max-width: none; order: -1; }
  .filters-row { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 100%; padding-bottom: 2px; scrollbar-width: none; } .filters-row::-webkit-scrollbar { display: none; }
  .filters-row > * { flex: none; }
  .works-h { gap: 6px; } .works-h .muted { display: none; } .works-h h2 { flex: 1 1 100%; } .works-h .btn { padding: 6px 9px; font-size: 12.5px; }
  .inbox > .row { flex-wrap: wrap; } .inbox > .row .muted { display: none; } .inbox > .row #ib-read { margin-left: auto; }
  .ib { padding: 9px 10px; gap: 8px; } .ib .when { display: none; } .ib .t { font-size: 13.5px; }
  .trow { flex-wrap: wrap; } .trow .t { flex: 1 1 100%; order: -1; } .trow .dot { display: none; } .trow .badge, .trow .btn { margin-left: 0; }
  .trow.big .t { font-size: 15px; }
  .panel { padding: 12px 12px; } .panel h3 { font-size: 12px; }
  .stage .srow { flex-wrap: wrap; } .stage .srow .t { flex: 1 1 60%; } .stage .srow .chev { order: 5; }
  .stage .stline { margin-left: 0; } .stage .stline .btn { padding: 7px 10px; }
  .stage .sbody .meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .wpage .side .panel:first-child .title-in { font-size: 16px; }
  .now-card { font-size: 13px; }
  .stats { grid-template-columns: repeat(4, 1fr); } .member .stats b { font-size: 15px; }
  .cal .d { min-height: 56px; padding: 3px; } .cal .d .n { font-size: 11px; } .cal .ev { font-size: 9.5px; padding: 1px 4px; border-left-width: 2px; }
  .cal-h .muted { display: none; }
  .team { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .drawer .body { padding: 12px 14px 60px; } .drawer .props { grid-template-columns: 1fr; }
  .modal { padding: 16px 14px; } .step { grid-template-columns: 24px 1fr !important; } .step .n { grid-row: span 4; }
  .chat.compact { height: 420px; } .chat .msgs { padding: 8px; } .att-img { max-width: 100%; }
  .toasts { left: 12px; right: 12px; transform: none; } .toast { font-size: 12.5px; }
  .props select, .props input { max-width: 100%; }
  .urow { grid-template-columns: 1fr; gap: 4px; }
  .pipe .st { grid-template-columns: 24px 1fr; } .pipe .st > * { grid-column: 2; } .pipe .st .n { grid-column: 1; grid-row: span 4; }
  .wmeta { font-size: 12px; }
}
@media (max-width: 480px) {
  .works-h .btn.primary#wnew { display: none; }
  .chip { padding: 4px 8px; font-size: 12px; }
}

/* ---- синяя шапка с белой надписью */
.topbar { background: linear-gradient(90deg, #0d41a5 0%, #1272d8 55%, #1599f9 100%); border-bottom: 0; box-shadow: 0 4px 18px rgba(13,65,165,.25); }
.brand { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.brand .logo { box-shadow: 0 2px 8px rgba(0,0,0,.25); background: #fff; }
.navgroup { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.nav a { color: rgba(255,255,255,.85); } .nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.nav a.on { background: #fff; color: var(--accent-deep); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.nav a:not(.on) .unread { background: #fff; color: var(--accent-deep); } .nav a:not(.on) .unread.warn { background: var(--warn); color: #fff; }
.nav a.on .unread { background: var(--accent); color: #fff; } .nav a.on .unread.warn { background: var(--warn); color: #fff; }
.nav .more .menu { background: var(--surface); } .nav .more .menu a { color: var(--text); } .nav .more .menu a.on { background: var(--accent-weak); color: var(--accent-text); }
.hbtn.primary { background: #fff; border-color: #fff; color: var(--accent-deep); box-shadow: 0 2px 8px rgba(0,0,0,.15); } .hbtn.primary:hover { background: #eef6ff; color: var(--accent-deep); filter: none; }
.tools-r .btn.icon { color: rgba(255,255,255,.9); } .tools-r .btn.icon:hover, .tools-r .btn.icon.on { background: rgba(255,255,255,.18); color: #fff; }
.bell .n { border: 2px solid #1272d8; }
.umenu-btn { color: #fff; } .umenu-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
.umenu-btn .uname { color: #fff; } .umenu-btn .chev { color: rgba(255,255,255,.7); } .umenu-btn .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.timerw { background: rgba(255,255,255,.95); color: var(--ok); }
.topbar .sep { display: none; }
