/* Кабинет SE Development. Палитра и шрифты — из визуальной системы сайта (ТЗ, раздел 4):
   «чертёжная» — графит, камень, стальной синий. Внешних шрифтов и скриптов нет. */
@font-face { font-family: "StarC"; src: url("/fonts/StarC.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #ECEBE5; --card: #F4F3EE; --fill: #E1E0D8; --line: #C9C8C0;
  --text: #1E2023; --text2: #45484D; --muted: #6C7077;
  --accent: #3E5A6D; --accent-soft: #9DB4C2; --on-accent: #F4F3EE;
  --dark-block: #1E2023; --on-dark: #ECEBE5;
  /* Состояния работ и задач. Проверены скриптом различимости (в т. ч. для дальтоников): четыре цветных состояния
     различимы между собой, «не начата» отличается формой — пустой контур. Всегда вместе с подписью. */
  --s-planned: #7C8087; --s-in_work: #2D5F8A; --s-behind: #A67C00; --s-late: #C0392B; --s-done: #2E7D4F;
  --shadow: 0 1px 2px rgba(30,32,35,.06), 0 8px 24px rgba(30,32,35,.08);
  --radius: 10px; --side: 232px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "StarC", "Arial Narrow", var(--font);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #1B1D20; --card: #24272B; --fill: #2E3237; --line: #3A3E43;
  --text: #ECEBE5; --text2: #C3C6CA; --muted: #959AA1;
  --accent: #9DB4C2; --accent-soft: #3E5A6D; --on-accent: #1B1D20;
  --dark-block: #0F1113; --on-dark: #ECEBE5;
  --s-planned: #7B8088; --s-in_work: #9DB4C2; --s-behind: #E0A23C; --s-late: #E8604F; --s-done: #5CC46E;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1B1D20; --card: #24272B; --fill: #2E3237; --line: #3A3E43;
    --text: #ECEBE5; --text2: #C3C6CA; --muted: #959AA1;
    --accent: #9DB4C2; --accent-soft: #3E5A6D; --on-accent: #1B1D20;
    --dark-block: #0F1113; --on-dark: #ECEBE5;
    --s-planned: #7B8088; --s-in_work: #9DB4C2; --s-behind: #E0A23C; --s-late: #E8604F; --s-done: #5CC46E;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; } .stack { display: grid; gap: 12px; } .stack.tight { gap: 6px; }
.num { font-variant-numeric: tabular-nums; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- логотип ---------- */
.logo { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--text); color: var(--bg); font: 26px/1 var(--head); padding-top: 3px; letter-spacing: 0; }
.logo-word { font: 24px/1 var(--head); letter-spacing: .01em; padding-top: 3px; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot-text { color: var(--muted); }
.noscript { padding: 24px; text-align: center; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 16px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--text); }
.brand:hover { text-decoration: none; }
.project { padding: 0 6px; }
.project b { display: block; font-weight: 600; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text2); }
.nav a:hover { background: var(--fill); text-decoration: none; }
.nav a.active { background: var(--dark-block); color: var(--on-dark); }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; text-align: center;
  font-size: 12px; line-height: 20px; background: var(--s-late); color: var(--card); font-weight: 600; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.who b { display: block; font-weight: 600; }
.main { min-width: 0; padding: 26px 28px 60px; }
.topbar, .tabbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; }
.page-title { font: 40px/1 var(--head); letter-spacing: .01em; padding-top: 4px; }
.page-sub { color: var(--muted); margin-top: 6px; }
.demo-strip { margin: -26px -28px 22px; padding: 7px 28px; background: var(--fill); color: var(--text2);
  font-size: 13px; border-bottom: 1px solid var(--line); }

