/* Доска задач. Токены — из style.css, поэтому светлая и тёмная тема
   работают без своих правил. Двигаются только transform и opacity. */

.kb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:root {
  --kb-ease: cubic-bezier(.2, .8, .2, 1);
  --kb-ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --kb-new: var(--t-info);
  --kb-work: 262 70% 64%;
  --kb-review: var(--t-warning);
  --kb-done: var(--t-success);
}
/* Фиолетовый своего токена не имеет: в светлой теме темнее, иначе метка
   «Новая функция» на белом не читается (контраст ниже 4.5:1). */
:root[data-theme="light"] { --kb-work: 262 52% 46%; }

/* --- верх: быстрый отбор, поиск, фильтры одной строкой ------------------ */
.kb-add { display: inline-flex; align-items: center; gap: 6px; }
.kb-add:active, .kb-col-add:active { transform: scale(.96); }
.kb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-right: 4px; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--h-ctl, 36px); padding: 0 12px; border-radius: 999px;
  border: 1px solid hsl(var(--t-border)); background: hsl(var(--t-card)); color: hsl(var(--t-muted-foreground));
  font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color .15s var(--kb-ease), border-color .15s var(--kb-ease), background-color .15s var(--kb-ease); }
.kb-chip b { color: hsl(var(--t-foreground)); font-weight: 700; font-variant-numeric: tabular-nums; }
.kb-chip:hover { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-muted-foreground) / .4); }
.kb-chip.is-on { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-primary)); background: hsl(var(--t-primary) / .1); }
.kb-chip-today:not(.is-zero) b, .kb-chip-today:not(.is-zero) .icon { color: hsl(var(--t-warning)); }
.kb-chip-overdue:not(.is-zero) b, .kb-chip-overdue:not(.is-zero) .icon { color: hsl(var(--t-destructive-bright)); }
.kb-chip.is-zero { opacity: .7; }
.kb-search { position: relative; display: inline-flex; align-items: center; flex: 1 1 200px; max-width: 280px; }
.kb-search .icon { position: absolute; left: 10px; color: hsl(var(--t-muted-foreground)); pointer-events: none; }
.kb-search input { width: 100%; padding-left: 32px; }
.kb-bar select { min-width: 0; width: auto; }
.kb-reset { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.kb-more { margin: 0 0 0 auto; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.kb-more a { display: inline-flex; align-items: center; gap: 5px; color: hsl(var(--t-muted-foreground)); text-decoration: none; }
.kb-more a:hover { color: hsl(var(--t-foreground)); }
.kb-more a.is-on { color: hsl(var(--t-primary)); }
.kb-more b { font-weight: 600; color: hsl(var(--t-foreground)); }

/* --- колонки ------------------------------------------------------------ */
.kb { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; align-items: start;
  overflow-x: auto; padding-bottom: 8px; }
.kb-col { --col: var(--kb-new); display: flex; flex-direction: column; min-height: 260px;
  background: hsl(var(--t-surface) / .6); border: 1px solid hsl(var(--t-border)); border-radius: 14px; }
.kb-col-in_progress { --col: var(--kb-work); }
.kb-col-review { --col: var(--kb-review); }
.kb-col-done { --col: var(--kb-done); }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 14px; min-height: 44px; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: hsl(var(--col));
  box-shadow: 0 0 0 3px hsl(var(--col) / .18); }
.kb-col-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.kb-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; text-align: center;
  background: hsl(var(--t-muted)); color: hsl(var(--t-muted-foreground)); font-variant-numeric: tabular-nums; }
.kb-col-add { margin-left: auto; width: 28px; height: 28px; min-height: 0; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 8px; color: hsl(var(--t-muted-foreground)); }
.kb-col-add:hover { color: hsl(var(--t-foreground)); background: hsl(var(--t-muted) / .7); }
.kb-list { list-style: none; margin: 0; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px;
  min-height: 80px; flex: 1; }
.kb-col { position: relative; }
.kb-empty { display: none; position: absolute; top: 50px; left: 10px; right: 10px; margin: 0; padding: 18px 0;
  text-align: center; font-size: 12.5px; color: hsl(var(--t-muted-foreground));
  border: 1.5px dashed hsl(var(--t-border)); border-radius: 10px; pointer-events: none; }
.kb-col:not(:has(.kb-card)) .kb-empty { display: block; }
.kb-col:has(.kb-inline) .kb-empty { display: none; }

