html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Обсуждения-чат в карточке позиции: цвета по роли автора, «мои» сообщения справа */
.chat-block {
  border: 1px solid #c7d2e0;
  border-radius: .6rem;
  overflow: hidden;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(33, 37, 41, .08);
}

.chat-block-header {
  background: linear-gradient(90deg, #e8eef7, #f6f9fd);
  border-bottom: 1px solid #d5deea;
  padding: .45rem .75rem;
  font-weight: 600;
}

.chat-panel {
  background: #f8f9fb;
  padding: .75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.chat-empty {
  color: #6c757d;
  font-size: .9rem;
}

.chat-msg {
  max-width: 80%;
  width: fit-content;
  margin: .25rem auto .5rem 0;
  padding: .45rem .65rem;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: .65rem;
}

.chat-msg.mine {
  margin-left: auto;
  margin-right: 0;
}

.chat-msg .chat-meta {
  font-size: .75rem;
  color: #6c757d;
  margin-bottom: .15rem;
}

.chat-msg .chat-text {
  white-space: pre-wrap;
}

/* светло-жёлтый — аккаунт-менеджер */
.chat-role-manager { background: #fff6cf; }
/* светло-зелёный — закупка */
.chat-role-procurement { background: #e3f4e6; }
/* светло-голубой — QC */
.chat-role-qc { background: #dcecf9; }
/* светло-красный — администраторы */
.chat-role-admin { background: #fbe3e3; }
.chat-role-other { background: #eef0f2; }

/* Превью позиции: миниатюра 1×1 см рядом с кодом позиции */
.position-preview {
  width: 1cm;
  height: 1cm;
  object-fit: cover;
  vertical-align: middle;
  margin-right: .25rem;
  border: 1px solid #ced4da;
  border-radius: .2rem;
  background: #f8f9fa;
}

/* Большое превью в карточке позиции (2×2 см) */
.position-preview-lg {
  width: 2cm;
  height: 2cm;
  object-fit: cover;
  border: 1px solid #ced4da;
  border-radius: .3rem;
  background: #f8f9fa;
}

/* Квадрат загрузки превью 2×2 см (клик или перетаскивание) */
.position-preview-drop {
  position: relative;
  width: 2cm;
  height: 2cm;
  border: 2px dashed #adb5bd;
  border-radius: .4rem;
  background: #f8f9fa;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.position-preview-drop.file-drop-active {
  border-color: #0d6efd;
  color: #0d6efd;
  background: #f0f7ff;
}

.position-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.1;
  font-size: .6rem;
}

.position-preview-plus {
  font-size: 1.15rem;
  font-weight: 600;
}

.position-preview-picked {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.position-preview-clear {
  position: absolute;
  top: 0;
  right: 0;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  border-radius: 0 0 0 .35rem;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .85rem;
  line-height: 1;
}