/* ---------- элементы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text);
  white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { color: var(--s-late); }
.btn.primary.danger-fill { background: var(--s-late); border-color: var(--s-late); color: var(--card); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text2); }
.icon-btn:hover { background: var(--fill); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--fill); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--text2); white-space: nowrap; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--dark-block); border-color: var(--dark-block); color: var(--on-dark); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; } .chip.on .n { color: inherit; opacity: .7; }
.input, .select { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); }
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 30px; background-repeat: no-repeat; background-position: right 10px center;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px; background-position: right 15px center, right 10px center; }
.toolbar .select, .toolbar .input { width: auto; min-width: 150px; }
.field { display: grid; gap: 5px; } .field > span { font-size: 13px; color: var(--text2); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-title { font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px;
  background: var(--fill); color: var(--text2); font-size: 12px; line-height: 18px; white-space: nowrap; }
.badge.warn { background: transparent; border: 1px solid var(--s-behind); color: var(--text); }
.badge.alert { background: transparent; border: 1px solid var(--s-late); color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; display: inline-block; }
.dot.s-planned { background: transparent; box-shadow: inset 0 0 0 2px var(--s-planned); }
.s-planned { --c: var(--s-planned); } .s-in_work { --c: var(--s-in_work); } .s-behind { --c: var(--s-behind); }
.s-late { --c: var(--s-late); } .s-done { --c: var(--s-done); }
.p-high { --c: var(--s-late); } .p-normal { --c: var(--s-behind); } .p-low { --c: var(--s-in_work); }
.state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--text2); }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--c, var(--accent)); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.spacer { flex: 1 1 auto; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); text-align: left; }
.link-btn:hover { text-decoration: underline; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); }
a.tile:hover { border-color: var(--muted); text-decoration: none; }
.tile b { font-size: 30px; line-height: 1.1; font-weight: 600; }
.tile span { color: var(--text2); font-size: 13px; }
.tile.alert b { color: var(--s-late); }
.list { display: grid; }
.list > * { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--text); }
.list > *:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { text-decoration: none; background: var(--fill); }
button.tile { text-align: left; cursor: pointer; }
button.tile:hover { border-color: var(--muted); }
button.list-row { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; user-select: none; }
.table th.sort { cursor: pointer; } .table th.sort:hover { color: var(--text); }
.table tbody tr { cursor: pointer; } .table tbody tr:hover { background: var(--fill); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }

/* ---------- панель карточки, окна, сообщения ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; background: rgba(15,17,19,.38); }
.drawer { width: min(520px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--bg);
  border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 18px; font-weight: 600; line-height: 1.3; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 24px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); }
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: flex; padding: 16px;
  background: rgba(15,17,19,.45); overflow-y: auto; }
.modal { width: min(620px, 100%); margin: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); }
.modal.sm { width: min(420px, 100%); }
.modal-head { padding: 16px 18px 0; font-size: 18px; font-weight: 600; }
.modal-body { padding: 14px 18px; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 0 18px 16px; }
.toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 11px 14px; border-radius: 10px; background: var(--dark-block); color: var(--on-dark); box-shadow: var(--shadow); }
.toast.error { border-left: 4px solid var(--s-late); }
.tooltip { position: fixed; z-index: 70; max-width: 300px; padding: 9px 11px; border-radius: 8px; pointer-events: none;
  background: var(--dark-block); color: var(--on-dark); font-size: 13px; line-height: 1.4; box-shadow: var(--shadow); }
.tooltip b { display: block; margin-bottom: 3px; } .tooltip .muted { color: #A9ADB3; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 7px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.sec-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--fill); color: var(--text2); font-size: 13px; }
.quote { padding: 8px 12px; border-left: 3px solid var(--line); color: var(--text2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(460px, 100%); display: grid; gap: 16px; }
.login h1 { font: 34px/1.05 var(--head); padding-top: 4px; }
.user-pick { display: grid; gap: 6px; }
.user-pick button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); text-align: left; }
.user-pick button:hover { border-color: var(--muted); }

/* ---------- задачи ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto;
  padding-bottom: 8px; align-items: start; }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; min-width: 0; border-radius: var(--radius); background: var(--fill); min-height: 120px; align-content: start; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; font-weight: 600; }
.col-head .n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.tcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); text-align: left; }
.tcard:hover { border-color: var(--muted); }
.tcard.overdue { border-left: 3px solid var(--s-late); }
.tcard-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tcard-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.tcard-meta .due { white-space: nowrap; margin-left: auto; }
.tcard-meta .spacer { display: none; }
.tcard-meta .badge.clip { display: block; max-width: 55%; flex: 0 1 auto; }
.stack { grid-template-columns: minmax(0, 1fr); }
.due.over { color: var(--s-late); font-weight: 600; } .due.today { color: var(--text); font-weight: 600; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-month { font-size: 18px; font-weight: 600; min-width: 170px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { padding: 7px 8px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.cal-day { min-height: 108px; min-width: 0; padding: 6px; background: var(--card); display: grid;
  grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; }
.cal-day.other { background: var(--bg); } .cal-day.other .cal-num { color: var(--muted); }
.cal-day.drop { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-num { font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-task { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 6px; border: 0; border-radius: 5px;
  background: var(--fill); font-size: 12px; text-align: left; }
.cal-task { min-width: 0; }
.cal-task span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dow { min-width: 0; }
.cal-task.over { box-shadow: inset 3px 0 0 var(--s-late); } .cal-task.closed { opacity: .55; text-decoration: line-through; }
.cal-task[draggable="true"] { cursor: grab; }
.cal-more { font-size: 12px; color: var(--muted); padding: 0 6px; border: 0; background: none; text-align: left; }
.agenda-day { font-weight: 600; margin: 14px 0 6px; } .agenda-day:first-child { margin-top: 0; }

/* ---------- график работ ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .k-bar { width: 22px; height: 10px; border-radius: 3px; background: var(--c); }
.legend .k-base { width: 22px; height: 3px; border-radius: 2px; background: var(--muted); }
.legend .k-ms { width: 10px; height: 10px; transform: rotate(45deg); background: var(--text2); border-radius: 2px; }
.gantt-wrap { position: relative; overflow: auto; max-height: calc(100vh - 250px); min-height: 260px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overscroll-behavior: contain; }
.gantt { position: relative; }
.g-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--fill); border-bottom: 1px solid var(--line); }
.g-corner { position: sticky; left: 0; z-index: 7; flex: none; display: flex; align-items: flex-end; padding: 0 12px 7px;
  background: var(--fill); border-right: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.g-scale { position: relative; flex: none; height: 48px; }
.g-tick { position: absolute; top: 0; height: 24px; padding: 4px 6px 0; font-size: 12px; font-weight: 600; color: var(--text2);
  border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; overflow: clip; }
/* подпись месяца «прилипает» к левому краю шкалы, пока месяц виден */
.g-tl { position: sticky; left: calc(var(--name-w, 330px) + 6px); }
.g-now { position: absolute; bottom: 0; transform: translateX(-50%); padding: 0 5px; border-radius: 3px 3px 0 0;
  background: var(--s-late); color: var(--card); font-size: 10px; line-height: 14px; font-weight: 600; white-space: nowrap; }