/* Быстрое добавление прямо в колонке. */
.kb-inline { margin: 2px 8px 6px; padding: 8px; border-radius: 10px; background: hsl(var(--t-card));
  border: 1px solid hsl(var(--t-primary) / .6); box-shadow: 0 0 0 3px hsl(var(--t-primary) / .12);
  display: flex; flex-direction: column; gap: 8px; animation: kb-arrive .18s var(--kb-ease); }
.kb-inline textarea { width: 100%; min-height: 54px; resize: none; border: 0; padding: 2px 4px; background: transparent;
  font: inherit; font-weight: 500; line-height: 1.35; }
.kb-inline textarea:focus { outline: 0; box-shadow: none; }
.kb-inline-foot { display: flex; gap: 6px; align-items: center; }
.kb-inline-foot .small { height: 28px; min-height: 0; padding: 0 10px; font-size: 12.5px; }
.kb-inline-x { margin-left: auto; width: 28px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }

/* --- карточка ----------------------------------------------------------- */
.kb-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  background: hsl(var(--t-card)); border: 1px solid hsl(var(--t-border)); border-radius: 10px;
  box-shadow: 0 1px 2px hsl(0 0% 0% / .12); cursor: grab; user-select: none;
  transition: border-color .16s var(--kb-ease), box-shadow .16s var(--kb-ease), transform .16s var(--kb-ease); }
.kb-card.is-locked { cursor: pointer; background: hsl(var(--t-card) / .55); border-style: dashed; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .kb-card:hover { border-color: hsl(var(--t-primary) / .45); box-shadow: 0 4px 14px hsl(0 0% 0% / .16); transform: translateY(-1px); }
  /* Чужую задачу не поднимаем: она не перетаскивается, только открывается. */
  .kb-card.is-locked:hover { transform: none; box-shadow: none; }
}
.kb-card:focus-visible { outline: 0; box-shadow: var(--ring); border-color: hsl(var(--t-ring)); }
.kb-card.is-current { border-color: hsl(var(--t-primary)); }
.kb-card.prio-urgent { box-shadow: inset 2px 0 0 hsl(var(--t-destructive-bright)), 0 1px 2px hsl(0 0% 0% / .12); }
@media (hover: hover) and (pointer: fine) {
  .kb-card.prio-urgent:hover { box-shadow: inset 2px 0 0 hsl(var(--t-destructive-bright)), 0 4px 14px hsl(0 0% 0% / .16); }
}
.kb-title { color: hsl(var(--t-foreground)); text-decoration: none; font-weight: 500; line-height: 1.35;
  overflow-wrap: anywhere; }
.kb-title::after { content: ""; position: absolute; inset: 0; } /* весь прямоугольник кликается */
.kb-tags, .kb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-meta { font-size: 12px; color: hsl(var(--t-muted-foreground)); }
.kb-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.kb-who { margin-left: auto; width: 24px; height: 24px; font-size: 10px; }
.kb-who-none { border: 1px dashed hsl(var(--t-border)); border-radius: 50%; }

.kb-tag, .kb-prio { --tag: var(--t-muted-foreground); display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px;
  color: hsl(var(--tag)); background: hsl(var(--tag) / .14); }
.kb-tag-bug { --tag: var(--t-destructive-bright); }
.kb-tag-improvement { --tag: var(--t-info); }
.kb-tag-feature { --tag: var(--kb-work); }
.kb-tag-work { --tag: var(--t-muted-foreground); }
.kb-prio-high { --tag: var(--t-warning); }
.kb-prio-urgent { --tag: var(--t-destructive-bright); }
.kb-due-overdue { color: hsl(var(--t-destructive-bright)); font-weight: 600; }
.kb-due-today { color: hsl(var(--t-warning)); font-weight: 600; }
.kb-due-done { text-decoration: line-through; }

/* --- перетаскивание ----------------------------------------------------- */
.kb-ghost { background: hsl(var(--t-primary) / .06) !important; border: 1.5px dashed hsl(var(--t-primary) / .55) !important;
  box-shadow: none !important; transform: none !important; }
.kb-ghost > * { visibility: hidden; }
.kb-fallback { opacity: 1 !important; cursor: grabbing; transform: rotate(2deg) scale(1.03);
  box-shadow: 0 18px 40px hsl(0 0% 0% / .28), 0 2px 6px hsl(0 0% 0% / .18) !important;
  border-color: hsl(var(--t-primary) / .7) !important; }
