/* Планировщик загрузки команды. Визуальный язык — недельная сетка календаря:
   спокойный фон, тонкие линии, цвет только у блоков задач и у сигналов. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1c1f26;
  --ink-2: #454b57;
  --muted: #78808f;
  --faint: #9aa2b1;
  --line: #e7e9ee;
  --line-2: #d9dce3;
  --accent: #2f6fed;
  --accent-soft: #eaf1fe;
  --ok: #2e7d4f;
  --warn: #b4770e;
  --warn-soft: #fdf5e4;
  --danger: #cf3b34;
  --danger-soft: #fdeeed;
  --shadow-1: 0 1px 2px rgba(20, 25, 35, .06), 0 1px 1px rgba(20, 25, 35, .04);
  --shadow-2: 0 6px 16px rgba(20, 25, 35, .12), 0 2px 4px rgba(20, 25, 35, .06);
  --shadow-3: 0 18px 48px rgba(20, 25, 35, .22);
  --r: 8px;
  --r-sm: 6px;
  --hour: 58px;
  --gutter: 58px;
  --topbar: 116px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  /* Системный стек вместо веб-шрифта: раздел 12 требует работы без сети, а внешний
     запрос за шрифтом — единственное, что этому мешало бы. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* числа в сетке и таблицах не должны «прыгать» при перерисовке */
.num, .cal, .table, .loadbar-text, .ev-hours { font-variant-numeric: tabular-nums; }

h1, h2, h3 { margin: 0; font-weight: 600; }

a { color: var(--accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9ced8; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb5c2; background-clip: content-box; }

/* ------------------------------------------------------------------ кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: #f7f8fa; border-color: #c7ccd6; color: var(--ink); }
.btn:active { background: #eef0f4; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #2a63d4; border-color: #2a63d4; color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: #eceef2; border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: #edc3c0; color: var(--danger); }
.btn--icon { width: 32px; padding: 0; justify-content: center; }
.btn--sm { height: 26px; padding: 0 8px; font-size: 13px; }

.seg {
  display: inline-flex;
  padding: 2px;
  background: #eceef2;
  border-radius: var(--r-sm);
}
.seg button {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.field {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  min-width: 0;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { height: auto; padding: 7px 9px; resize: vertical; min-height: 62px; line-height: 1.4; }
select.field { padding-right: 4px; }

label.lbl { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ каркас */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-x: hidden;
}

.top {
  flex: 0 0 auto;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px 0;
}

.top-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 40px;
}

.top-lead,
.top-nav,
.top-week-tools {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.top-lead {
  flex: 1 1 360px;
  flex-wrap: wrap;
}

.top-nav {
  flex: 1 1 240px;
  justify-content: flex-end;
}

.top-week-tools {
  flex: 0 1 auto;
  flex-wrap: wrap;
}
.top-week-tools .seg { flex: 0 0 auto; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-right: 4px;
  flex: 0 0 auto;
}
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -.1px; }

.weeknav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
}
.weeknav .title {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  max-width: 240px;
  text-align: center;
  letter-spacing: -.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weeknav .field[type="date"] { width: 150px; flex: 0 0 auto; }

.top-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 26px;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 4px;
}
.top-meta .acct,
.top-meta .btn { flex: 0 0 auto; }

.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); flex: 0 0 auto; }

.savestate { display: inline-flex; align-items: center; gap: 6px; }
.savestate::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-2);
}
.savestate[data-kind="ok"]::before { background: var(--ok); }
.savestate[data-kind="busy"]::before { background: var(--accent); }
.savestate[data-kind="warn"]::before { background: var(--warn); }
.savestate[data-kind="err"]::before { background: var(--danger); }

