/* Действия над каналом, фильтры безопасных сделок, статистика профиля, настройки каталога. */
/* Порядок подключения важен: каскад зависит от последовательности файлов. */
.settings-channel-actions {
  flex: 0 0 auto;
  width: max-content;
  margin-left: 0;
  justify-self: auto;
  grid-template-columns: max-content max-content;
  column-gap: 12px;
  row-gap: 12px;
}
.my-channel-avatar {
  position: relative;
}
.my-channel-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--avatar-bg, #1E55F9);
}

/* Stable my-channel publish/pause action animation */
.my-channel-actions,
.my-channel-action,
.my-channel-action:hover,
.my-channel-action:active,
.my-channel-action:focus,
.my-channel-action:disabled,
.my-channel-action.is-pending {
  transform: none !important;
  translate: none !important;
}
.my-channel-action {
  transition: background-color .28s ease, opacity .28s ease, color .28s ease !important;
}
.my-channel-card.state-updated .my-channel-action {
  animation: myChannelActionFade .26s ease both !important;
}
.my-channel-card.state-updated .my-channel-status {
  animation: myChannelStatusFade .3s ease both !important;
}
@keyframes myChannelActionFade {
  from { opacity: .35; }
  to { opacity: 1; }
}
@keyframes myChannelStatusFade {
  from { opacity: .45; }
  to { opacity: 1; }
}

/* Stable my-channel status without vertical jump */
.my-channel-status,
.my-channel-status:hover,
.my-channel-status:active,
.my-channel-status:focus,
.my-channel-status.is-leaving,
.my-channel-card.state-updated .my-channel-status {
  transform: none !important;
  translate: none !important;
}
.my-channel-status {
  transition: color .28s ease, background-color .28s ease, width .28s ease, flex-basis .28s ease, opacity .28s ease !important;
}
.my-channel-status.is-leaving {
  opacity: 0 !important;
}
.my-channel-card.state-updated .my-channel-status {
  animation: myChannelStatusOpacity .3s ease both !important;
}
@keyframes myChannelStatusOpacity {
  from { opacity: .45; }
  to { opacity: 1; }
}

/* Smooth moderation status appearance in my channels */
.my-channel-status[data-status="moderation"] {
  animation: myChannelStatusAppear .34s ease both;
}
.my-channel-card.state-updated .my-channel-status[data-status="moderation"] {
  animation: myChannelStatusAppear .34s ease both !important;
}
@keyframes myChannelStatusAppear {
  from { opacity: 0; scale: .96; }
  to { opacity: 1; scale: 1; }
}

/* Allow long selected values in channel settings selectors */
.settings-single-selector .selected-categories {
  max-width: calc(100% - 26px);
}
.settings-single-selector .chip.selected,
.settings-single-selector .chip:not(.more) {
  max-width: 267px !important;
  flex: 0 1 auto;
}
.settings-single-selector .chip.selected {
  padding-left: 10px;
  padding-right: 10px;
}

/* No color flicker for selected chips in channel settings */
.settings-single-selector .chip,
.settings-single-selector .chip.selected,
.settings-single-selector .chip:not(.more) {
  color: #1E55F9 !important;
  -webkit-text-fill-color: #1E55F9 !important;
  background-color: rgba(30,85,249,.16) !important;
  transition-property: opacity, transform !important;
}
.settings-single-selector .chip:hover,
.settings-single-selector .chip:active,
.settings-single-selector .chip:focus,
.settings-single-selector .chip:focus-visible,
.settings-single-selector .chips:hover .chip,
.settings-single-selector .chips:active .chip,
.settings-single-selector .chips:focus .chip,
.settings-single-selector .chips:focus-visible .chip,
.settings-single-selector.open .chip {
  color: #1E55F9 !important;
  -webkit-text-fill-color: #1E55F9 !important;
  background-color: rgba(30,85,249,.16) !important;
  filter: none !important;
}
.settings-single-selector .chip.more,
.settings-single-selector .chips:hover .chip.more,
.settings-single-selector .chips:active .chip.more,
.settings-single-selector.open .chip.more {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background-color: transparent !important;
}

/* Moderation preview card border above avatar */
.moderation-preview .channel-card {
  box-shadow: none !important;
}
.moderation-preview .channel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px #27272F;
}
.moderation-preview .card-favorite,
.moderation-preview .card-tags,
.moderation-preview .card-pro {
  z-index: 21;
}

/* Move channel actions block 30px to the right */
.my-channel-card .settings-bottom-row {
  display: grid !important;
  grid-template-columns: 520px max-content !important;
  column-gap: 50px !important;
  align-items: flex-start !important;
}
.my-channel-card .settings-flags {
  width: 520px !important;
  min-width: 520px !important;
}
.my-channel-card .settings-channel-actions {
  width: max-content !important;
  margin-left: 0 !important;
  justify-self: start !important;
}