body.kb-dragging, body.kb-dragging * { cursor: grabbing !important; }
.kb-card.is-new { animation: kb-arrive .6s var(--kb-ease); }
@keyframes kb-arrive { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Пока доска подменяется после опроса, слой перехода не должен забирать
   нажатие: иначе карточку, схваченную в эту долю секунды, не перетащить. */
::view-transition { pointer-events: none; }
::view-transition-group(*) { animation-duration: .22s; animation-timing-function: var(--kb-ease); }

/* --- панель задачи ------------------------------------------------------ */
.kb-scrim { position: fixed; inset: 0; z-index: 60; background: hsl(var(--t-scrim) / .45);
  opacity: 0; transition: opacity .22s var(--kb-ease); }
.kb-scrim.is-open { opacity: 1; }
.kb-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(600px, 100vw);
  background: hsl(var(--t-background)); border-left: 1px solid hsl(var(--t-border));
  box-shadow: -24px 0 48px hsl(0 0% 0% / .25); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform .26s var(--kb-ease-drawer); outline: 0; }
.kb-panel.is-open { transform: none; }
.kb-panel-inner { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
.kb-panel-inner.is-saving { cursor: progress; }
.kb-panel-head { display: flex; align-items: center; gap: 8px; color: hsl(var(--t-muted-foreground)); font-size: 13px; }
.kb-panel-head .kb-panel-id { margin-right: auto; }
.kb-icon-btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.kb-saved[hidden] { display: none; }
.kb-saved { display: inline-flex; align-items: center; gap: 4px; color: hsl(var(--t-success)); font-size: 12px; }
.kb-edit-title { font-size: 20px; font-weight: 600; line-height: 1.3; padding: 6px 8px; margin: 0 -8px;
  border-color: transparent; background: transparent; resize: none; overflow: hidden;
  min-height: 0; field-sizing: content; } /* высота по тексту; где не умеют — подгоняет tasks.js */
.kb-edit-title:hover:not([readonly]) { background: hsl(var(--t-muted) / .5); }
.kb-edit-title[readonly] { background: transparent; }
.kb-props { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; align-items: center; margin: 0; font-size: 13.5px; }
.kb-props dt { color: hsl(var(--t-muted-foreground)); }
.kb-props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kb-author { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Выбор кнопками: статус и важность — полосой, исполнитель — лицами. Под
   каждой кнопкой — радио, фокус с клавиатуры виден кольцом. */
.kb-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px;
  background: hsl(var(--t-muted) / .55); border: 1px solid hsl(var(--t-border)); }
.kb-seg-opt { --c: var(--t-muted-foreground); position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: hsl(var(--t-muted-foreground)); white-space: nowrap; user-select: none;
  transition: color .14s var(--kb-ease), background-color .14s var(--kb-ease), box-shadow .14s var(--kb-ease); }
.kb-seg-opt input, .kb-person input { position: absolute; opacity: 0; pointer-events: none; }
.kb-seg-opt:hover { color: hsl(var(--t-foreground)); }
.kb-seg-opt:has(input:checked) { color: hsl(var(--t-foreground)); background: hsl(var(--t-card));
  box-shadow: 0 1px 2px hsl(0 0% 0% / .2), inset 0 0 0 1px hsl(var(--c) / .55); }
.kb-seg-opt:has(input:focus-visible), .kb-person:has(input:focus-visible) { box-shadow: var(--ring); }
.kb-seg-opt:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.kb-seg-opt .kb-dot, .kb-seg-static .kb-dot { --col: var(--c); box-shadow: none; width: 7px; height: 7px; }
.kb-st-new { --c: var(--kb-new); }
.kb-st-in_progress { --c: var(--kb-work); }
.kb-st-review { --c: var(--kb-review); }
.kb-st-done { --c: var(--kb-done); }
.kb-pr-high { --c: var(--t-warning); }
.kb-pr-urgent { --c: var(--t-destructive-bright); }
.kb-pr-high:has(input:checked), .kb-pr-urgent:has(input:checked) { color: hsl(var(--c)); }
.kb-seg-static { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.kb-people { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-person { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px;
  border-radius: 999px; border: 1px solid hsl(var(--t-border)); cursor: pointer; font-size: 13px;
  color: hsl(var(--t-muted-foreground)); user-select: none;
  transition: color .14s var(--kb-ease), border-color .14s var(--kb-ease), background-color .14s var(--kb-ease); }
.kb-person:hover { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-muted-foreground) / .45); }
.kb-person:has(input:checked) { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-primary)); background: hsl(var(--t-primary) / .12); }
.kb-none-av { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1px dashed hsl(var(--t-muted-foreground) / .6); color: hsl(var(--t-muted-foreground)); }
.kb-person-none { padding-left: 4px; }
.kb-person-static { display: inline-flex; align-items: center; gap: 6px; }
.kb-due-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kb-due-pick input[type=date] { width: 140px; }
.kb-q { height: 30px; min-height: 0; padding: 0 10px; font-size: 12.5px; border-radius: 999px; background: transparent;
  border: 1px solid hsl(var(--t-border)); color: hsl(var(--t-muted-foreground)); }