.g-tick.sub { top: 24px; font-weight: 400; color: var(--muted); padding-top: 3px; }
.g-body { position: relative; }
.g-under { position: absolute; top: 0; z-index: 0; pointer-events: none; }
.g-row { position: relative; display: flex; height: 38px; border-bottom: 1px solid var(--line); }
.g-row:last-child { border-bottom: 0; }
.g-row:hover .g-name { background: var(--fill); }
.g-row:hover .g-track { background: rgba(127,127,127,.10); }
.g-name { position: sticky; left: 0; z-index: 4; flex: none; display: flex; align-items: center; gap: 7px; padding: 0 10px;
  background: var(--card); border-right: 1px solid var(--line); border-top: 0; border-bottom: 0; border-left: 0;
  text-align: left; min-width: 0; cursor: pointer; }
.g-name .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.g-name .sub { color: var(--muted); font-size: 12px; white-space: nowrap; }
.g-row.section .g-name { font-weight: 600; }
.g-row.section .g-name { background: var(--fill); background: color-mix(in srgb, var(--fill) 55%, var(--card)); }
.g-row.section .g-track { background: rgba(127,127,127,.07); }
.g-caret { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: -4px; border: 0; background: none;
  color: var(--muted); border-radius: 4px; flex: none; }
.g-caret:hover { background: var(--line); color: var(--text); }
.g-caret svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round;
  stroke-linejoin: round; transition: transform .12s; } .g-caret.closed svg { transform: rotate(-90deg); }
.g-track { position: relative; flex: none; cursor: pointer; }
.g-bar { position: absolute; top: 12px; height: 14px; border-radius: 4px; min-width: 4px;
  background: var(--fill); background: color-mix(in srgb, var(--c) 26%, var(--card));
  box-shadow: inset 0 0 0 1px var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent); }
.g-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--c); }
.g-bar.s-planned { background: transparent; box-shadow: none; border: 1px dashed var(--s-planned); }
.g-bar.sum { top: 15px; height: 8px; border-radius: 2px; background: var(--line); box-shadow: none; }
.g-bar.sum > i { border-radius: 2px; background: var(--muted); }
.g-base { position: absolute; top: 6px; height: 3px; border-radius: 2px; background: var(--muted); opacity: .75; }
.g-ms { position: absolute; top: 12px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); border-radius: 3px;
  background: var(--c); box-shadow: 0 0 0 2px var(--card); }