/* Expanded channel settings height follows content and keeps 24px bottom padding */
.my-channel-card.open {
  max-height: 1800px !important;
  overflow: hidden !important;
}
.my-channel-card.open .my-channel-settings {
  height: auto !important;
}
.my-channel-card.open .my-channel-settings-body {
  padding: 24px !important;
}

/* Manage menu has 6 rows, including Administrators after Integrations. */
.profile-manage-menu {
  height: auto !important;
}
.profile-menu-card.collapsed,
.profile-manage-menu.collapsed {
  height: 39px !important;
  min-height: 39px !important;
  gap: 0 !important;
}
.profile-manage-menu .profile-menu-items:has(> button:last-child.selected)::before {
  border-radius: 8px !important;
  overflow: hidden;
}
.profile-manage-menu .profile-menu-items > button:last-child.selected {
  border-radius: 8px !important;
}

/* Expanded channel delete action: line -> 24px -> delete button */
.my-channel-card.open .my-channel-settings-body {
  position: relative;
  display: block;
  padding: 24px !important;
  box-sizing: border-box;
}
.my-channel-card.open .my-channel-settings-body > .settings-delete-line {
  position: static;
  width: calc(100% + 48px);
  margin: 24px -24px 0;
}
.my-channel-card.open .my-channel-settings-footer {
  position: static;
  height: 52px;
  margin: 24px 0 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.my-channel-card.open .my-channel-delete {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

/* Final expanded channel footer spacing: line -> 24px -> button -> 24px bottom */
.my-channel-card.open .my-channel-settings {
  height: auto !important;
}
.my-channel-card.open .my-channel-settings-body {
  padding: 24px !important;
}
.my-channel-card.open .my-channel-settings-body > .settings-delete-line {
  margin: 24px -24px 0 !important;
}
.my-channel-card.open .my-channel-settings-footer {
  margin: 24px 0 0 !important;
  padding: 0 !important;
}
.my-channel-card.open[data-buyer-campaign-id] .my-channel-settings-body { padding: 0 !important; box-sizing: border-box; }
.my-channel-card.open[data-buyer-campaign-id] .buyer-campaign-creative-body {
  height: auto !important;
  margin: 0;
  padding: 24px !important;
  overflow: visible !important;
}
.my-channel-card.open[data-buyer-campaign-id] .buyer-campaign-divider {
  width: calc(100% + 48px);
  margin: 24px -24px 0;
}
.profile-page-title-buyer-campaigns .buyer-campaign-status-filter .dropdown-trigger { justify-content: center; gap: 10px; }
.profile-page-title-buyer-campaigns .buyer-campaign-status-filter .dropdown-trigger span { flex: 1 1 auto; width: auto; text-align: center; }

/* SafeDeal filters reuse the Catalog dropdown pattern while anchoring to the
   shared profile title row, independent of the localized heading width. */
.profile-page-title-safe-deal-orders { position: relative; }
.profile-page-title-safe-deal-orders .safe-deal-order-filter {
  position: absolute;
  top: 0;
  right: 0;
  width: 185px;
  min-width: 185px;
  height: 52px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 10px;
}
.profile-page-title-safe-deal-orders .safe-deal-order-filter .sort-dropdown {
  position: static;
  display: block;
  width: 185px;
  min-width: 0;
  flex: 0 0 185px;
}
.profile-page-title-safe-deal-orders .safe-deal-order-filter .safe-deal-order-filter-trigger {
  position: relative;
  width: 185px;
  min-width: 185px;
  max-width: 185px;
  flex: 0 0 185px;
  height: 52px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  border-radius: inherit;
}
.profile-page-title-safe-deal-orders .safe-deal-order-filter .safe-deal-order-filter-label {
  flex: 0 0 calc(100% - 19px);
  width: calc(100% - 19px);
  max-width: calc(100% - 19px);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
}
.profile-page-title-safe-deal-orders .safe-deal-order-filter .safe-deal-order-filter-chevron {
  position: absolute;
  right: 17px;
  top: 50%;
  width: 9px;
  height: 5px;
  flex: 0 0 9px;
  transform: translateY(-50%);
  transform-origin: center;
  pointer-events: none;
}
.profile-page-title-safe-deal-orders .safe-deal-order-filter .sort-dropdown.open .safe-deal-order-filter-chevron { transform: translateY(-50%) rotate(180deg); }
.profile-page-title-safe-deal-orders .safe-deal-order-filter .dropdown-panel {
  left: 0;
  top: 60px;
  width: 185px;
  min-width: 0;
}

/* Profile statistics page */
.profile-content-statistics {
  min-height: 572px;
  padding: 0;
  background: transparent;
  border: 0;
}

/* Catalog settings page */
.profile-content-catalog-settings {
  width: 1046px;
  padding: 0;
  background: transparent;
  border: 0;
}
.catalog-settings-grid {
  display: grid;
  grid-template-columns: 515px 515px;
  gap: 16px;
  align-items: start;
}
.catalog-settings-right {
  display: grid;
  gap: 16px;
}
.catalog-settings-block {
  width: 515px;
  min-height: 220px;
  padding: 24px;
  background: #1B1B23;
  box-shadow: inset 0 0 0 1px #2F2F37;
  border-radius: 12px;
}
.catalog-settings-block h2 {
  margin: 0 0 24px;
  color: #fff;
  font: 600 24px/30px var(--font);
}
.catalog-settings-list {
  display: grid;
  gap: 8.5px;
}
.catalog-settings-row {
  display: flex;
  gap: 0;
  align-items: center;
  width: max-content;
}
.catalog-settings-row.dragging {
  opacity: .45;
}
.catalog-settings-order {
  width: 68px;
  height: 49px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  color: rgba(255,255,255,.12);
  background: rgba(39,39,47,.12);
  border-radius: 10px;
  font: 400 16px/20px var(--font);
}
.catalog-settings-row.fixed .catalog-settings-order {
  justify-content: center;
  padding-left: 0;
}
.catalog-drag-handle {
  width: 18px;
  height: 9px;
  flex: 0 0 18px;
  cursor: grab;
  background:
    linear-gradient(rgba(255,255,255,.4) 0 0) 0 0 / 18px 1.5px no-repeat,
    linear-gradient(rgba(255,255,255,.4) 0 0) 0 7.5px / 18px 1.5px no-repeat;
}
.catalog-settings-chip,
.catalog-settings-edit-input {
  width: auto;
  min-width: 0;
  height: 48px;
  margin-left: 4px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1E55F9;
  background: rgba(30,85,249,.12);
  border: 0;
  border-radius: 10px;
  font: 400 16px/20px var(--font);
  outline: 0;
}
.catalog-settings-edit-input {
  display: none;
}
.catalog-settings-chip {
  max-width: 240px;
}
.catalog-settings-chip span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.catalog-settings-row.editing .catalog-settings-chip {
  display: none;
}
.catalog-settings-row.editing .catalog-settings-edit-input {
  display: flex;
}
.catalog-settings-edit,
.catalog-settings-delete {
  width: 20px;
  height: 20px;
  margin-left: 20px;
  display: grid;
  place-items: center;
  background: transparent;
}
.catalog-settings-edit,
.buyer-campaign-card .buyer-campaign-title-edit { overflow: visible; }
.catalog-settings-edit::before {
  content: "";
  width: 17px;
  height: 17px;
  display: block;
  box-sizing: border-box;
  transform-origin: center;
  background: var(--blue);
  -webkit-mask: url("../assets/edit-narrow.svg") center / contain no-repeat;
  mask: url("../assets/edit-narrow.svg") center / contain no-repeat;
}
.catalog-settings-row.editing .catalog-settings-edit::before,
.catalog-settings-row.saved .catalog-settings-edit::before {
  width: 16px;
  height: 10px;
  background: transparent;
  border-left: 2px solid #2EB822;
  border-bottom: 2px solid #2EB822;
  clip-path: none;
  transform: rotate(-45deg);
}
.catalog-settings-row.saving .catalog-settings-edit {
  opacity: .55;
  cursor: default;
  pointer-events: none;
}
.catalog-settings-delete img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.catalog-settings-delete:disabled {
  opacity: .25;
  cursor: default;
}
.catalog-settings-add {
  width: 68px;
  height: 49px;
  margin-top: 8.5px;
  color: #1E55F9;
  background: rgba(30,85,249,.12);
  border-radius: 10px;
  font: 400 24px/24px var(--font);
}
.catalog-settings-rates {
  min-height: 0;
}
.catalog-settings-rate-list {
  display: grid;
  gap: 8.5px;
}
.catalog-settings-rate-row .promotion-rate-edit-input {
  height: 48px;
  text-align: center;
}
.catalog-settings-rate-row .promotion-rate-edit-input:focus:not(:focus-visible) {
  outline: 0;
  box-shadow: none;
}
.catalog-settings-rate-row .promotion-rate-edit-input:focus-visible {
  outline: 0;
  box-shadow: none;
}
.catalog-settings-edit-input:focus,
.catalog-settings-edit-input:focus-visible {
  outline: 0;
  box-shadow: none;
}