.kb-q:hover { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-muted-foreground) / .45); }
.kb-q.is-on { color: hsl(var(--t-foreground)); border-color: hsl(var(--t-primary)); background: hsl(var(--t-primary) / .12); }
.kb-q-x { width: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.kb-q[hidden] { display: none; }
/* Поле даты в style.css не оформлено: делаем как остальные поля. */
.kb-props input[type=date] { font: inherit; color: var(--text); padding: 0 var(--sp-2) 0 var(--sp-3);
  height: 30px; border: 1px solid var(--line-ctl); border-radius: var(--r-ctl); background: hsl(var(--t-input) / .35); color-scheme: inherit; }
[data-theme="dark"] .kb-props input[type=date] { color-scheme: dark; }
.kb-tagpick { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.kb-tagpick legend { padding: 0; margin-bottom: 6px; font-size: var(--s1); color: var(--muted); }
.kb-tagpick .kb-tag { position: relative; cursor: pointer; padding: 3px 10px; background: transparent; border: 1px solid hsl(var(--tag) / .45);
  transition: background-color .14s var(--kb-ease); }
.kb-tagpick .kb-tag input { position: absolute; opacity: 0; pointer-events: none; }
.kb-tagpick .kb-tag:has(input:checked) { background: hsl(var(--tag) / .18); border-color: hsl(var(--tag)); }
.kb-tagpick .kb-tag:has(input:focus-visible) { box-shadow: var(--ring); }
.kb-tagpick .kb-tag:has(input:disabled) { cursor: default; opacity: .75; }
.kb-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: hsl(var(--t-muted-foreground)); }
.kb-body-edit { margin-left: auto; height: 26px; min-height: 0; padding: 0 8px; gap: 4px; display: inline-flex; align-items: center;
  font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.kb-body-edit[hidden] { display: none; }
.kb-body-view { padding: 8px 10px; margin: 0 -10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere;
  line-height: 1.5; cursor: text; transition: background-color .14s var(--kb-ease); }
.kb-body-view:hover { background: hsl(var(--t-muted) / .45); }
.kb-body-view.is-empty { color: hsl(var(--t-muted-foreground)); }
.kb-body { width: 100%; min-height: 96px; resize: vertical; }
.kb-create textarea { min-height: 72px; }
.kb-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.kb-note { margin: 0; font-size: 12.5px; color: hsl(var(--t-muted-foreground)); }
.kb-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.kb-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid hsl(var(--t-border));
  cursor: zoom-in; transition: transform .16s var(--kb-ease); }
.kb-thumb:hover { transform: scale(1.03); }
.kb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-doc { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid hsl(var(--t-border));
  border-radius: 8px; font-size: 12px; text-decoration: none; overflow: hidden; }
.kb-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-doc small { color: hsl(var(--t-muted-foreground)); }
.kb-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; cursor: pointer;
  border: 1.5px dashed hsl(var(--t-border)); border-radius: 10px; font-size: 13px; color: hsl(var(--t-muted-foreground));
  transition: border-color .14s var(--kb-ease), background-color .14s var(--kb-ease); }
.kb-drop:hover, .kb-drop.is-over { border-color: hsl(var(--t-primary)); background: hsl(var(--t-primary) / .06); color: hsl(var(--t-foreground)); }
.kb-drop.is-busy { opacity: .6; pointer-events: none; }
.kb-comments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.kb-comments > li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.kb-comments .kb-who { margin: 0; width: 28px; height: 28px; }
.kb-comment-head { margin: 0 0 2px; font-size: 12.5px; }
.kb-comment-head time { color: hsl(var(--t-muted-foreground)); }
.kb-comment-form { display: flex; flex-direction: column; gap: 8px; }
.kb-comment-form textarea { width: 100%; resize: vertical; min-height: 64px; }
.kb-comment-form button { align-self: flex-end; }
.kb-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-pending:empty { display: none; }
/* Файл, ждущий отправки с комментарием. Своё имя класса: под общим .kb-chip
   он сжимал фильтры над доской. */
