/* ---------------------------------------------------------------------------
   Conversations › Tags ⊕ — GHL's Select tags, Create tag and Create category
   modals (public/conversations-tags.js).

   The .select-tags*, .create-tag-modal__* and .create-category-modal__*
   rules are GHL's own scoped CSS (contacts-highrise chunks 9013, 3526 and
   818), values unchanged. The .stg-* rules stand in for the HighRise
   pieces those components sit in: HRModal (483px, 16px padding, a divided
   footer), HRInput, HRButton and the form item.
--------------------------------------------------------------------------- */

/* the HighRise modal */
.stg-mask {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
  background: rgba(52, 64, 84, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stg-modal {
  position: relative; max-width: 100%; margin: auto; background: #fff; border-radius: 8px;
  box-shadow: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
  color: #101828; font-size: 14px; line-height: 20px; text-align: left;
}
.stg-modal__header { padding: 16px calc(20px + 22px) 0 16px; }
.stg-modal__title { font-size: 16px; line-height: 22px; font-weight: 600; color: #101828; }
.stg-modal__subtitle { display: inline-block; padding-top: 4px; font-size: 12px; line-height: 18px; font-weight: 400; color: #98a2b3; }
.stg-modal__close {
  position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: none; color: #667085; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.stg-modal__close:hover { background: #f2f4f7; color: #344054; }
.stg-modal__content { margin-top: 16px; padding: 0 16px 16px; }
.stg-modal__footer {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px;
  padding: 12px 16px; border-top: 1px solid #eaecf0;
}

/* the HighRise button */
.stg-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 9px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.stg-btn:disabled { cursor: not-allowed; }
.stg-btn--secondary { background: #fff; color: #344054; border: 1px solid #d0d5dd; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.stg-btn--secondary:hover:not(:disabled) { background: #f9fafb; color: #1d2939; }
.stg-btn--secondary:disabled { color: #98a2b3; border-color: #eaecf0; }
.stg-btn--primary { background: #155eef; color: #fff; border: 1px solid #155eef; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.stg-btn--primary:hover:not(:disabled) { background: #004eeb; border-color: #004eeb; }
.stg-btn--primary:disabled:not(.stg-btn--loading) { background: #b2ccff; border-color: #b2ccff; }
.stg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px #d1e0ff; }
.stg-btn--loading .stg-btn__label { visibility: hidden; }
.stg-btn--loading::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: stg-spin .7s linear infinite;
}
@keyframes stg-spin { to { transform: rotate(360deg); } }

/* the HighRise input */
.stg-input {
  display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  height: 36px; padding: 0 12px; background: #fff; border: 1px solid #d0d5dd; border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); transition: border-color .12s, box-shadow .12s;
}
.stg-input--lg { height: 40px; padding: 0 14px; }
.stg-input--textarea { height: auto; padding: 10px 14px; align-items: flex-start; }
.stg-input:focus-within { border-color: #84adff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 0 0 4px #d1e0ff; }
.stg-form-item--error .stg-input { border-color: #fda29b; }
.stg-form-item--error .stg-input:focus-within { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 0 0 4px #fee4e2; }
.stg-input__el {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: 14px; color: #101828;
}
.stg-input--textarea .stg-input__el { resize: vertical; min-height: 60px; line-height: 20px; }
.stg-input__el::placeholder { color: #667085; }
.stg-input__prefix { flex: none; width: 16px; height: 16px; color: #667085; }
.stg-input__clear {
  flex: none; display: none; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0;
  border: 0; border-radius: 50%; background: #d0d5dd; color: #fff; cursor: pointer;
}
.stg-input--filled .stg-input__clear { display: inline-flex; }
.stg-input__clear:hover { background: #98a2b3; }
.stg-input__count { flex: none; font-size: 12px; color: #98a2b3; font-variant-numeric: tabular-nums; }

/* the form item */
.stg-form { width: 100%; margin-top: -5px; }
.stg-form-item { display: flex; flex-direction: column; }
.stg-form-item__label { padding-bottom: 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: #344054; }
.stg-form-item__asterisk { color: #f04438; }
.stg-form-item__feedback { min-height: 24px; padding-top: 2px; font-size: 12px; line-height: 18px; color: #f04438; }

/* the filterable select */
.stg-select { position: relative; width: 100%; }
.stg-select__field { cursor: pointer; }
.stg-select__field .stg-input__el { cursor: pointer; }
.stg-select--open .stg-select__field .stg-input__el { cursor: text; }
.stg-select__arrow { flex: none; color: #667085; transition: transform .2s; }
.stg-select--open .stg-select__arrow { transform: rotate(180deg); }
.stg-select--filled:not(.stg-select--open) .stg-select__field:hover .stg-select__clear { display: inline-flex; }
.stg-select--filled:not(.stg-select--open) .stg-select__field:hover .stg-select__arrow { display: none; }
.stg-select--filled .stg-input__el::placeholder { color: #101828; }
.stg-select__menu {
  position: absolute; z-index: 2; top: calc(100% + 4px); left: 0; right: 0; max-height: 240px; overflow-y: auto;
  padding: 4px; background: #fff; border: 1px solid #eaecf0; border-radius: 8px;
  box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
}
.stg-select__option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 14px; color: #101828; text-align: left; cursor: pointer;
}
.stg-select__option:hover { background: #f9fafb; }
.stg-select__option--selected { color: #155eef; font-weight: 500; }

/* ---------------- SelectTagsModalV1 (data-v-718c14df) ---------------- */
.select-tags { flex-direction: column; gap: 14px; padding-top: 6px; display: flex; }
.select-tags__header { align-items: center; gap: 8px; display: inline-flex; }
.select-tags__badge {
  color: #155eef; background: #eff4ff; border-radius: 9999px; justify-content: center; align-items: center;
  min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 600; display: inline-flex; box-sizing: border-box;
}
.select-tags__selected-wrap { position: relative; }
.select-tags__selected-wrap[hidden] { display: none; }
.select-tags__selected {
  scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; border-bottom: 1px solid #eaecf0;
  flex-wrap: nowrap; gap: 8px; padding-bottom: 14px; display: flex; overflow-x: auto;
}
.select-tags__selected::-webkit-scrollbar { display: none; }
.select-tags__scroll-btn {
  z-index: 1; color: #475467; cursor: pointer; border: none; align-items: center; width: 44px; padding: 0;
  display: flex; position: absolute; top: 0; bottom: 15px;
}
.select-tags__scroll-btn[hidden] { display: none; }
.select-tags__scroll-btn--left { background: linear-gradient(90deg, #fff 42%, #fff0); justify-content: flex-start; left: 0; }
.select-tags__scroll-btn--right { background: linear-gradient(270deg, #fff 42%, #fff0); justify-content: flex-end; right: 0; }
.select-tags__scroll-icon { width: 18px; height: 18px; }
.select-tags__list { background: #fff; border: 1px solid #eaecf0; border-radius: 12px; overflow: hidden; }
.select-tags__scroller { width: 100%; overflow-y: auto; }
.select-tags__scroller::-webkit-scrollbar { width: 10px; }
.select-tags__scroller::-webkit-scrollbar-thumb { background: #d0d5dd; border: 3px solid #fff; border-radius: 9999px; }
.select-tags__spacer { width: 100%; position: relative; }
.select-tags__row { height: 36px; position: absolute; left: 0; right: 0; }
.select-tags-group__header {
  cursor: pointer; background: #f9fafb; border: 0; border-top: 1px solid #f2f4f7; justify-content: space-between;
  align-items: center; gap: 8px; width: 100%; min-width: 0; height: 36px; padding: 0 12px;
  transition: background-color .12s; display: flex; font: inherit; box-sizing: border-box;
}
.select-tags-group__header:hover { background: #f2f4f7; }
.select-tags-group__title {
  letter-spacing: .01em; color: #101828; align-items: center; gap: 6px; min-width: 0;
  font-size: 13px; font-weight: 600; display: flex;
}
.select-tags-group__name { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.select-tags-group__count {
  color: #475467; font-variant-numeric: tabular-nums; background: #eaecf0; border-radius: 9999px;
  flex-shrink: 0; padding: 1px 8px; font-size: 11px; font-weight: 600; line-height: 16px;
}
.select-tags-group__chevron { color: #667085; flex-shrink: 0; width: 16px; height: 16px; transition: transform .2s; }
.select-tags-group__chevron--collapsed { transform: rotate(-90deg); }
.select-tags-item {
  cursor: pointer; background: #fff; align-items: center; gap: 8px; min-width: 0; height: 36px;
  padding: 0 12px 0 16px; transition: background-color .12s; display: flex; box-sizing: border-box; outline: 0;
}
.select-tags-item:hover { background: #f9fafb; }
.select-tags-item:focus-visible { box-shadow: inset 0 0 0 2px #84adff; }
.select-tags-item--checked { background: #eff4ff; }
.select-tags-item--checked:hover { background: #e3ecff; }
.select-tags-item__spacer { flex: auto; }
.select-tags-item__check { color: #155eef; flex-shrink: 0; width: 18px; height: 18px; }
.select-tags-chip {
  box-sizing: border-box; border-radius: 14px; flex: 0 auto; align-items: center; min-width: 0; max-width: 100%;
  padding: 2px 10px; font-size: 13px; font-weight: 500; line-height: 18px; display: inline-flex; overflow: hidden;
}
.select-tags-chip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-tags-chip--removable {
  flex: none; gap: 5px; max-width: 180px; padding: 3px 6px 3px 10px; transition: filter .12s;
  box-shadow: inset 0 0 0 1px #1018280f;
}
.select-tags-chip--removable:hover { filter: brightness(.97); }
.select-tags-chip__close {
  width: 16px; height: 16px; padding: 0; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer;
  border-radius: 50%; flex-shrink: 0; justify-content: center; align-items: center;
  transition: opacity .12s, background-color .12s; display: inline-flex;
}
.select-tags-chip__close:hover { opacity: 1; background: #10182824; }
.select-tags__empty {
  color: #667085; text-align: center; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 16px; font-size: 13px; display: flex;
}
.select-tags__empty-icon { color: #98a2b3; width: 24px; height: 24px; }
.select-tags__error { margin-top: -6px; font-size: 13px; line-height: 18px; color: #f04438; }
.select-tags__error[hidden] { display: none; }
.select-tags__loading { padding: 32px 0; text-align: center; color: #667085; font-size: 13px; }
.select-tags__create-btn {
  color: #155eef; cursor: pointer; background: #fff; border: 1px solid #d0d5dd; border-radius: 8px; align-items: center;
  gap: 5px; margin-top: 4px; padding: 5px 14px; font: inherit; font-size: 13px; font-weight: 500;
  transition: background-color .12s, border-color .12s; display: inline-flex; max-width: 100%; overflow-wrap: anywhere;
}
.select-tags__create-btn:hover { background: #eff4ff; border-color: #b2ccff; }
.select-tags__create-icon { flex-shrink: 0; width: 14px; height: 14px; }

/* ---------------- CreateTagModalV1 (data-v-14febe23) ---------------- */
.create-tag-modal__description-wrap { flex-direction: column; width: 100%; display: flex; }
.create-tag-modal__description-count { color: #98a2b3; align-self: flex-end; margin-top: 4px; font-size: 12px; }
.create-tag-modal__color-item { margin-top: -2px; }
.create-tag-modal__preview-item { margin-top: 9px; }
.create-tag-modal__color-palette { flex-direction: column; align-items: flex-start; gap: 12px; display: flex; }
.create-tag-modal__color-swatches { flex-wrap: nowrap; gap: 12px; display: flex; }
.create-tag-modal__swatch {
  cursor: pointer; will-change: transform; border: none; border-radius: 50%; justify-content: center; align-items: center;
  width: 32px; height: 32px; padding: 0; transition: transform .12s; display: flex; position: relative; overflow: hidden; flex: none;
}
.create-tag-modal__swatch:hover { transform: scale(1.12); }
.create-tag-modal__swatch--selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #155eef; overflow: visible; }
.create-tag-modal__swatch-check { color: #fff; width: 16px; height: 16px; }
.create-tag-modal__custom-color-swatch {
  background: conic-gradient(#f44336, #ffeb3b, #4caf50, #00bcd4, #2196f3, #9c27b0, #f44336);
  box-shadow: inset 0 0 0 1px #00000014;
}
.create-tag-modal__custom-color-swatch.create-tag-modal__swatch--selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #155eef; }
.create-tag-modal__color-picker-input {
  opacity: 0; cursor: pointer; border: none; width: 100%; height: 100%; padding: 0; position: absolute; inset: 0;
}
.create-tag-modal__preview {
  display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 14px; font-size: 12px; line-height: 16px;
  font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: flex-start; box-sizing: border-box;
}
.create-tag-modal__category-empty { flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; display: flex; }
.create-tag-modal__category-empty-icon { color: #98a2b3; width: 24px; height: 24px; }
.create-tag-modal__category-empty-text { color: #667085; font-size: 13px; }
.create-tag-modal__create-category-btn {
  color: #155eef; text-align: left; white-space: normal; cursor: pointer; background: #fff; border: 1px solid #d0d5dd;
  border-radius: 8px; align-items: flex-start; gap: 5px; max-width: 100%; padding: 5px 14px; font: inherit; font-size: 13px;
  font-weight: 500; line-height: 18px; transition: background-color .12s, border-color .12s; display: inline-flex; overflow-wrap: anywhere;
}
.create-tag-modal__create-category-btn:hover { background: #eff4ff; border-color: #b2ccff; }
.create-tag-modal__create-category-icon { flex-shrink: 0; width: 14px; height: 14px; margin-top: 2px; }

/* ---------------- CreateCategoryModalV1 (data-v-44f58fb4) ---------------- */
.create-category-modal__description-wrap { flex-direction: column; width: 100%; display: flex; }
.create-category-modal__description-count { color: #98a2b3; align-self: flex-end; margin-top: 4px; font-size: 12px; }

/* GHL's eleven 32px swatches need 472px; on a phone they wrap instead of
   running out of the modal. */
@media (max-width: 540px) {
  .create-tag-modal__color-swatches { flex-wrap: wrap; }
  .stg-mask { padding: 12px; }
}
