/* <!-- быстрая правка постов | Crossbar --> */
.nqe-hidden { display: none !important; }

.nqe {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 14px;
  animation: nqe-in .22s ease-out;
  color: var(--text, #242424);
}
@keyframes nqe-in { from { opacity: 0; transform: translateY(-3px); } }

/* Поля ввода */
.nqe-subject, .nqe-text {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sec-font, sans-serif);
  font-size: inherit;
  color: var(--text, #242424);
  background: var(--base-bg2, #d7d7d9);
  border: 1px solid var(--bord, #484848);
  border-radius: var(--b-radius, 0px);
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s, background-color .2s;
}
.nqe-subject {
  font-weight: 600;
  padding: 8px 12px;
}
.nqe-text {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
  overflow-y: auto;
}
.nqe-subject:focus, .nqe-text:focus {
  border-color: var(--accent2, #cf8b3f);
  box-shadow: inset 0 0 0 1px var(--accent2, #cf8b3f);
}
.nqe-text::placeholder, .nqe-subject::placeholder {
  color: var(--tab-tex, #494848);
  opacity: .6;
}

/* Нижняя панель действий */
.nqe-bar {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  font-size: .88em;
  font-family: var(--sec-font, sans-serif);
}
.nqe-silent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--tab-tex, #494848);
  transition: color .15s;
}
.nqe-silent:hover {
  color: var(--text, #242424);
}
.nqe-silent input {
  accent-color: var(--accent2, #cf8b3f);
  margin: 0;
}
.nqe-hint {
  color: var(--tab-tex, #494848);
  opacity: .75;
  margin-right: auto;
  font-size: .92em;
}
.nqe-adv {
  color: var(--tab-tex, #494848) !important;
  text-decoration: underline !important;
  transition: color .15s;
}
.nqe-adv:hover {
  color: var(--accent2, #cf8b3f) !important;
}

/* Кнопки */
.nqe-btn {
  font-family: var(--sec-font, sans-serif);
  font-size: inherit;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: var(--b-radius, 0px);
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s, opacity .18s;
}
.nqe-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.nqe-btn:disabled {
  opacity: .45;
  cursor: default;
}
.nqe-cancel {
  background: transparent;
  color: var(--tab-tex, #494848);
  border-color: var(--bord, #484848);
}
.nqe-cancel:hover:not(:disabled) {
  background: var(--base-bg2, #d7d7d9);
  color: var(--text, #242424);
}
.nqe-save {
  font-weight: 600;
  background: var(--accent2, #cf8b3f);
  color: #fff;
  border-color: var(--accent2, #cf8b3f);
}
.nqe-save:hover:not(:disabled) {
  background: #bd7b33;
}

/* Состояние сохранения */
.nqe-busy .nqe-save {
  position: relative;
  color: transparent;
}
.nqe-busy .nqe-save::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #fff;
  border-right-color: transparent;
  animation: nqe-spin .75s linear infinite;
}
@keyframes nqe-spin { to { transform: rotate(360deg); } }
.nqe-busy .nqe-text { opacity: .6; }

/* Блок ошибки */
.nqe-error {
  padding: 8px 12px;
  border-radius: var(--b-radius, 0px);
  font-size: .9em;
  background: rgba(180, 50, 50, .12);
  border: 1px solid rgba(180, 50, 50, .3);
  color: var(--text, #242424);
}
.nqe-error::before {
  content: "•";
  color: #b43232;
  margin-right: 8px;
  font-weight: bold;
}

/* Скелетон */
.nqe-skel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 6px 0;
}
.nqe-skel span {
  height: 11px;
  background: var(--base-bg2, #d7d7d9);
  border: 1px solid var(--bord, #484848);
  animation: nqe-pulse 1.1s ease-in-out infinite alternate;
}
.nqe-skel span:nth-child(2) { width: 80%; }
.nqe-skel span:nth-child(3) { width: 50%; }
@keyframes nqe-pulse { to { opacity: .4; } }

/* Подсветка отредактированного поста */
.post.nqe-flash .post-content {
  animation: nqe-flash 1.6s ease-out;
}
@keyframes nqe-flash {
  from { background-color: rgba(207, 139, 63, .22); }
  to   { background-color: transparent; }
}

/* Всплывающий тост отмены */
.nqe-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 99999;
  transform: translate(-50%, 12px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-radius: var(--b-radius, 0px);
  background: var(--dark-bord, #353535);
  color: var(--light-text, #d7d7d9);
  border: 1px solid var(--bord, #484848);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  font: 13px/1.3 var(--sec-font, sans-serif);
  transition: opacity .25s, transform .25s;
}
.nqe-toast.nqe-show { opacity: 1; transform: translate(-50%, 0); }
.nqe-undo {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent2, #cf8b3f);
  background: none;
  border: 0;
  padding: 0;
}
.nqe-undo:hover { text-decoration: underline; }

/* Одолженная панель BB-кнопок */
.nqe-tools:empty { display: none; }
.nqe-tools { position: relative; }
.nqe-tools > .container { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .nqe, .nqe-toast, .post.nqe-flash .post-content, .nqe-skel span {
    animation: none;
    transition: none;
  }
}