.kb-pend { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border-radius: 8px;
  background: hsl(var(--t-muted)); font-size: 12px; max-width: 220px; animation: kb-arrive .2s var(--kb-ease); }
.kb-pend img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.kb-pend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-pend button { width: 22px; height: 22px; padding: 0; min-height: 0; }
.kb-history summary { cursor: pointer; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: hsl(var(--t-muted-foreground)); }
.kb-history ol { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.kb-history time { color: hsl(var(--t-muted-foreground)); }
.kb-head-btn { height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  transition: color .15s var(--kb-ease), background-color .15s var(--kb-ease); }
.kb-archive-btn:hover, .kb-archive-btn.is-armed { color: hsl(var(--t-destructive-bright)); }
.kb-archive-btn.is-armed { background: hsl(var(--t-destructive) / .12); }
.kb-role { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: hsl(var(--t-muted) / .5); border: 1px solid hsl(var(--t-border)); font-size: 13px; }
.kb-role p { margin: 0; flex: 1; color: hsl(var(--t-muted-foreground)); line-height: 1.45; }
.kb-role b { color: hsl(var(--t-foreground)); font-weight: 600; }
.kb-role button { flex: none; }

/* --- окно создания и увеличение скриншота ------------------------------- */
.kb-create, .kb-zoom { border: 1px solid hsl(var(--t-border)); border-radius: 14px; padding: 0;
  background: hsl(var(--t-card)); color: hsl(var(--t-foreground)); box-shadow: 0 24px 64px hsl(0 0% 0% / .35);
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .18s var(--kb-ease), transform .18s var(--kb-ease), overlay .18s allow-discrete, display .18s allow-discrete; }
.kb-create[open], .kb-zoom[open] { opacity: 1; transform: none; }
@starting-style { .kb-create[open], .kb-zoom[open] { opacity: 0; transform: translateY(8px) scale(.98); } }
.kb-create::backdrop, .kb-zoom::backdrop { background: hsl(var(--t-scrim) / .5); backdrop-filter: blur(2px); }
.kb-create { width: min(620px, calc(100vw - 32px)); }
.kb-create form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.kb-create-head { display: flex; align-items: center; justify-content: space-between; }
.kb-create-head h2 { margin: 0; font-size: 18px; }
.kb-create-title { width: 100%; height: auto; padding: 4px 0; border: 0; background: transparent; box-shadow: none;
  font-size: 19px; font-weight: 600; }
.kb-create-title:focus { outline: 0; box-shadow: none; }
.kb-create-body { width: 100%; min-height: 72px; resize: vertical; }
.kb-props-create { padding-top: 10px; border-top: 1px solid hsl(var(--t-border)); }
.kb-create-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; }
.kb-hint { margin-right: auto; font-size: 12px; color: hsl(var(--t-muted-foreground)); }
.kb-zoom { max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); cursor: zoom-out; background: transparent; border: 0; }
.kb-zoom img { display: block; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); border-radius: 10px; }

/* --- уведомления -------------------------------------------------------- */
.kb-toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.kb-toast { pointer-events: auto; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 10px;
  background: hsl(var(--t-popover)); border: 1px solid hsl(var(--t-border)); box-shadow: 0 10px 30px hsl(0 0% 0% / .25);
  font-size: 13.5px; opacity: 0; transform: translateY(8px); transition: opacity .2s var(--kb-ease), transform .2s var(--kb-ease); }
.kb-toast.is-in { opacity: 1; transform: none; }
.kb-toast.is-out { opacity: 0; transform: translateY(4px); }
.kb-toast-error { border-color: hsl(var(--t-destructive) / .6); }

/* Колонки, куда эту карточку перенести нельзя, пока её тащат. */
.kb-col { transition: opacity .15s var(--kb-ease); }
.kb-dragging .kb-col.is-closed { opacity: .45; }