.presence {
  color: var(--muted);
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabs button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  flex: 0 0 auto;
}
.top-nav > .btn--primary,
.top-nav > .chip--off { flex: 0 0 auto; }
.tabs button:hover { background: #f0f2f5; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ------------------------------------------------------------------ плашки */

.banners { flex: 0 0 auto; padding: 0 16px; }
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-size: 13px;
  box-shadow: var(--shadow-1);
}
.banner b { font-weight: 600; }
.banner--warn { background: var(--warn-soft); border-color: #f0dfb8; color: #6d4a06; }
.banner--err { background: var(--danger-soft); border-color: #f0c8c5; color: #8d2723; }
.banner--info { background: var(--accent-soft); border-color: #cfe0fd; color: #1c4fb5; }
.banner .btn { height: 26px; font-size: 13px; background: rgba(255, 255, 255, .7); }

/* ------------------------------------------------------------------ рабочая область */

.body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  padding: 10px 16px 14px;
  gap: 12px;
}

.backlog {
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.backlog.is-collapsed { flex-basis: 44px; }
.backlog.is-collapsed .backlog-body,
.backlog.is-collapsed .backlog-filters,
.backlog.is-collapsed .backlog-head-main,
.backlog.is-collapsed [data-new-task] { display: none; }
.backlog.is-collapsed .backlog-head { flex-direction: column; height: 100%; align-items: center; padding: 8px 0; }
.backlog.is-empty .backlog-filters { display: none; }

.backlog-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 6px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.backlog-head-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.backlog-head h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backlog-head > .btn--icon { flex: 0 0 auto; }
.backlog-hours {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: #eef0f4;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 auto;
}
.backlog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.backlog-filters .field { height: 28px; font-size: 13px; min-width: 0; }
.backlog-filters .field--grow { grid-column: 1 / -1; }
.backlog-filters .chk { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.backlog-filters [data-sort-dir] { justify-self: start; }
.backlog-body { flex: 1 1 auto; overflow-y: auto; padding: 6px; }

.bl {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px 8px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  cursor: grab;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.bl::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--c, var(--line-2));
}
.bl:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.bl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bl.is-dragging { opacity: .4; }
.bl.has-del { padding-right: 30px; }
.bl-del {
  position: absolute;
  top: 5px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
.bl:hover .bl-del,
.bl:focus-within .bl-del,
.bl-del:focus-visible { opacity: 1; }
.bl-del:hover { background: var(--danger-soft); color: var(--danger); }
.bl-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bl.is-dragging .bl-del { opacity: 0; }
/* на тач-экранах наведения нет — иначе удалить было бы нечем */
@media (hover: none) {
  .bl-del { opacity: 1; width: 36px; height: 36px; }
  .bl.has-del { padding-right: 42px; }
  .btn--icon { width: 40px; min-width: 40px; height: 40px; }
  .table .rowact { opacity: 1; }
}
.bl-top { display: flex; align-items: baseline; gap: 6px; }
.bl-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--c-ink, var(--muted));
  flex: 0 0 auto;
}
.bl-title { font-size: 13px; line-height: 1.3; color: var(--ink); }
.bl-meta { margin-top: 3px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.bl-part { color: var(--warn); }
.pri {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  background: #eef0f4;
  color: var(--muted);
}
.pri.p0 { background: var(--danger-soft); color: var(--danger); }
.pri.p1 { background: var(--accent-soft); color: var(--accent); }
.pri.p2 { background: #eef0f4; color: var(--muted); }
.tag-late { color: var(--danger); }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.5;
}
.empty b { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* ------------------------------------------------------------------ канва */

.canvas {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* ------------------------------------------------------------------ календарная сетка */

.cal {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  position: relative;
}

/* 24 часа в колонке: шапка людей/дней липкая, часы скроллятся вниз, не разъезжая topbar */

.cal-head,
.cal-inner {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols), minmax(150px, 1fr));
  min-width: 100%;
}

.cal-head {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel);
  box-shadow: inset 0 -1px 0 var(--line);
}

.cal-corner {
  position: sticky;
  left: 0;
  z-index: 7;
  background: var(--panel);
  box-shadow: inset -1px 0 0 var(--line);
}

.colhead {
  padding: 8px 10px 7px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.colhead-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.colhead-top .spacer { flex: 0 1 4px; }
.colhead-day { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.colhead-date { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.colhead-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 40px;
  min-width: 0;
}
.colhead-role { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.colhead.is-today .colhead-date { color: var(--accent); }
.colhead.is-today .colhead-day { color: var(--accent); }
.colhead.is-off { background: #fafbfc; }

.loadbar {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.loadbar-track {
  position: relative;
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: #edeff3;
  overflow: hidden;
}
.loadbar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: #9aa6bb; }
.loadbar-fill.norm { background: #7c8aa3; }
.loadbar-fill.under { background: #a7b3c6; }
.loadbar-fill.over { background: var(--danger); }
.loadbar-text { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.loadbar-text.over { color: var(--danger); font-weight: 600; }
.loadbar-text.none { color: var(--faint); }

.gutter {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--panel);
  box-shadow: inset -1px 0 0 var(--line);
}
.gutter-h {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  color: var(--faint);
  white-space: nowrap;
}
.gutter-h:first-child { transform: translateY(2px); }
.gutter-h:last-child { transform: translateY(-100%); }

.cal-inner { position: relative; }

.col {
  position: relative;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.col.is-today { background: #fcfdff; }
.col.is-off { background: repeating-linear-gradient(135deg, #fafbfc 0 6px, #f4f5f7 6px 12px); }
.col.is-drop { background: var(--accent-soft); }

.hline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.hline.half { border-top-style: dotted; border-top-color: #f0f2f5; }

.offhours {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(244, 245, 247, .62);
  pointer-events: none;
  z-index: 0;
}

.lunch {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(135deg, #f2f3f6 0 5px, #eceef2 5px 10px);
  border-top: 1px solid #e4e6eb;
  border-bottom: 1px solid #e4e6eb;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lunch span { font-size: 11px; color: var(--faint); letter-spacing: .04em; }

.nowline {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid var(--danger);
  z-index: 5;
  pointer-events: none;
}
.nowline::before {
  content: "";
  position: absolute;
  left: -4px; top: -5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.offnote {
  position: absolute;
  top: 12px; left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  pointer-events: none;
}

.freehint {
  position: absolute;
  left: 8px; right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #b6bdc9;
  pointer-events: none;
}

/* ------------------------------------------------------------------ блок задачи */

.ev {
  position: absolute;
  left: 4px;
  right: 5px;
  padding: 4px 7px 4px 9px;
  border-radius: var(--r-sm);
  background: var(--ev-bg, #eef2f7);
  border: 1px solid var(--ev-line, #dfe4ec);
  color: var(--ev-ink, var(--ink));
  cursor: grab;
  overflow: hidden;
  z-index: 2;
  transition: box-shadow .12s, filter .12s;
  user-select: none;
  -webkit-user-select: none;
  /* pan-y: иначе карточка перехватывает жест и сетка не скроллится на телефоне */
  touch-action: pan-y;
}
.ev::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ev-accent, #9aa6bb);
}
.ev:hover { box-shadow: var(--shadow-2); z-index: 3; }
.ev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 3; }
.ev.is-selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); z-index: 4; }
.ev.is-dragging { opacity: .85; box-shadow: var(--shadow-3); z-index: 20; cursor: grabbing; }
.ev.is-ghost { opacity: .35; border-style: dashed; box-shadow: none; }

.ev-line { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.ev-code { font-size: 11px; font-weight: 700; letter-spacing: .02em; flex: 0 0 auto; opacity: .85; }
.ev-title { font-size: 12.5px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-sub { display: flex; align-items: center; gap: 5px; margin-top: 1px; font-size: 11px; opacity: .75; }
.ev-hours { font-weight: 500; }
.ev-flag { font-size: 11px; line-height: 1; }
.ev-person { font-size: 11px; opacity: .8; }

.ev.sz-sm { padding-top: 2px; padding-bottom: 2px; }
.ev.sz-sm .ev-sub { display: none; }
.ev.sz-xs { padding: 1px 6px 1px 9px; }
.ev.sz-xs .ev-sub { display: none; }
.ev.sz-xs .ev-line { gap: 4px; }
.ev.sz-xs .ev-title { font-size: 11.5px; }

.ev.is-broken {
  background: #f2f3f5 !important;
  border-color: #dcdfe5 !important;
  color: var(--muted) !important;
}
.ev.is-broken::before { background: #c3c8d1 !important; }

.ev-grip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 7px;
  cursor: ns-resize;
}
.ev-grip::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  width: 22px; height: 2px;
  margin-left: -11px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transition: opacity .12s;
}
.ev:hover .ev-grip::after { opacity: .3; }

.selbox {
  position: absolute;
  left: 4px; right: 5px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent);
}

.drag-chip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3);
  font-size: 12.5px;
  max-width: 240px;
  opacity: .96;
}

/* ------------------------------------------------------------------ модалки */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 28, 36, .38);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, calc(100dvh - 24px));
  animation: pop .14s ease-out;
}
.modal--wide { max-width: 720px; }
.overlay--page {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  z-index: 70;
  background: rgba(24, 28, 36, .55);
}
.modal--page {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  border-radius: 0;
  animation: none;
}
.modal--page .modal-body {
  display: flex;
  flex-direction: column;
  padding: 12px 20px 16px;
}
.note-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
}
.note-page .note-view.md,
.note-page .note-edit {
  max-width: none;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  resize: none;
}
@keyframes pop { from { transform: translateY(-6px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 15px; }
.modal-head, .modal-foot { flex: 0 0 auto; }
.modal-body { padding: 14px 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfbfc;
}

.form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.form .field, .form select, .form textarea { width: 100%; }
.form-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.form-err { font-size: 13px; color: var(--danger); }
.form-warn { font-size: 12px; color: var(--warn); }
.person-acct {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.person-acct h3 { font-size: 14px; }
.once-pass {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
}
.once-pass-val {
  display: block;
  font-size: 15px;
  word-break: break-all;
}

.note-field { display: grid; gap: 8px; min-width: 0; }
.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.note-head .lbl { margin: 0; }
.note-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-view.md {
  max-width: 72ch;
  min-height: 120px;
  max-height: 22vh;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f7f8fa;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  cursor: text;
  overflow-wrap: anywhere;
}
.note-edit {
  min-height: 120px;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}
.note-empty { margin: 0; color: var(--muted); }

.md p { margin: 0 0 0.8em; }
.md p:last-child { margin-bottom: 0; }
.md-h { margin: 1em 0 0.4em; font-size: 1.05em; line-height: 1.35; font-weight: 650; }
.md-h:first-child { margin-top: 0; }
h1.md-h { font-size: 1.25em; }
h2.md-h { font-size: 1.12em; }
h3.md-h, h4.md-h, h5.md-h, h6.md-h { font-size: 1.02em; }
.md-list { margin: 0 0 0.8em; padding-left: 1.3em; }
.md-list li { margin: 0.15em 0; }
.md-quote {
  margin: 0 0 0.8em;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line-2);
  color: var(--ink-2);
}
.md-pre {
  margin: 0 0 0.8em;
  padding: 10px 12px;
  overflow-x: auto;
  background: #eef0f4;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.45;
}
.md-code {
  padding: 0.1em 0.35em;
  background: #eef0f4;
  border-radius: 4px;
  font-size: 0.92em;
}
.md { overflow-wrap: anywhere; }
.md a { overflow-wrap: anywhere; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md-table-wrap { overflow-x: auto; margin: 0 0 0.8em; }
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.4;
}
.md-table th, .md-table td {
  border: 1px solid var(--line-2);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
.md-table th { background: #eef0f4; font-weight: 600; }
.md--compact { font-size: 14px; line-height: 1.55; }
.md--compact .md-table { font-size: 12px; }

.comments { display: grid; gap: 8px; min-width: 0; }
.comments-list { display: grid; gap: 8px; }
.comment {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
}
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
}
.comment-author { font-weight: 600; color: var(--ink-2); }
.comment-when { color: var(--muted); }
.comment-body { min-width: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.on { border-color: var(--ink); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.assign-list { display: grid; gap: 4px; margin-top: 6px; }
.assign-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.assign-week { color: var(--ink-2); white-space: nowrap; }
.assign-row.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.plan-block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.plan-head .lbl { margin: 0; }
.pick-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 6px;
}

/* ------------------------------------------------------------------ таблицы */

/* ------------------------------------------------------------------ доска: статусы × swimlanes */

.board {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
}
.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--panel);
}
.board-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.board-crumb-sep { color: var(--faint); }
.board-project { width: 240px; }
.board-search { width: 220px; }
.filter-drop,
.board-people { position: relative; }
.filter-drop.is-on > button,
.filter-drop.is-open > button,
.board-people.is-on > button { color: var(--accent); }
.filter-drop-menu,
.board-people-menu {
  position: fixed;
  z-index: 40;
  min-width: min(280px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  max-height: min(72vh, calc(100vh - 16px));
  padding: 10px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.filter-drop-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.filter-drop-cols {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(var(--mf-cols, 1), minmax(160px, 1fr));
  grid-template-rows: repeat(var(--mf-rows, 8), auto);
  grid-auto-flow: column;
  column-gap: 12px;
  row-gap: 2px;
  align-content: start;
}
.filter-drop-item,
.board-people-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  min-width: 0;
}
.filter-drop-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-drop-item:hover,
.board-people-item:hover { background: var(--accent-soft); }
.filter-drop-search {
  width: 100%;
  height: 30px;
  margin: 0;
}
.filter-drop-empty { padding: 4px 6px; }
.filter-drop-item[hidden] { display: none; }
.btn.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.combo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.combo-q { width: 100%; }
/* шапка: поиск и селект в ряд, без схлопывания — иначе select 170px наезжает на табы */
.combo--bar {
  flex-direction: row;
  align-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 170px;
  max-width: 100%;
}
.combo--bar .combo-q {
  width: 108px;
  flex: 0 1 108px;
  min-width: 72px;
}
.combo--bar [data-person-select],
.top-week-tools > select.field {
  width: 170px;
  flex: 0 0 auto;
  max-width: 100%;
  position: static;
}
.acct { position: relative; }
.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 12;
  min-width: 220px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acct-now { padding: 4px 6px 8px; }
.acct-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.acct-item:hover { background: var(--accent-soft); }
.empty--account {
  margin: 0 18px 12px;
  max-width: 52ch;
}
.yt-more {
  appearance: none;
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
}
.yt-more:hover { color: var(--accent); border-color: var(--accent); }
.filter-drop-clear,
.board-people-clear {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  text-align: left;
  padding: 4px 6px;
  cursor: pointer;
}

.yt-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #f7f8fa;
}
.yt-board {
  min-width: calc(220px + var(--cols, 8) * 200px);
}
.yt-grid,
.yt-lane {
  display: grid;
  grid-template-columns: 220px repeat(var(--cols, 8), minmax(200px, 1fr));
  align-items: stretch;
}
.yt-grid--head {
  position: sticky;
  top: 0;
  z-index: 5;
}
.yt-lane.is-collapsed { display: block; }
.yt-virt-pad { pointer-events: none; }
.yt-cell-stack { position: relative; }
.yt-card-pad { pointer-events: none; }
.yt-corner,
.yt-colhead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 40px;
}
.yt-corner {
  left: 0;
  z-index: 6;
  border-right: 1px solid var(--line-2);
}
.yt-colhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.yt-col-name { flex: 1 1 auto; min-width: 0; }
.yt-lane-head,
.yt-lane-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}
.yt-lane-head {
  position: sticky;
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--line-2);
}
.yt-lane-bar {
  position: sticky;
  left: 0;
  z-index: 3;
  min-height: 32px;
  padding: 4px 10px;
  background: #f3f5f8;
}
.yt-handle {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: -1px;
  user-select: none;
  flex: 0 0 auto;
}
.yt-chev {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  flex: 0 0 auto;
}
.yt-chev:hover { background: #eef0f4; color: var(--ink); }
.yt-lane-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.yt-cell {
  position: relative;
  min-height: 96px;
  padding: 28px 8px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fafbfc;
}
.yt-cell.is-drop,
.yt-lane-bar.is-drop,
.yt-lane-head.is-drop {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px #cfe0fd;
}
.yt-add {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #c5cad3;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
}
.yt-add:hover { color: var(--accent); background: var(--accent-soft); }
.yt-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  padding: 10px 10px 8px;
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: var(--shadow-1);
}
.yt-card:hover { border-color: var(--line-2); }
.yt-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.yt-card.is-dragging { opacity: .4; }
.yt-card.is-done { opacity: .55; }
.yt-card.is-done .yt-card-title { text-decoration: line-through; }
.yt-card-id {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}
.yt-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.yt-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-2);
}
.yt-av {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}
.yt-avs {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.yt-avs .yt-av + .yt-av { margin-left: -6px; box-shadow: 0 0 0 1px #fff; }
.assignee-multi { display: grid; gap: 6px; }
.assignee-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.assignee-chip { padding-right: 4px; }
.assignee-chip-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0 2px;
}
.assignee-chip-x:hover { color: var(--danger); }
.assignee-pick {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}
.yt-pri {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.yt-pri i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b9099;
  font-style: normal;
}
.yt-pri.p0 i { background: var(--danger); }
.yt-pri.p1 i { background: var(--warn); }
.yt-pri.p2 i { background: var(--muted); }
.yt-type { color: var(--muted); }
.yt-marks { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.yt-mark {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: #eef0f4;
  font-size: 10px;
  color: var(--ink-2);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yt-mark--epic { background: #efe8ff; color: #5b3d9e; }
.yt-mark--agent { background: #e7f0ff; color: #2457b8; }
.board.is-density-s .yt-marks { display: inline-flex; }

.req { color: var(--danger); font-weight: 700; }
.children-block { display: grid; gap: 8px; }
.child-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.child-mark { width: 14px; color: var(--muted); }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.chip--epic { background: #efe8ff; color: #5b3d9e; }
.table tr.is-child td { color: var(--ink-2); }

.board.is-density-s .yt-card { padding: 6px 8px; gap: 2px; }
.board.is-density-s .yt-card-title { font-size: 12px; }
.board.is-density-s .yt-card-foot { display: none; }
.board.is-density-s .yt-cell { min-height: 68px; padding: 24px 6px 6px; }

.screen { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px 28px; -webkit-overflow-scrolling: touch; }
.screen h2 { font-size: 16px; margin-bottom: 2px; }
.screen h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 8px; }
.screen-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dir-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.dir-toolbar .field { min-width: 140px; }
.dir-toolbar .field--grow { flex: 1 1 200px; min-width: 160px; }
.dir-toolbar .btn--sm { height: 32px; min-width: 36px; }
.dir-block { margin-top: 28px; }
.dir-block .screen-head { margin-bottom: 10px; }

.agenda-dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.agenda-table .field,
.agenda-table textarea { width: 100%; }
.agenda-table textarea { min-height: 56px; resize: vertical; font: inherit; }
.agenda-table .agenda-topic { min-width: 180px; }
.agenda-table .agenda-owner { min-width: 140px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.total td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: #fafbfc; }
.table .over { color: var(--danger); font-weight: 600; }
.table .under { color: var(--warn); }
.table .off { color: var(--faint); }
.table .rowact { opacity: 0; }
.table tr:hover .rowact { opacity: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: #eef0f4;
  font-size: 11.5px;
  color: var(--ink-2);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; font-style: normal; }
.chip--off { background: #f4f5f7; color: var(--faint); }

.attention { display: grid; gap: 6px; }
.attention li {
  list-style: none;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  border: 1px solid #f0dfb8;
  color: #6d4a06;
  font-size: 13px;
}
.attention li.err { background: var(--danger-soft); border-color: #f0c8c5; color: #8d2723; }
.attention li.info { background: #f4f5f7; border-color: var(--line-2); color: var(--ink-2); }

/* ------------------------------------------------------------------ вход */

.gate {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 26px 24px 22px;
}
.gate-card h1 { font-size: 18px; letter-spacing: -.2px; }
.gate-card .sub { margin: 4px 0 18px; font-size: 13px; color: var(--muted); }
.gate-form { display: grid; gap: 10px; }
.gate-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.gate-note b { color: var(--ink-2); }
.who-list { display: grid; gap: 6px; max-height: 56vh; overflow: auto; }
.gate-card [data-who-search] { margin-bottom: 10px; }
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}
.who:hover { border-color: var(--accent); background: var(--accent-soft); }
.who:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.who-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #eceef2;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  flex: 0 0 auto;
}
.who-name { font-weight: 500; }

/* ------------------------------------------------------------------ уведомление */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.toast {
  padding: 9px 14px;
  border-radius: var(--r);
  background: #262b35;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  max-width: 520px;
}
.toast.err { background: #8d2723; }
.toast.ok { background: #23573b; }

/* ------------------------------------------------------------------ печать (раздел 12) */

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .top, .banners, .backlog, .toasts, .overlay, .screen-head .btn, .noprint { display: none !important; }
  .body { padding: 0; display: block; }
  .canvas { border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .screen { overflow: visible; padding: 0; }
  .screen h3 { margin: 12px 0 5px; }
  .table { font-size: 10.5px; }
  .table td, .table th { padding: 3px 6px; }
  .attention li { background: #fff; border: 1px solid #999; color: #000; padding: 3px 6px; }
  .print-title { display: block !important; margin-bottom: 10px; }
}
.print-title { display: none; }

/* ------------------------------------------------------------------ планшет (раздел 1.2) */

@media (max-width: 1280px) {
  .weeknav .title { font-size: 14px; }
  .top-lead { flex-basis: 420px; }
  .top-nav { flex-basis: 280px; }
}
@media (max-width: 1080px) {
  .backlog { flex-basis: 240px; }
  .weeknav .title { font-size: 14px; }
  .top-lead, .top-nav { flex: 1 1 100%; }
  .top-nav { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .board-project { width: 160px; }
  .board-search { width: 140px; }
  .yt-board { min-width: calc(160px + var(--cols, 8) * 180px); }
  .yt-grid,
  .yt-lane {
    grid-template-columns: 160px repeat(var(--cols, 8), minmax(180px, 1fr));
  }
  .body { flex-direction: column; padding: 8px 10px 10px; }
  .backlog { flex: 0 0 auto; max-height: 168px; }
  .backlog.is-collapsed { max-height: 44px; }
  .backlog.is-collapsed .backlog-head { flex-direction: row; height: auto; padding: 10px 12px; }
  .top { padding: 6px 10px 0; }
  .weeknav { flex-wrap: wrap; min-width: 0; }
  .weeknav .title { min-width: 0; flex: 1 1 140px; }
  .weeknav .field[type="date"] { width: 132px; }
  .combo--bar .combo-q { width: 96px; flex-basis: 96px; }
  .form-row, .form-row--3 { grid-template-columns: 1fr; }
  .dir-toolbar .field { min-width: 0; flex: 1 1 140px; }
  .board-toolbar { gap: 6px 8px; }
  .backlog-filters { grid-template-columns: 1fr 1fr; }
  .overlay { padding: 12px 10px 10px; }
  .colhead-role { display: none; }
  .cal-head,
  .cal-inner {
    grid-template-columns: var(--gutter) repeat(var(--cols), minmax(128px, 1fr));
  }
  .cal { overscroll-behavior: contain; }
}
@media (max-width: 560px) {
  .brand { display: none; }
  .top-lead, .top-nav, .top-week-tools { flex: 1 1 100%; }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .tabs button { min-height: 36px; flex: 0 0 auto; }
  .seg button { min-height: 36px; padding: 0 12px; }
  .weeknav .field[type="date"] { display: none; }
  .combo--bar {
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
  }
  .combo--bar .combo-q,
  .combo--bar [data-person-select],
  .top-week-tools > select.field {
    width: 100%;
    max-width: 100%;
  }
  .top-main { gap: 6px; }
  .top-meta {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .top-meta .btn, .top-meta .savestate, .top-meta span { flex: 0 0 auto; }
  .gate { padding: 16px 12px; }
  .gate-card { padding: 20px 16px 16px; }
  .toast { max-width: calc(100vw - 24px); }
  .modal--wide { max-width: 100%; }
  .btn--sm { min-height: 36px; }
  .note-head { align-items: stretch; }
  .note-tools { justify-content: space-between; }
  .note-view.md, .note-edit { max-width: none; }
  .agent-shell { flex-direction: column; }
  .agent-sessions {
    flex: 0 0 auto;
    width: auto;
    max-height: 34%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.agent {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 320px;
  background: var(--panel);
}
.agent-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.agent-bar .lbl { margin: 0; }
.agent-log {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f7f8fa;
}
.agent-msg {
  max-width: min(46rem, 100%);
}
.agent-msg--user {
  align-self: flex-end;
  max-width: 42rem;
}
.agent-msg--assistant, .agent-msg--system { align-self: flex-start; }
.agent-msg--user .agent-text {
  background: var(--accent-soft);
  border: 1px solid #d5e3fb;
  border-radius: 12px 12px 4px 12px;
  padding: 10px 12px;
}
.agent-msg--assistant .agent-text {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  padding: 10px 12px;
}
.agent-who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.agent-who time { color: var(--faint); }
.agent-msg-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  opacity: 0;
}
.agent-msg:hover .agent-msg-actions { opacity: 1; }
.agent-text { line-height: 1.5; overflow-wrap: anywhere; }
.agent-text.md { max-width: none; min-height: 0; max-height: none; cursor: default; }
.agent-msg--system .agent-text {
  color: var(--muted);
  font-size: 13px;
  background: transparent;
  border: 0;
  padding: 0;
}
.agent-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: agent-caret 1s step-end infinite;
}
@keyframes agent-caret { 50% { opacity: 0; } }
.agent-activity {
  align-self: stretch;
  max-width: 46rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 8px 10px;
}
.agent-activity-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}
.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: agent-caret 1s step-end infinite;
}
.agent-think {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 7em;
  overflow: auto;
}
.agent-tools { display: grid; gap: 6px; margin-top: 8px; }
.agent-tool {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfbfc;
  padding: 4px 8px;
  font-size: 12px;
}
.agent-tool.is-run { border-color: #d5e3fb; background: var(--accent-soft); }
.agent-tool summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.agent-tool summary::-webkit-details-marker { display: none; }
.agent-tool-mark { width: 1.2em; color: var(--muted); }
.agent-tool-name { font-weight: 600; }
.agent-tool-in { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.agent-tool-out {
  margin: 8px 0 4px;
  padding: 8px;
  background: #eef0f4;
  border-radius: 4px;
  white-space: pre-wrap;
  font-size: 12px;
}
.agent-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.agent-input { flex: 1; resize: vertical; min-height: 72px; }

.agent-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  background: var(--panel);
}
.agent-sessions {
  flex: 0 0 260px;
  width: 260px;
  border-right: 1px solid var(--line);
  overflow: auto;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
}
.agent-sessions-head {
  padding: 12px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.agent-nav-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.agent-nav-item:hover { background: var(--panel); }
.agent-nav-item.is-on { background: var(--accent-soft); }
.agent-nav-item.is-run { box-shadow: inset 3px 0 0 var(--accent); }
.agent-nav-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-nav-hint { padding: 8px 14px; }
.agent-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.agent-pane .agent { height: 100%; }

.pipeline {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: #f7f8fa;
  display: grid;
  gap: 6px;
}
.pipeline-row { font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.pipeline-reports { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.pipeline-report-view { min-height: 80px; }

.access-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.access-projects { display: flex; flex-direction: column; gap: 8px; }
.access-project {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
}
.access-project-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.access-project-head:hover { background: #f6f7f9; }
.access-caret { color: var(--muted); width: 14px; flex: 0 0 14px; font-size: 11px; }
.access-project-title { flex: 1 1 auto; min-width: 0; }
.access-project-title b { display: block; }
.access-project-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.access-people { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.access-roster { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.access-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.access-member-name { flex: 1 1 auto; min-width: 0; }
.access-hint { margin: 0 0 8px; }
.access-empty { padding: 12px 8px; text-align: left; }
.access-add { position: relative; margin-top: 8px; }
.access-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 4;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  max-height: 180px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(20, 24, 32, .08);
}
.access-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.access-suggest button:hover { background: #f6f7f9; }
.access-project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ------------------------------------------------------------------ гант эпиков */

.gantt {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: var(--panel);
}
.gantt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.gantt-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.gantt-chart {
  --gantt-name-w: 260px;
  min-width: calc(var(--gantt-name-w) + var(--gantt-cols, var(--gantt-days, 14)) * var(--gantt-col-w, 16px));
  display: flex;
  flex-direction: column;
}
.gantt-chart.is-unit-day { --gantt-col-w: 44px; }
.gantt-chart.is-unit-week { --gantt-col-w: 104px; }
.gantt-chart.is-unit-month { --gantt-col-w: 152px; }
.gantt-toolbar .seg { flex: 0 0 auto; }
.gantt-toolbar .gantt-project-select { max-width: 280px; }
.gantt-toolbar .field--grow { flex: 1 1 200px; min-width: 160px; }
.gantt-pick {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 28px;
}
.gantt-pick-lead { margin: 0 0 14px; }
.gantt-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.gantt-pick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.gantt-pick-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.gantt-pick-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gantt-pick-card.is-empty { opacity: .72; }
.gantt-pick-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.gantt-pick-meta { font-size: 12px; color: var(--muted); }
.gantt-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: var(--gantt-name-w) 1fr;
  background: var(--panel);
  border-bottom: 1px solid var(--line-2);
  min-height: 44px;
  box-shadow: 0 1px 0 var(--line);
}
.gantt-head-label {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 8px rgba(20, 24, 32, .04);
}
.gantt-head-scale {
  position: relative;
  min-width: calc(var(--gantt-cols, var(--gantt-days, 14)) * var(--gantt-col-w, 44px));
}
.gantt-head-scale > .gantt-today--head { z-index: 2; }
.gantt-sprints {
  position: relative;
  height: 22px;
  background: #eef1f6;
  border-bottom: 1px solid var(--line);
}
.gantt-sprints.is-lanes-2 { height: 42px; }
.gantt-sprint {
  position: absolute;
  top: 2px;
  height: 18px;
  box-sizing: border-box;
  border: 0;
  border-radius: 4px;
  padding: 0 6px;
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.gantt-sprint.lane-1 { top: 22px; background: color-mix(in srgb, var(--accent) 10%, #fff); }
.gantt-sprint.is-on {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.gantt-sprint-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-scale { position: relative; min-height: 44px; }
.gantt-scale.is-month { min-height: 28px; }
.gantt-scale.is-month .gantt-months { height: 28px; }
.gantt-months,
.gantt-weeks,
.gantt-days { position: relative; height: 22px; }
.gantt-month,
.gantt-week,
.gantt-day {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
  padding: 3px 6px 0;
  border-left: 1px solid var(--line);
  box-sizing: border-box;
}
.gantt-month { font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.gantt-day { font-size: 10px; padding: 3px 2px 0; text-align: center; }
.gantt-day.is-quiet { color: var(--ink-2); }
.gantt-day.is-weekend { background: rgba(0, 0, 0, .03); }
.gantt-day.is-today { font-weight: 700; color: var(--danger); }
.gantt-row,
.gantt-project {
  display: grid;
  grid-template-columns: var(--gantt-name-w) 1fr;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}
.gantt-project { background: #f8f9fb; min-height: 36px; }
.gantt-project .gantt-name,
.gantt-project .gantt-track { background: #f8f9fb; }
.gantt-project-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.gantt-project-btn .gantt-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-name {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-width: 0;
  box-shadow: 4px 0 8px rgba(20, 24, 32, .04);
}
.gantt-row.is-epic .gantt-name { background: #fbfcfd; }
.gantt-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.gantt-chev,
.gantt-chev-gap {
  flex: 0 0 18px;
  width: 18px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.gantt-chev-gap { cursor: default; }
.gantt-track {
  position: relative;
  min-height: 34px;
  min-width: calc(var(--gantt-cols, var(--gantt-days, 14)) * var(--gantt-col-w, 44px));
}
.gantt-bar {
  position: absolute;
  top: 6px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--c) 42%, #c9ced8);
  background: color-mix(in srgb, var(--c) 22%, #fff);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  min-width: 28px;
}
.gantt-bar.is-epic { height: 24px; top: 5px; font-weight: 600; }
.gantt-bar.is-stub { min-width: 36px; }
.gantt-bar:hover { border-color: var(--accent); }
.gantt-bar.is-sprint-on { box-shadow: inset 0 0 0 2px var(--accent); }
.gantt-bar.is-sprint-dim { opacity: .38; }
.gantt-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--c) 45%, var(--ok));
  opacity: .85;
  pointer-events: none;
}
.gantt-bar-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding: 0 6px;
  overflow: hidden;
}
.gantt-bar-pct {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.gantt-bar-name,
.gantt-bar-sprint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-bar-name {
  flex: 1 1 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.gantt-bar-sprint {
  flex: 0 1 auto;
  max-width: 42%;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-2);
}
.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed var(--danger);
  pointer-events: none;
  z-index: 1;
}
.gantt-today--head { bottom: 0; top: 0; }
.gantt-empty {
  padding: 28px 18px;
  color: var(--muted);
}
.gantt-more { padding: 6px 12px 10px 40px; }
.gantt-row[role="button"] { cursor: pointer; }
.gantt-row[role="button"]:hover .gantt-name { background: var(--accent-soft); }

