.work-context {
  display: flex;
  align-items: center;
  gap: 6px;
}
.work-context select {
  max-width: 170px;
}
.work-board-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted, #7d879e);
  flex: none;
  padding: 0 1px 8px;
}
.work-board-top > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.work-board-top .button {
  padding: 5px 8px;
  font-size: 11px;
}
.work-kanban {
  display: grid;
  grid-template-columns: repeat(var(--work-cols, 3), minmax(min(280px, 100%), 1fr));
  gap: 14px;
  min-height: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.work-column {
  background: var(--panel, #f1f3f8);
  border: 1px solid var(--line, #e6e9f0);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.work-column > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px;
  flex: none;
}
.work-column > header b {
  font-size: 13px;
  overflow: hidden;
  white-space: normal;
}
.work-column > header .button {
  margin-left: auto;
  padding: 3px 9px;
}
.work-task-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 10px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.work-task-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 112px;
  text-align: left;
  border: 1px solid var(--line, #e3e7ef);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface, #fff);
  color: inherit;
  cursor: pointer;
  flex: none;
  font: inherit;
}
.work-task-card:hover {
  border-color: var(--primary, #7967f4);
  box-shadow: 0 3px 12px #6255bc16;
}
.work-task-card > b {
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  white-space: normal;
}
.work-task-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}
.work-task-tags .tag {
  font-size: 10px;
  padding: 2px 5px;
  white-space: normal;
}
.work-priority {
  font-size: 10px;
  border-radius: 5px;
  padding: 3px 6px;
  white-space: normal;
}
.work-task-tags > .work-priority {
  margin-left: auto;
}
.work-priority-0 {
  background: #e9f2f8;
  color: #3a6887;
}
.work-priority-1 {
  background: #efecff;
  color: #7760bb;
}
.work-priority-2 {
  background: #fff1db;
  color: #aa671c;
}
.work-priority-3 {
  background: #ffe5e9;
  color: #b13e58;
}
.work-task-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--muted, #7a879e);
}
.work-task-meta > span {
  max-width: 58%;
  overflow: hidden;
  white-space: normal;
}
.work-task-counts {
  font-size: 11px;
  color: var(--muted, #7a879e);
  height: 13px;
}
.work-drop-active {
  outline: 2px dashed #8d75f4;
  outline-offset: -3px;
  background: #8d75f412;
}
.work-overdue {
  border-color: #dd8294;
}
.work-overdue-text {
  color: #bf3f5b !important;
}
.work-empty {
  padding: 20px;
  color: var(--muted, #7a879e);
  font-size: 12px;
}
.work-timeline {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
.work-timeline-head,
.work-timeline-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.work-timeline-head {
  border-bottom: 1px solid var(--line, #e5e9f1);
  font-size: 11px;
  flex: none;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}
.work-timeline-head > div:first-child {
  padding: 14px 12px;
}
.work-timeline-days {
  display: grid;
  grid-template-columns: repeat(var(--work-days), minmax(0, 1fr));
}
.work-timeline-days > span {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #8794ad16;
  min-width: 0;
  font-size: 10px;
}
.work-weekend {
  background: #8794ad0d;
}
.work-today {
  background: #8060eb22 !important;
  color: #8060eb;
  font-weight: 700;
}
.work-timeline-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.work-timeline-row {
  height: 49px;
  border-bottom: 1px solid var(--line, #e9ecf2);
}
.work-timeline-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  overflow: hidden;
}
.work-timeline-name b {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  white-space: normal;
  width: 100%;
}
.work-timeline-name small {
  font-size: 10px;
  color: var(--muted, #7a879e);
}
.work-timeline-track {
  position: relative;
  min-width: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / var(--work-days) - 1px),
    #8794ad16 calc(100% / var(--work-days) - 1px),
    #8794ad16 calc(100% / var(--work-days))
  );
}
.work-timeline-bar {
  position: absolute;
  top: 11px;
  height: 26px;
  border: 1px solid #7561bd28;
  border-radius: 5px;
  text-align: left;
  padding: 3px 7px;
  font-size: 10px;
  white-space: normal;
  overflow: hidden;
  cursor: pointer;
}
.work-timeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #e5e9f1);
  font-size: 10px;
  color: var(--muted, #7a879e);
  flex: none;
}
.work-timeline-footer .button {
  padding: 4px 9px;
}
.work-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.work-detail-status {
  display: flex;
  gap: 8px;
}
.work-description {
  white-space: pre-wrap;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.6;
}
.work-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.work-facts > div {
  font-size: 11px;
  color: var(--muted, #7a879e);
  min-width: 0;
}
.work-facts b {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text, #27334b);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.work-stage-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.work-stage-actions .button {
  font-size: 10px;
  padding: 6px 8px;
}
.work-lock {
  padding: 12px;
  background: #fff1d9;
  color: #8f6a2e;
  font-size: 12px;
  border-radius: 7px;
}
.work-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}
.work-checklist-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 51px;
  border-bottom: 1px solid var(--line, #e9ecf2);
}
.work-checklist-row > span {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  white-space: normal;
}
.work-checklist-row .button {
  font-size: 10px;
  padding: 5px 7px;
}
.work-check-toggle {
  border: 0;
  background: transparent;
  color: var(--primary, #7f69e9);
  font-size: 22px;
  padding: 5px;
  cursor: pointer;
}
.work-completed {
  text-decoration: line-through;
  opacity: 0.6;
}
.work-comments article {
  border-bottom: 1px solid var(--line, #e5e9f1);
  padding: 10px 0;
}
.work-comments header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.work-comments time {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted, #7a879e);
}
.work-comments .button {
  font-size: 9px;
  padding: 4px 6px;
}
.work-comments p {
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: hidden;
  margin: 8px 0 0;
}
.work-history article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line, #e5e9f1);
  font-size: 11px;
}
.work-history small {
  color: var(--muted, #7a879e);
  font-size: 10px;
}
.work-related-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line, #e5e9f1);
  font-size: 12px;
}
.work-picker {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.work-picker p {
  font-size: 11px;
  color: var(--muted, #7a879e);
  margin: 0;
}
.work-picker-items {
  min-height: 40px;
}
.work-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  font-size: 12px;
  border-bottom: 1px solid var(--line, #e5e9f1);
}
.work-check[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .work-context select {
    max-width: 125px;
  }
  .work-timeline-head,
  .work-timeline-row {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .work-timeline-days > span {
    font-size: 8px;
  }
}
@media (max-width: 600px) {
  .work-board-top > span {
    max-width: 40%;
    overflow: hidden;
    white-space: normal;
  }
  .work-context select {
    max-width: 110px;
  }
  .work-timeline-head,
  .work-timeline-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }
  .work-timeline-head > div:first-child {
    font-size: 9px;
  }
  .work-timeline-name {
    padding-left: 6px;
  }
  .work-timeline-name b {
    font-size: 10px;
  }
  .work-timeline-days > span {
    font-size: 7px;
  }
  .work-timeline-footer > span {
    max-width: 55%;
    font-size: 9px;
  }
  .work-facts {
    gap: 10px;
  }
  .work-task-card {
    min-height: 100px;
  }
}
.work-reader {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* Keep selection dialogs stable while filtering the scrollable list. */
.modal.visible:has(.work-picker) {
  height: min(620px, calc(100dvh - 24px));
}
.modal:has(.work-picker) #konturForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.work-picker {
  min-height: 0;
  flex: 1;
  gap: 10px;
}
.work-picker > .select-control,
.work-picker > p,
.work-picker-status {
  flex: none;
}
.work-picker-items {
  height: min(288px, max(104px, calc(100dvh - 380px)));
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  position: relative;
  border-block: 1px solid var(--line, #e5e9f1);
}
.work-check {
  min-height: 42px;
  padding: 8px 0;
  align-items: flex-start;
  line-height: 1.45;
  box-sizing: border-box;
}
.work-check input {
  flex: none;
  margin: 3px 0 0;
}
.work-check > span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.work-check small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.work-picker-empty {
  padding: 18px 0 !important;
}
.work-picker-status {
  min-height: 28px;
  line-height: 1.35;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
}
.work-task-card > b,
.work-column > header b {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.work-column > header b {
  flex: 1;
  line-height: 1.4;
  min-width: 0;
}
.work-column > header {
  align-items: flex-start;
}
.work-column > header .button,
.work-column > header .count {
  flex: none;
}
.work-task-card {
  min-height: 0;
  padding: 12px;
  gap: 9px;
}
.work-task-tags {
  flex-wrap: wrap;
  overflow: visible;
  align-items: flex-start;
}
.work-task-tags .tag {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.work-task-meta {
  flex-wrap: wrap;
  line-height: 1.4;
  gap: 6px;
}
.work-task-meta > span {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
}
.work-task-counts {
  height: auto;
  min-height: 13px;
}
.work-description,
.work-comments p,
.work-checklist-row > span {
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.work-checklist-row {
  align-items: flex-start;
  padding: 8px 0;
  min-height: 0;
  gap: 8px;
}
.work-checklist-row > span {
  line-height: 1.5;
  padding-top: 7px;
}
.work-checklist-row .button,
.work-check-toggle {
  flex: none;
}
.work-detail-status,
.work-comments header,
.work-related-row {
  flex-wrap: wrap;
}
.work-related-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  flex: 1;
}
.work-board-top {
  align-items: flex-start;
  line-height: 1.4;
}
.work-board-top > span {
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.work-board-top > div {
  flex: none;
}
.work-timeline-row {
  height: 92px;
}
.work-timeline-name b {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.work-timeline-name small {
  margin-top: 5px;
}
.work-timeline-bar {
  top: 30px;
  min-width: 6px;
  padding: 0;
}
@media (max-width: 650px) {
  .work-board-top > span {
    max-width: 100%;
    font-size: 10px;
  }
  .work-board-top > div {
    gap: 4px;
  }
  .work-board-top .button {
    padding: 4px 5px;
    font-size: 10px;
  }
  .work-facts {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 600px) {
  .modal.visible:has(.work-picker) {
    height: calc(100dvh - 16px);
  }
  .modal:has(.work-picker) .modal-head {
    padding-block: 12px;
  }
  .modal:has(.work-picker) .modal-body {
    padding-block: 10px;
  }
  .work-picker {
    gap: 7px;
  }
  .work-check {
    min-height: 38px;
    padding-block: 6px;
  }
}

.work-task-open-note {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.work-task-card-minimal {
  padding: 8px;
  min-height: 34px;
  justify-content: center;
}