/* --- архив ------------------------------------------------------------------ */
.kb-archive { grid-column: 1 / -1; width: 100%; max-width: 760px; border: 1px solid hsl(var(--t-border)); border-radius: 14px; background: hsl(var(--t-card) / .4); }
.kb-archive-list { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kb-archive-list .kb-meta { flex-wrap: wrap; gap: 4px 14px; color: hsl(var(--t-muted-foreground)); font-size: 12.5px; }
.kb-archive .muted { padding: 0 16px 16px; margin: 0; }

/* --- узкий экран -------------------------------------------------------- */
@media (max-width: 760px) {
  .kb { grid-template-columns: repeat(4, 84vw); scroll-snap-type: x mandatory; }
  .kb-col { scroll-snap-align: start; }
  .kb-grid { grid-template-columns: 1fr; }
  .kb-props { grid-template-columns: 1fr; gap: 2px; }
  .kb-props dd { margin-bottom: 8px; }
  .kb-search { max-width: none; flex-basis: 100%; }
  .kb-more { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .kb-card, .kb-stat, .kb-panel, .kb-scrim, .kb-create, .kb-zoom, .kb-toast, .kb-thumb, .kb-chip,
  .kb-drop, .kb-tagpick .kb-tag, .kb-add, .kb-pend, .kb-inline { transition: none !important; animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Сделанное не спорит за внимание с тем, что ещё в работе. */
.kb-col-done .kb-card:not(:hover) .kb-title { color: hsl(var(--t-muted-foreground)); }
.kb-col-done .kb-card:not(:hover) .kb-tags { opacity: .7; }

/* «Сообщить о проблеме»: одно поле, скриншоты миниатюрами, что стало с прошлыми. */
.rp { max-width: 620px; display: grid; gap: 8px; }
.rp-form { position: relative; display: grid; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.rp-form:focus-within { border-color: hsl(var(--t-ring) / .55); box-shadow: 0 0 0 3px hsl(var(--t-ring) / .12); }
.rp-form textarea { width: 100%; min-height: 112px; max-height: 50vh; resize: vertical; padding: 14px 16px 8px;
  border: 0; background: transparent; box-shadow: none; font-size: 14px; line-height: 1.5; }
.rp-form textarea:focus { outline: none; box-shadow: none; }
.rp-shots { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 10px; }
.rp-shot { position: relative; width: 76px; height: 56px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--tint); }
.rp-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-shot.is-doc { display: flex; align-items: center; padding: 6px; font-size: 11px; color: var(--muted);
  overflow-wrap: anywhere; line-height: 1.2; }
.rp-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; line-height: 1; color: #fff; background: rgb(0 0 0 / .6);
  cursor: pointer; opacity: 0; transition: opacity .12s; }
.rp-shot:hover .rp-x, .rp-x:focus-visible { opacity: 1; }
@media (hover: none) { .rp-x { opacity: 1; } }
.rp-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px 12px; border-top: 1px solid var(--line); }
.rp-attach { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0;
  border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.rp-attach:hover { background: var(--tint); color: var(--text); }
.rp-hint { display: inline-flex; gap: 3px; }
.rp-hint kbd { font: 500 11px/1 var(--font-mono, ui-monospace, monospace); padding: 3px 5px; border-radius: 4px;
  border: 1px solid var(--line); border-bottom-width: 2px; color: var(--faint); }
.rp-foot .primary { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.rp-drop { position: absolute; inset: 0; z-index: 1; display: none; place-content: center; justify-items: center; gap: 6px;
  border: 2px dashed hsl(var(--t-ring) / .6); border-radius: 12px; background: hsl(var(--t-card) / .92);
  color: var(--accent); font-size: 13px; pointer-events: none; }
.rp-form.is-drop .rp-drop { display: grid; }
.rp-meta { margin: 0; padding: 0 4px; font-size: 12px; color: var(--faint); }
.rp-mine { margin-top: 18px; }
.rp-mine h2 { margin: 0 0 4px; padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rp-mine ul { list-style: none; margin: 0; padding: 0; }
.rp-mine li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rp-mine li:last-child { border-bottom: 0; }
.rp-mine li > a, .rp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.rp-dot.is-in_progress, .rp-dot.is-review { background: var(--info); }
.rp-dot.is-done { background: var(--ok); }
.rp-d { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rp-st.is-in_progress, .rp-st.is-review { color: var(--info); }
.rp-st.is-done { color: var(--ok); }
@media (max-width: 560px) {
  .rp-hint { display: none; }
  .rp-mine li { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .rp-d { display: none; }
}
