/* ================= Кнопки в форме ответа (с чекбоксом) ================= */
.custom-reply-mini-profile-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  position: relative;
  z-index: 10004;
  font-family: var(--sec-font, sans-serif) !important;
}
.custom-reply-mini-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
}
.reply-avatar-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--bord, #c0c0c0) !important;
}
.reply-username-link {
  font-family: var(--sec-font, sans-serif) !important;
  color: var(--link-acc, #75876c) !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.reply-username-link:hover {
  opacity: 0.8;
}
.hv2-bar-status {
  font-size: 11px;
  opacity: 0.6;
  font-family: var(--sec-font, sans-serif) !important;
  font-style: italic;
  color: var(--text, #252f35) !important;
}
.hv2-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Стили кнопки-чекбокса на панели управления (показываем только при надетой маске) */
.hv2-bar-code-toggle {
  display: none; /* Скрыто по умолчанию, показывается через JS */
  font-family: var(--sec-font, sans-serif) !important;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  border: 1px solid var(--bord, #c0c0c0) !important;
  background: var(--base-bg2, #d7d7d7) !important;
  color: var(--text, #252f35) !important;
  border-radius: var(--b-radius, 20px) !important;
  transition: all 0.2s ease-in-out;
  text-transform: lowercase;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.hv2-bar-code-toggle:hover {
  background: var(--link-acc, #75876c) !important;
  color: var(--light-text, #d7d7d7) !important;
  border-color: var(--link-acc, #75876c) !important;
}
.hv2-bar-code-toggle input {
  margin: 0;
  cursor: pointer;
}

.hv2-btn {
  font-family: var(--sec-font, sans-serif) !important;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  border: 1px solid var(--bord, #c0c0c0) !important;
  background: var(--base-bg2, #d7d7d7) !important;
  color: var(--text, #252f35) !important;
  border-radius: var(--b-radius, 20px) !important;
  transition: all 0.2s ease-in-out;
  text-transform: lowercase;
}
.hv2-btn:hover {
  background: var(--link-acc, #75876c) !important;
  color: var(--light-text, #d7d7d7) !important;
  border-color: var(--link-acc, #75876c) !important;
}

/* ================= Выпадающий список (Dropdown) ================= */
.hv2-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10005;
  background: var(--pun-bg, #d3d3d3) !important;
  border: 1px solid var(--bord, #c0c0c0) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  border-radius: 8px;
  width: 280px;
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}
.hv2-dropdown.hv2-open {
  display: block;
}
.hv2-dd-head {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--bord, #c0c0c0) !important;
  color: var(--tab-tex, #2b363b) !important;
  opacity: 0.8;
}
.hv2-dd-empty {
  font-size: 12px;
  text-align: center;
  padding: 15px 0;
  color: var(--text, #252f35) !important;
  opacity: 0.6;
}
.hv2-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 4px;
}
.hv2-dd-item:hover {
  background: rgba(255, 255, 255, 0.3);
}
.hv2-dd-item img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--bord, #c0c0c0) !important;
}
.hv2-dd-text {
  flex: 1;
  min-width: 0;
}
.hv2-dd-name {
  font-size: 13px;
  font-weight: bold;
  color: var(--link-acc, #75876c) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv2-dd-sub {
  font-size: 10px;
  opacity: 0.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv2-dd-act {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}
.hv2-dd-act:hover {
  opacity: 1;
}
.hv2-dd-del:hover {
  color: #c94a4a;
}
.hv2-dd-create {
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: var(--link-acc, #75876c) !important;
  color: var(--light-text, #d7d7d7) !important;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 11px;
}
.hv2-dd-create:hover {
  opacity: 0.9;
}

/* ================= Модальное окно ================= */
.hv2-modal-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 10009;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  backdrop-filter: blur(2px);
}
.hv2-modal-container.hv2-open {
  display: flex;
}
.hv2-dlg {
  background: var(--pun-bg, #d3d3d3) !important;
  border: 1px solid var(--bord, #c0c0c0) !important;
  border-radius: 12px;
  width: 95%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-family: var(--sec-font, sans-serif) !important;
  box-sizing: border-box;
}

/* Шапка диалога — лаконичная */
.hv2-dlg-title {
  padding: 10px 20px;
  border-bottom: 1px solid var(--bord, #c0c0c0) !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--base-bg2, #d7d7d7) !important;
  height: 52px;
  box-sizing: border-box;
}
.hv2-dlg-title-text {
  font-weight: bold;
  font-size: 15px;
  color: var(--tab-tex, #2b363b) !important;
  flex: 1;
}
.hv2-dlg-x-box {
  display: flex;
  justify-content: flex-end;
}
.hv2-dlg-x {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: var(--text, #252f35) !important;
  opacity: 0.6;
}
.hv2-dlg-x:hover {
  opacity: 1;
}

/* Сетка: левая колонка сужена для более компактного предпросмотра */
.hv2-dlg-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 20px;
  box-sizing: border-box;
}

/* Предпросмотр профиля */
.hv2-dlg-preview {
  display: flex;
  flex-direction: column;
}
.hv2-preview-caption {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin-bottom: 8px;
  color: var(--text, #252f35) !important;
}
.hv2-preview-post {
  border: 1px solid var(--bord, #c0c0c0) !important;
  background: var(--base-bg2, #d7d7d7) !important;
  border-radius: 10px;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hv2-preview-author {
  width: 100%;
  background: var(--pf-bg, #cbcbcb) !important;
  border: 1px solid var(--bord, #c0c0c0) !important;
  border-radius: 8px;
  padding: 12px;
  box-sizing: border-box;
  text-align: center;
}
.hv2-preview-profile {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hv2-pv-avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bord, #c0c0c0) !important;
  margin: 0 auto;
}
.hv2-pv-pafld1 {
  font-size: 13px;
  font-weight: 700;
  color: var(--link-acc, #75876c) !important;
}
.hv2-pv-pafld1 a {
  color: var(--link-acc, #75876c) !important;
  text-decoration: none;
  border-bottom: 1px dashed var(--link-acc, #75876c) !important;
}
/* Личное звание с поддержкой переносов строк */
.hv2-pv-pafld2 {
  font-size: 11px;
  font-style: italic;
  opacity: 0.8;
  color: var(--text, #252f35) !important;
  margin-top: 2px;
  white-space: pre-wrap; /* Сохраняет переносы (enter) в предпросмотре */
}
.hv2-pv-pafld8 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tab-pl, #52666f) !important;
  margin-bottom: 4px;
}

.hv2-preview-sig-wrap {
  margin-top: 15px;
  box-sizing: border-box;
}
.hv2-preview-sig {
  border-top: 1px dashed var(--bord, #c0c0c0) !important;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text, #252f35) !important;
  max-width: 100%;
}

/* Новая секция названия маски (под подписью в левой колонке) */
.hv2-preview-name-wrap {
  margin-top: 20px;
  box-sizing: border-box;
}
.hv2-name-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hv2-name-input {
  padding: 8px 12px;
  font-size: 12px;
  border: 1px solid var(--bord, #c0c0c0) !important;
  border-radius: 6px;
  background: #fff;
  width: 100%;
  font-weight: normal;
  box-sizing: border-box;
}
.hv2-name-input:focus {
  outline: none;
  border-color: var(--link-acc, #75876c) !important;
}

/* Форма справа */
.hv2-dlg-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}
.hv2-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}
.hv2-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--tab-tex, #2b363b) !important;
}
.hv2-field-desc {
  font-size: 10px;
  opacity: 0.7;
  line-height: 1.2;
}
.hv2-field-tpl {
  display: flex;
  gap: 4px;
}
.hv2-btn-tpl {
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  margin-top: 2px;
  border-radius: 4px;
  border: 1px solid var(--bord, #c0c0c0) !important;
  background: var(--base-bg2, #d7d7d7) !important;
}
.hv2-btn-tpl:hover {
  background: var(--link-acc, #75876c) !important;
  color: #fff !important;
}
.hv2-input {
  padding: 8px;
  font-size: 12px;
  border: 1px solid var(--bord, #c0c0c0) !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
  color: var(--text, #252f35) !important;
  font-family: inherit;
  transition: border-color 0.2s;
}
.hv2-input:focus {
  border-color: var(--link-acc, #75876c) !important;
  outline: none;
  background: #fff;
}
textarea.hv2-input {
  resize: vertical;
}

/* Подвал модалки — КНОПКИ ПО ЦЕНТРУ */
.hv2-dlg-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--bord, #c0c0c0) !important;
  display: flex;
  justify-content: center; /* Кнопки строго по центру */
  align-items: center;
  background: var(--base-bg2, #d7d7d7) !important;
  box-sizing: border-box;
}
.hv2-dlg-buttons {
  display: inline-flex;
  gap: 8px;
}
.hv2-dlg-save {
  font-weight: bold;
}
.hv2-field-error {
  font-size: 10px;
  color: #d9534f;
  margin-top: 2px;
}

/* Полностью скрываем сырой текстовый код маски в готовом посте */
.post-content .hvmask, [id^="p"] .post-content > [block="hvmask"] { display: none !important; }