/* Цвета и шрифт — из zadachi.html. У backlog там нет своего цвета, testing красится как progress, published — как done. */

:root {
  color-scheme: light;
  --bg: #F2F4F3;
  --card: #FFFFFF;
  --border: #D3DBD8;
  --accent: #0E6B5F;
  --accent-ink: #FFFFFF;
  --accent-soft: #D5EBE6;
  --text: #17201C;
  --muted: #5A6862;
  --danger: #B42318;
  --flash: #D5EBE6;
  --st-new: #2459C2;
  --st-backlog: #5A6862;
  --st-accepted: #6A4CC4;
  --st-progress: #A85F00;
  --st-testing: #A85F00;
  --st-question: #C2410C;
  --st-review: #0B7186;
  --st-done: #2E7A33;
  --st-published: #2E7A33;
  --st-rejected: #6B7380;
  font-family: "Golos Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0F1412;
    --card: #171E1B;
    --border: #2A3531;
    --accent: #44B9A6;
    --accent-ink: #052019;
    --accent-soft: #15332D;
    --text: #E2EAE6;
    --muted: #92A29B;
    --danger: #F2796B;
    --flash: #15332D;
    --st-new: #7EA6F2;
    --st-backlog: #92A29B;
    --st-accepted: #A993EE;
    --st-progress: #E5A54B;
    --st-testing: #E5A54B;
    --st-question: #F08B5B;
    --st-review: #4FC0D4;
    --st-done: #75C27A;
    --st-published: #75C27A;
    --st-rejected: #9AA2AE;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow-wrap: anywhere;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

nav form { margin: 0; }

.wrap {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h1 { font-size: 1.6rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 28px 0 12px; }
h3 { margin: 0 0 8px; }

.card, .flash, .error {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.flash {
  background: var(--flash);
  margin-bottom: 16px;
}

.error {
  border-color: var(--danger);
  color: var(--danger);
  margin-bottom: 12px;
}

.narrow { max-width: 28rem; }

.cards, .stack, .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.stack { display: grid; gap: 12px; }
.menu { display: grid; gap: 8px; font-size: 1.05rem; }

.card-title {
  font-weight: 600;
  text-decoration: none;
}

.key {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.muted, .hint { color: var(--muted); }
.hint { margin: -4px 0 12px; font-size: 0.92rem; }

.text { white-space: pre-wrap; }

label {
  display: block;
  margin: 0 0 12px;
  font-weight: 500;
}

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input[type="text"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

textarea { resize: vertical; }

button, .button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  cursor: pointer;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.as-link {
  background: transparent;
  color: var(--accent);
  padding: 0;
}

.check {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.check input[type="checkbox"] { width: auto; margin: 0; }
.check .order, input.order { width: 5rem; margin: 0; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.row form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.row select { width: auto; margin: 0; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.details { white-space: pre-wrap; margin: 8px 0 0; }

.tabs, .chips, .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 12px 0; }
.tabs a, .chip { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: inherit; background: var(--card); }
.tabs a.on, .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters select, .filters input { width: auto; min-width: 10rem; }
.list { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.task-row { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto auto auto auto; gap: 8px 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.task-row:first-child { border-top: 0; }
.task-row:hover { background: var(--accent-soft); }
.task-row .title { font-weight: 600; }
.task-row .meta, .task-row .when, .task-row .count { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.prio { color: var(--danger); font-weight: 700; }
.st { font-weight: 600; }
.st-new { color: var(--st-new); }
.st-backlog { color: var(--st-backlog); }
.st-accepted { color: var(--st-accepted); }
.st-progress, .st-testing { color: var(--st-progress); }
.st-question { color: var(--st-question); }
.st-review { color: var(--st-review); }
.st-done, .st-published { color: var(--st-done); }
.st-rejected { color: var(--st-rejected); }
.task-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.fields { display: grid; gap: 8px; }
.instant { display: flex; gap: 8px; align-items: end; }
.instant select { width: auto; min-width: 12rem; }
.js .instant button { display: none; }
.js .instant.hours button { display: inline-flex; }
.instant.hours input { width: 100%; }
.thumb { width: min(240px, 100%); height: auto; display: block; }
.talk { list-style: none; padding: 0; display: grid; gap: 12px; }
.change { color: var(--muted); }
.files { padding-left: 18px; }

@media (max-width: 700px) {
  .task-row { grid-template-columns: auto 1fr auto; }
  .task-row .meta, .task-row .when { grid-column: 1 / -1; }

  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
  }
  .grid td { border-bottom: 0; }
}

/* ---------- Оформление (лид, 18.11.2026): таблетки статусов, карточки, страница задачи в две колонки ---------- */
:root { --shadow: 0 1px 2px rgba(23, 32, 28, .05), 0 4px 14px rgba(23, 32, 28, .04); --k-bug: #B42318; --k-feature: #0E6B5F; --k-question: #6A4CC4; --k-plugin: #A85F00; }
@media (prefers-color-scheme: dark) { :root { --shadow: none; --k-bug: #F2796B; --k-feature: #44B9A6; --k-question: #A993EE; --k-plugin: #E5A54B; } }

.top { position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.app-version { margin-right: auto; color: var(--muted); font-size: .8rem; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: .9rem; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }

.card { box-shadow: var(--shadow); }
.crumbs { margin: 0 0 10px; font-size: .92rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.page-head, .task-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.page-head h1, .task-head h1 { margin: 0; }
.actions { margin: 0; flex-wrap: wrap; }
.small { font-size: .85rem; }

button, .button { font-weight: 500; transition: filter .12s, background-color .12s; }
button:hover, .button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.button.ghost:hover { border-color: var(--accent); filter: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Проекты */
.project-card { display: flex; flex-direction: column; gap: 8px; height: 100%; text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.project-card.archived { opacity: .65; }
.project-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.project-card .card-title { color: var(--text); font-size: 1.08rem; }
.key-badge { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; }
.project-card .desc { font-size: .9rem; }
.stats { display: flex; gap: 16px; margin-top: auto; color: var(--muted); font-size: .92rem; }
.stats b { color: var(--text); font-size: 1.15rem; }
.stats .fresh b { color: var(--accent); }

/* Доска */
.toolbar { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 14px; }
.toolbar .chips, .toolbar .filters { margin: 0; }
.chip { font-size: .9rem; transition: border-color .12s; }
.chip:hover { border-color: var(--muted); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.chip.on .n { color: inherit; opacity: .75; }
.filters label { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 500; }
.filters .grow { flex: 1 1 14rem; }
.filters .grow input { width: 100%; }
.list { box-shadow: var(--shadow); }
.task-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; transition: background-color .1s; }
.task-row .num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.task-row .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task-row .title { font-weight: 500; }
.task-row .meta { font-size: .88rem; }
.task-row .side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.task-row .count { font-size: .85rem; white-space: nowrap; }
.prio { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 5px; background: var(--danger); color: var(--card); font-size: .78rem; vertical-align: 1px; }
.empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); }

.kind { font-weight: 500; color: var(--k-feature); }
.kind-bug { color: var(--k-bug); }
.kind-question { color: var(--k-question); }
.kind-plugin { color: var(--k-plugin); }

/* Таблетки статусов: цвет статуса на прозрачном фоне того же цвета */
.pill { --c: var(--st-new); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .85rem; font-weight: 500;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border-radius: 999px; padding: 2px 10px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pill.st-backlog { --c: var(--st-backlog); } .pill.st-accepted { --c: var(--st-accepted); }
.pill.st-progress, .pill.st-testing { --c: var(--st-progress); } .pill.st-question { --c: var(--st-question); }
.pill.st-review { --c: var(--st-review); } .pill.st-done, .pill.st-published { --c: var(--st-done); }
.pill.st-rejected { --c: var(--st-rejected); }

/* Задача */
.task-ref { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 4px; font-size: .9rem; }
.task-ref .ref { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.prio-badge { color: var(--danger); font-weight: 600; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.task-side { position: sticky; top: 72px; display: grid; gap: 12px; }
.task-side .instant { margin: 0; }
.task-side .instant label { margin: 0; width: 100%; font-size: .85rem; color: var(--muted); }
.task-side .instant select { min-width: 0; width: 100%; color: var(--text); }
.st-select { font-weight: 600; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .92rem; padding-top: 10px; border-top: 1px solid var(--border); }
.meta:first-child { border-top: 0; padding-top: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; }
.body-card .text { font-size: 1rem; }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.file { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 6px 0 0; }
.file form { margin: 0; }
.file-name { text-decoration: none; font-weight: 500; }
.thumb { border-radius: 8px; border: 1px solid var(--border); flex-basis: 100%; }

.talk { margin: 0 0 16px; gap: 14px; }
.comment { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.bubble { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.from-agent .bubble { border-left: 3px solid var(--accent); }
.bubble .who { margin: 0 0 4px; font-size: .92rem; }
.bubble form { margin: 6px 0 0; }
.tag { font-size: .75rem; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 0 6px; }
.change { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .88rem; color: var(--muted); padding-left: 42px; }
.change b { color: var(--text); font-weight: 500; }
.change .was { text-decoration: line-through; opacity: .8; }
.change .now { color: var(--text); font-weight: 500; }
.change-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); margin-left: -18px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 600; font-size: .9rem;
  color: #fff; background: #5A6862; }
.avatar.agent { background: var(--accent); color: var(--accent-ink); }
.avatar.hue-0 { background: #2459C2; } .avatar.hue-1 { background: #6A4CC4; } .avatar.hue-2 { background: #A85F00; }
.avatar.hue-3 { background: #0B7186; } .avatar.hue-4 { background: #2E7A33; } .avatar.hue-5 { background: #C2410C; }
.composer { display: grid; gap: 10px; }
.composer label { margin: 0; }
.composer-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.file-pick { font-size: .85rem; color: var(--muted); }
.file-pick input { margin-top: 4px; }
.pick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.pick { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; min-width: 0; }
.pick-name { font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.pick-thumb { padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--card); cursor: zoom-in;
  width: 56px; height: 56px; overflow: hidden; flex: none; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-view { border: 0; padding: 8px; border-radius: 10px; background: var(--card); color: var(--text); max-width: 94vw;
  max-height: 94vh; cursor: zoom-out; }
.pick-view::backdrop { background: rgba(0, 0, 0, .6); }
.pick-view img { display: block; max-width: calc(94vw - 16px); max-height: calc(94vh - 56px); margin: 0 auto; }
.pick-view p { margin: 6px 0 0; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .task-layout { grid-template-columns: minmax(0, 1fr); }
  .task-side { position: static; order: -1; }
}
@media (max-width: 700px) {
  .task-row { grid-template-columns: 44px minmax(0, 1fr); }
  .task-row .side { grid-column: 2; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Кнопки-переключатели в форме задачи: тип, раздел, приоритет, множественные свои поля (18.11.2026) */
.seg-field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.seg-field legend { font-weight: 500; padding: 0; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.seg label { position: relative; margin: 0; font-weight: 400; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg span { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; background: var(--card);
  transition: background-color .1s, border-color .1s, color .1s; user-select: none; }
.seg label:hover span { border-color: var(--muted); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.seg .k-bug input:checked + span { background: var(--k-bug); border-color: var(--k-bug); color: #fff; }
.seg .k-question input:checked + span { background: var(--k-question); border-color: var(--k-question); color: #fff; }
.seg .k-plugin input:checked + span { background: var(--k-plugin); border-color: var(--k-plugin); color: #fff; }
.seg .p-high input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.seg .p-low input:checked + span { background: var(--muted); border-color: var(--muted); color: var(--card); }

/* Вид доски и канбан */
.wrap.wide { width: min(1680px, 100%); }
.toolbar-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.views { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex: none; }
.views a { padding: 4px 14px; text-decoration: none; color: inherit; font-size: .9rem; }
.views a + a { border-left: 1px solid var(--border); }
.views a.on { background: var(--text); color: var(--bg); }
/* Канбан занимает окно до нижнего края: полоса прокрутки влево-вправо всегда видна, колонки листаются внутри.
   --kanban-top — где начинается канбан, его ставит скрипт; без скрипта — примерная высота шапки. */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); grid-template-rows: minmax(0, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: stretch;
  height: calc(100vh - var(--kanban-top, 300px) - 16px); min-height: 320px; }
.kcol { background: var(--card); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column;
  min-height: 0; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.kcol-head .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; margin-left: auto; }
.kcol-hours { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; flex: 1; min-height: 0; }
.task-row .hours { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kcol.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kcard { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); text-decoration: none; color: inherit; transition: border-color .1s; }
.kcard:hover { border-color: var(--accent); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard.saving { opacity: .6; pointer-events: none; }
.kcard-top { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; }
.kcard .num { color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.kcard .title { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .85rem; }
.kcard .who { margin-right: auto; }
.kmore { font-size: .88rem; text-align: center; padding: 4px; }
.kempty { color: var(--muted); font-size: .88rem; text-align: center; margin: 8px 0; }
@media (max-width: 700px) {
  .kanban { grid-auto-columns: 82vw; height: auto; min-height: 0; }
}

/* Задача рядом со списком: справа панель со страницей задачи, слева список или канбан. Ширину панели
   тянут за левый край, она запоминается в браузере. Узкий экран — задача открывается как обычно. */
html.has-panel main.wrap { width: auto; margin: 0 calc(var(--panel-w, 46vw) + 8px) 0 0; }
.kcard.on-panel, .task-row.on-panel { border-color: var(--accent); background: var(--accent-soft); }
.side-panel { position: fixed; top: var(--top-h, 0px); right: 0; bottom: 0; width: var(--panel-w, 46vw); z-index: 9;
  display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: -6px 0 18px rgba(0, 0, 0, .08); }
.side-bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--border);
  background: var(--card); font-size: .9rem; }
.side-bar .side-full { margin-right: auto; }
.side-close { padding: 2px 10px; font-size: 1.1rem; line-height: 1; }
.side-panel iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
.side-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; }
.side-panel.resizing iframe { pointer-events: none; }
html.in-frame .top, html.in-frame .crumbs { display: none; }
html.in-frame main.wrap { width: auto; padding-top: 12px; }

/* Разделы проекта: задачи, план (TRK-7), чат (TRK-8) */
.project-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.project-tabs a { padding: 6px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.project-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

/* План: тормоз — красным, волна, которая не успевает к плановой дате, — тоже */
.plan-summary p { margin: 0 0 6px; }
.late { color: var(--danger); font-weight: 600; }
.plan-blockers { border-color: var(--danger); }
.plan-blockers h2 { color: var(--danger); }
.plan-tasks { list-style: none; margin: 0; padding: 0; }
.plan-task { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--border); }
.plan-task:first-child { border-top: 0; }
.plan-task .plan-title { flex: 1 1 240px; min-width: 0; }
.plan-task.closed .plan-title { color: var(--muted); text-decoration: line-through; }
.plan-task.blocker { color: var(--danger); }
.plan-task.blocker a { color: var(--danger); font-weight: 600; }
.blocker-note { color: var(--danger); font-size: .88rem; }
.wave.late { border-color: var(--danger); }
.wave-head h2 { margin: 0 0 2px; }
.wave-head p { margin: 0 0 8px; }
.milestone { font-size: .9rem; font-weight: 500; color: var(--accent); }
.milestone.m-full { color: var(--st-accepted); }
.wave-edit { margin-top: 10px; }
.wave-edit summary { cursor: pointer; color: var(--accent); }
.wave-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
.wave-form label { flex: 1 1 160px; }
/* План сборок (TRK-13): успеваем к слоту — зелёным, готово к сборке — приглушённо */
.fits { color: var(--st-accepted); font-weight: 600; }
.ready-note { color: var(--st-accepted); font-size: .88rem; }
.plan-settings summary, .rhythm summary { cursor: pointer; color: var(--accent); }
.plan-settings fieldset { flex: 1 1 100%; border: 1px solid var(--border); border-radius: 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.plan-settings .wave-form label:has(textarea) { flex: 1 1 100%; }
.timeline { display: grid; gap: 6px; }
.timeline-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-left: 290px; }
.timeline-row { display: grid; grid-template-columns: 280px 1fr; gap: 10px; align-items: center; }
.timeline-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-track { position: relative; height: 22px; background: var(--bg); border-radius: 6px; }
.timeline-bar { position: absolute; top: 4px; bottom: 4px; min-width: 4px; border-radius: 4px; background: var(--accent); }
.timeline-bar.blocked { background: var(--st-question); }
.timeline-bar.late { background: var(--danger); }
.timeline-milestone { position: absolute; top: 0; transform: translateX(-50%); line-height: 22px; color: var(--text); }
.timeline-due { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .55; }
.timeline-done { color: var(--muted); font-size: .85rem; padding-left: 6px; line-height: 22px; }
@media (max-width: 640px) {
  .timeline-scale { margin-left: 0; }
  .timeline-row { grid-template-columns: 1fr; gap: 2px; }
}

/* Чат с ИИ */
.chat { display: grid; gap: 10px; max-height: 65vh; overflow-y: auto; }
.chat-msg { padding: 8px 12px; border-radius: 10px; max-width: 92%; }
.chat-msg.user { background: var(--accent-soft); justify-self: end; }
.chat-msg.assistant { background: var(--bg); justify-self: start; }
.chat-who { margin: 0 0 2px; font-size: .82rem; }
.chat-form { margin-top: 12px; }