.g-ms.open { background: var(--card); box-shadow: inset 0 0 0 2px var(--c); }
.g-ms.base { top: 15px; width: 8px; height: 8px; margin-left: -4px; background: var(--muted); opacity: .6; box-shadow: none; }
.g-label { position: absolute; top: 10px; padding-left: 8px; font-size: 12px; line-height: 18px; color: var(--text2);
  white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.g-overlay { position: absolute; top: 0; z-index: 3; pointer-events: none; }
.g-grid { stroke: var(--line); stroke-width: 1; } .g-grid.soft { opacity: .5; }
.g-weekend { fill: var(--text); opacity: .035; }
.g-today { stroke: var(--s-late); stroke-width: 1.5; }
.g-today-flag { fill: var(--s-late); }
.g-dep { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .8; } .g-dep-head { fill: var(--muted); opacity: .8; }
.g-dep.bad { stroke: var(--s-late); opacity: 1; } .g-dep-head.bad { fill: var(--s-late); opacity: 1; }
.shift { font-size: 12px; white-space: nowrap; color: var(--text2); }
.shift.late::before { content: "▸ "; color: var(--s-late); }
.sched-list { display: grid; gap: 12px; }
.sched-sec-head { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 8px; color: var(--text); font-size: 16px; }
.sched-item { display: grid; gap: 6px; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid var(--line);
  background: none; text-align: left; }
.sched-item:hover { background: var(--fill); }
.summary { display: grid; gap: 14px; grid-template-columns: minmax(240px, 1.3fr) repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 14px; }
.hero { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.hero b { font-size: 34px; line-height: 1; font-weight: 600; }
.report { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.report.new { border-color: var(--s-behind); }
.log-row { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.log-row:first-child { border-top: 0; }
.range { display: flex; align-items: center; gap: 10px; } .range input[type=range] { flex: 1 1 auto; accent-color: var(--accent); }
.range output { min-width: 48px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.checks { display: grid; gap: 2px; max-height: 170px; overflow-y: auto; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); }

/* ---------- база знаний ---------- */
.kb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.kb-nav { display: grid; gap: 14px; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.kb-sec-title { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; min-height: 28px; }
.kb-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.kb-link:hover { background: var(--fill); text-decoration: none; }
.kb-link.active { background: var(--dark-block); color: var(--on-dark); }
.kb-link .t { flex: 1 1 auto; min-width: 0; }
.kb-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--s-late); flex: none; }
.kb-ok { color: var(--s-done); flex: none; width: 16px; height: 16px; }
.article { max-width: 760px; }
.article h1.a-title { font-size: 28px; line-height: 1.2; font-weight: 600; margin-bottom: 8px; }
.ack-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.ack-box.need { border-color: var(--s-behind); }
.prose { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 12px; }
.prose h1, .prose h2, .prose h3 { line-height: 1.25; font-weight: 600; margin-top: 24px; }
.prose h1 { font-size: 24px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 0; } .prose li + li { margin-top: 4px; }
.prose blockquote { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent-soft); background: var(--fill);
  border-radius: 0 8px 8px 0; color: var(--text2); }
.prose code { font: 14px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--fill); }
.prose pre { padding: 12px 14px; border-radius: 8px; background: var(--fill); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 7px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--fill); font-weight: 600; }
.prose img { max-width: 100%; border-radius: 8px; } .prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.editor textarea { min-height: 460px; font: 14px/1.55 var(--mono); }
.preview { min-height: 460px; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.ack-table td.yes { color: var(--text); } .ack-table td.no { color: var(--muted); }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .app { display: block; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar .logo { width: 30px; height: 30px; font-size: 22px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; color: var(--muted); font-size: 11px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--text); font-weight: 600; }
  .tabbar .count { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 16px; padding: 0 4px; border-radius: 8px;
    font-size: 10px; line-height: 16px; background: var(--s-late); color: var(--card); font-weight: 600; text-align: center; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .demo-strip { margin: -16px -14px 14px; padding: 6px 14px; }
  .page-title { font-size: 30px; }
  .drawer { width: 100%; border-left: 0; }
  .fields { grid-template-columns: 1fr; }
  .kb { grid-template-columns: 1fr; } .kb-nav { position: static; max-height: none; }
  .kb.reading .kb-nav { display: none; }
  .editor { grid-template-columns: 1fr; } .editor textarea, .preview { min-height: 280px; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; }
  .gantt-wrap { max-height: calc(100vh - 290px); }
  .summary { grid-template-columns: 1fr; }
  .toolbar .select, .toolbar .input { min-width: 0; flex: 1 1 140px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .modal-wrap { padding: 0; } .modal, .modal.sm { width: 100%; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .modal-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .hide-m { display: none !important; }
}
@media (min-width: 901px) { .only-m { display: none !important; } }
@media print {
  .side, .topbar, .tabbar, .toolbar, .demo-strip { display: none !important; }
  .app { display: block; } .gantt-wrap { max-height: none; overflow: visible; }
}
