/* The plan columns: ideas, tasks, works, releases.
   Black and white, businesslike, as the chat. */

.plan {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
}

.plan__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
}

.plan__error {
  margin: 0 12px 8px;
  padding: 6px 8px;
  border: 1px solid #111;
  font-size: 12px;
}

.plan__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan__empty {
  padding: 0 12px;
  font-size: 12px;
  color: #666;
}

.plan__card {
  border: 1px solid #111;
  background: #fff;
  color: #111;
  padding: 8px 10px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.45;
}

.plan__card--dropped,
.plan__card--superseded,
.plan__card--transferred {
  opacity: 0.5;
}

.plan__card--draft {
  border-style: dashed;
}

.plan__card--draft .plan__text {
  color: #666;
}

/* a work that waits for a person looks apart */
.plan__card--human {
  border-width: 2px;
}

.plan__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #666;
}

.plan__text {
  margin-top: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.plan__card {
  cursor: pointer;
}

/* a card shows the start of its text; only a release unfolds */
.plan__card:not(.plan__card--open) .plan__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.plan__details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 11px;
  color: #666;
}

.plan__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.plan__act {
  cursor: pointer;
  border: 1px solid #111;
  padding: 2px 6px;
  font-size: 11px;
  user-select: none;
  white-space: nowrap;
}

.plan__act:hover {
  background: #111;
  color: #fff;
}

/* a blocking task of the place: opens in the editor */
.plan__link {
  color: #111;
  text-decoration: underline;
  cursor: pointer;
}

.plan-editor__details {
  margin: 0 12px 8px;
}

/* an idea whose edited text waits for «сохранить» */
.plan__card--unsaved {
  box-shadow: inset 4px 0 0 #111;
}

/* the idea the editor shows */
.plan__card--editing {
  outline: 2px solid #111;
  outline-offset: -1px;
}

/* The idea editor beside the ideas: a header and the text below it. */

.plan-editor__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.plan-editor__address {
  font-size: 11px;
  color: #666;
}

.plan-editor__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* square acts like the sidebar's buttons; their icons come later */
.plan-editor__square {
  width: 30px;
  height: 30px;
  border: 1px solid #111;
  border-radius: 2px;
  cursor: pointer;
}

.plan-editor__square:hover {
  background: #111;
}

.plan-editor__square--off {
  opacity: 0.3;
  cursor: default;
}

.plan-editor__square--off:hover {
  background: none;
}

/* the history row: arrows stay at the ends, only the version moves */
.plan-editor__history {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 8px;
}

.plan-editor__version-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.plan-editor__version-frame {
  position: relative;
  flex: 1;
  height: 30px;
  overflow: hidden;
}

.plan-editor__version {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  transition: opacity var(--dur-quick, 200ms), transform var(--dur-quick, 200ms);
}

.plan-editor__targets {
  padding: 0 12px 8px;
}

.plan-editor__text {
  flex: 1;
  min-height: 0;
  margin: 0 12px 16px;
  padding: 10px;
  border: 1px solid #111;
  border-radius: 2px;
  resize: none;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #111;
  background: #fff;
}

/* a work's entries under its plan: they only grow, so they scroll apart */
.plan-editor__notes {
  flex: 0 1 auto;
  max-height: 40%;
  overflow-y: auto;
  margin: -8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-editor__note {
  border-left: 2px solid #111;
  padding: 2px 0 2px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.plan-editor__note-head {
  font-size: 11px;
  color: #666;
}
