.vsg-root,
.vsg-modal {
  --vsg-brand: #f5a622;
  --vsg-brand-dark: #c97f00;
  --vsg-brand-soft: rgba(245, 166, 34, 0.1);
  --vsg-border: #e7e8ec;
  --vsg-text: #242730;
  --vsg-muted: #777c87;
  --vsg-bg: #ffffff;
  --vsg-soft-bg: #f7f7f8;
  --vsg-danger: #c93643;
  color: var(--vsg-text);
  font-family: inherit;
  direction: rtl;
}

.vsg-root *,
.vsg-modal * {
  box-sizing: border-box;
}

/* Gallery ---------------------------------------------------------------- */
.vsg-gallery {
  display: grid;
  grid-template-columns: repeat(var(--vsg-columns, 3), minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

.vsg-video-card {
  display: flex !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--vsg-border) !important;
  border-radius: 14px !important;
  background: var(--vsg-bg) !important;
  background-image: none !important;
  color: var(--vsg-text) !important;
  text-align: right;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  appearance: none;
  transition: border-color 180ms ease;
}

.vsg-video-card:hover,
.vsg-video-card:focus-visible {
  border-color: rgba(245, 166, 34, 0.75) !important;
  background: var(--vsg-bg) !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none;
}

.vsg-video-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111318;
}

.vsg-video-card__image {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 260ms ease;
}

.vsg-video-card:hover .vsg-video-card__image,
.vsg-video-card:focus-visible .vsg-video-card__image {
  transform: scale(1.035);
}

.vsg-video-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #23252b, #0e0f12);
}

.vsg-video-card__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--vsg-brand);
  color: #fff;
  opacity: 0.98;
  transform: translate(-50%, -50%);
  transition: background-color 180ms ease, transform 180ms ease;
}

.vsg-video-card:hover .vsg-video-card__play,
.vsg-video-card:focus-visible .vsg-video-card__play {
  background: var(--vsg-brand-dark);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.05);
}

.vsg-video-card__play svg {
  display: block;
}

.vsg-video-card__footer {
  display: flex;
  min-width: 0;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vsg-video-card__title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--vsg-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vsg-video-card__stats {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: #686e78;
}

.vsg-video-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.vsg-video-card__stat:first-child svg {
  color: var(--vsg-brand);
}

.vsg-empty-gallery {
  padding: 30px;
  border: 1px dashed rgba(245, 166, 34, 0.55);
  border-radius: 14px;
  background: var(--vsg-brand-soft);
  color: var(--vsg-muted);
  text-align: center;
}

/* Modal ------------------------------------------------------------------ */
.vsg-modal {
  --bs-modal-width: 1480px;
  z-index: 1055;
}

.vsg-modal .modal-dialog {
  width: min(1480px, calc(100vw - 24px));
  max-width: 1480px;
  margin-inline: auto;
}

.vsg-modal__content {
  position: relative;
  width: 100%;
  height: min(94vh, 940px);
  max-height: 940px;
  overflow: hidden;
  border: 1px solid var(--vsg-border) !important;
  border-radius: 18px !important;
  background: var(--vsg-bg) !important;
  box-shadow: none !important;
}

.vsg-modal button.vsg-modal__close {
  position: absolute;
  z-index: 30;
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
  display: grid !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 1px solid rgba(36, 39, 48, 0.1) !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.94) !important;
  background-image: none !important;
  color: #3f444d !important;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  appearance: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.vsg-modal button.vsg-modal__close:hover,
.vsg-modal button.vsg-modal__close:focus-visible {
  border-color: var(--vsg-brand) !important;
  background: var(--vsg-brand) !important;
  color: #fff !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none !important;
}

.vsg-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.vsg-modal__video-section {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: #050506;
}

.vsg-modal__video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #050506;
  cursor: pointer;
}

.vsg-modal__video-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  padding: 30px;
  place-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  background: #050506;
}

.vsg-modal__video-state--error {
  color: #fff;
}

.vsg-modal__video-message {
  max-width: 420px;
}

.vsg-loader {
  display: inline-block;
  border-style: solid;
  border-color: rgba(245, 166, 34, 0.22);
  border-top-color: var(--vsg-brand);
  border-radius: 50%;
  animation: vsg-spin 720ms linear infinite;
}

.vsg-loader[hidden] {
  display: none !important;
}

.vsg-loader--video {
  width: 34px;
  height: 34px;
  margin: auto;
  border-width: 3px;
}

.vsg-loader--comments {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.vsg-modal__sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--vsg-border);
  background: var(--vsg-bg);
}

.vsg-modal__header {
  display: flex;
  flex: 0 0 auto;
  min-height: 74px;
  padding: 18px 58px 16px 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--vsg-border);
  background: var(--vsg-bg);
}

.vsg-modal__heading {
  min-width: 0;
}

.vsg-modal__title {
  margin: 0;
  color: var(--vsg-text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
}

.vsg-modal__description {
  margin: 4px 0 0;
  color: var(--vsg-muted);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.vsg-modal__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.vsg-modal button.vsg-action-button,
.vsg-modal .vsg-action-button.vsg-action-button--static {
  display: inline-flex !important;
  min-width: auto !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: #565c67 !important;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none !important;
  transform: none !important;
  appearance: none;
}

.vsg-modal button.vsg-action-button {
  cursor: pointer;
}

.vsg-modal button.vsg-action-button:hover,
.vsg-modal button.vsg-action-button:focus-visible {
  border: 0 !important;
  background: transparent !important;
  color: var(--vsg-brand-dark) !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none !important;
}

.vsg-modal button.vsg-action-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.vsg-action-button__icon {
  display: inline-flex;
  line-height: 1;
}

.vsg-action-button__icon svg {
  display: block;
}

.vsg-modal button.vsg-action-button.vsg-action-button--liked {
  color: var(--vsg-brand-dark) !important;
}

.vsg-action-button--liked .vsg-action-button__icon svg {
  fill: var(--vsg-brand);
  stroke: var(--vsg-brand);
}

.vsg-action-button--static {
  cursor: default;
}

/* Comments --------------------------------------------------------------- */
.vsg-comments {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 166, 34, 0.48) transparent;
}

.vsg-comments::-webkit-scrollbar {
  width: 5px;
}

.vsg-comments::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(245, 166, 34, 0.5);
}

.vsg-comments__list {
  display: flex;
  flex-direction: column;
}

.vsg-comments__status {
  display: flex;
  min-height: 52px;
  padding: 17px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--vsg-muted);
  font-size: 12px;
  text-align: center;
}

.vsg-comments__status[hidden] {
  display: none !important;
}

.vsg-comments__status--error {
  color: var(--vsg-danger);
}

.vsg-comments__sentinel {
  width: 100%;
  height: 1px;
}

.vsg-comment {
  display: flex;
  min-width: 0;
  gap: 11px;
  padding: 16px 17px;
  border-bottom: 1px solid #eff0f2;
  background: #fff;
}

.vsg-comment--pending {
  border-right: 3px solid var(--vsg-brand);
  background: rgba(245, 166, 34, 0.045);
}

.vsg-comment__avatar,
.vsg-reply__avatar {
  display: block !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #eceef1 !important;
  border-radius: 50% !important;
  background: #f1f2f4;
  object-fit: cover !important;
  object-position: center !important;
  box-shadow: none !important;
}

.vsg-comment__avatar {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  aspect-ratio: 1 / 1 !important;
}

.vsg-reply__avatar {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  aspect-ratio: 1 / 1 !important;
}

.vsg-comment__body,
.vsg-reply__body {
  min-width: 0;
  flex: 1 1 auto;
}

.vsg-comment__header,
.vsg-reply__header {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.vsg-comment__author,
.vsg-reply__author {
  color: #31353d;
  font-size: 12px;
  font-weight: 800;
}

.vsg-comment__date,
.vsg-reply__date {
  color: #999da6;
  font-size: 10px;
  line-height: 1.6;
}

.vsg-comment__content,
.vsg-reply__content {
  margin: 5px 0 0;
  color: #444953;
  font-size: 13px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.vsg-comment__pending {
  display: flex;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
}

.vsg-comment__pending-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--vsg-brand-dark);
  font-size: 10px;
  font-weight: 800;
}

.vsg-comment__pending-icon {
  display: inline-flex;
  animation: vsg-pulse 1.4s ease-in-out infinite;
}

.vsg-comment__pending-note {
  color: #8b8f98;
  font-size: 10px;
}

.vsg-comment__replies {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  gap: 8px;
}

.vsg-reply {
  display: flex;
  min-width: 0;
  padding: 10px 11px;
  gap: 9px;
  border-right: 2px solid var(--vsg-brand);
  border-radius: 8px;
  background: #fafafa;
}

.vsg-reply__badge {
  display: inline-flex;
  padding: 2px 6px;
  align-items: center;
  border-radius: 999px;
  background: var(--vsg-brand-soft);
  color: var(--vsg-brand-dark);
  font-size: 9px;
  font-weight: 800;
}

/* Comment form ----------------------------------------------------------- */
.vsg-comment-form-wrap {
  flex: 0 0 auto;
  padding: 11px 13px 12px;
  border-top: 1px solid var(--vsg-border);
  background: #fff;
}

.vsg-comment-form {
  margin: 0;
}

.vsg-comment-form__field {
  display: flex;
  min-height: 47px;
  padding: 5px 7px 5px 5px;
  align-items: flex-end;
  gap: 7px;
  border: 1px solid #dfe1e5;
  border-radius: 12px;
  background: #fff;
  transition: border-color 160ms ease;
}

.vsg-comment-form__field:focus-within {
  border-color: var(--vsg-brand);
  box-shadow: none;
}

.vsg-comment-form textarea {
  display: block;
  width: 100%;
  min-height: 35px;
  max-height: 110px;
  margin: 0 !important;
  padding: 7px 8px !important;
  resize: none;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--vsg-text) !important;
  font: inherit;
  font-size: 12px;
  line-height: 1.8;
  box-shadow: none !important;
  outline: none !important;
}

.vsg-comment-form textarea::placeholder {
  color: #a0a4ac;
}

.vsg-modal button.vsg-comment-submit {
  display: grid !important;
  width: 39px !important;
  min-width: 39px !important;
  height: 39px !important;
  min-height: 39px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 39px !important;
  place-items: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: var(--vsg-brand) !important;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  appearance: none;
}

.vsg-modal button.vsg-comment-submit:hover,
.vsg-modal button.vsg-comment-submit:focus-visible {
  border: 0 !important;
  background: transparent !important;
  color: var(--vsg-brand-dark) !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none !important;
}

.vsg-modal button.vsg-comment-submit:active {
  opacity: 0.7;
}

.vsg-modal button.vsg-comment-submit:disabled {
  background: transparent !important;
  color: var(--vsg-brand) !important;
  opacity: 0.45;
  cursor: wait;
}

.vsg-comment-submit__icon,
.vsg-comment-submit__spinner {
  display: block;
}

.vsg-comment-submit__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(245, 166, 34, 0.22);
  border-top-color: var(--vsg-brand);
  border-radius: 50%;
  animation: vsg-spin 700ms linear infinite;
}

.vsg-comment-submit.is-loading .vsg-comment-submit__icon {
  display: none;
}

.vsg-comment-submit.is-loading .vsg-comment-submit__spinner {
  display: block;
}

.vsg-form-message {
  min-height: 0;
  margin-top: 0;
  color: #347a51;
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-line;
}

.vsg-form-message:not(:empty) {
  min-height: 38px;
  margin-top: 7px;
}

.vsg-form-message--error {
  color: var(--vsg-danger);
}

.vsg-login-message {
  margin: 0;
  padding: 8px 4px;
  color: var(--vsg-muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.vsg-login-message a {
  color: var(--vsg-brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.vsg-login-message a:hover,
.vsg-login-message a:focus-visible {
  color: var(--vsg-brand-dark);
  text-decoration: underline;
}

/* Player ----------------------------------------------------------------- */
.vsg-player-controls[hidden] {
  display: none !important;
}

.vsg-player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: flex;
  min-height: 66px;
  padding: 18px 18px 11px;
  align-items: center;
  gap: 10px;
  direction: ltr;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.15) 75%, transparent);
}

.vsg-modal button.vsg-player-button {
  display: inline-grid !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 34px !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
  appearance: none;
}

.vsg-modal button.vsg-player-button:hover,
.vsg-modal button.vsg-player-button:focus-visible,
.vsg-player-button.is-muted {
  border: 0 !important;
  background: transparent !important;
  color: var(--vsg-brand) !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none !important;
}

.vsg-player-icon {
  display: grid;
  place-items: center;
}

.vsg-player-icon[hidden] {
  display: none !important;
}

.vsg-player-time {
  min-width: 82px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.vsg-player-progress,
.vsg-player-volume {
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  outline: none;
  appearance: none;
}

.vsg-player-progress {
  --vsg-player-progress: 0%;
  min-width: 90px;
  flex: 1 1 auto;
}

.vsg-player-volume {
  --vsg-player-volume: 100%;
  width: 72px;
  flex: 0 0 72px;
}

.vsg-player-progress::-webkit-slider-runnable-track,
.vsg-player-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--vsg-brand) 0,
    var(--vsg-brand) var(--vsg-player-progress),
    rgba(255, 255, 255, 0.36) var(--vsg-player-progress),
    rgba(255, 255, 255, 0.36) 100%
  );
}

.vsg-player-volume::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--vsg-brand) 0,
    var(--vsg-brand) var(--vsg-player-volume),
    rgba(255, 255, 255, 0.36) var(--vsg-player-volume),
    rgba(255, 255, 255, 0.36) 100%
  );
}

.vsg-player-progress::-moz-range-track,
.vsg-player-volume::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.vsg-player-progress::-moz-range-progress,
.vsg-player-volume::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--vsg-brand);
}

.vsg-player-progress::-webkit-slider-thumb,
.vsg-player-volume::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--vsg-brand);
  box-shadow: none;
  appearance: none;
}

.vsg-player-progress::-moz-range-thumb,
.vsg-player-volume::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--vsg-brand);
  box-shadow: none;
}

.vsg-modal__video-section:fullscreen,
.vsg-modal__video-section:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

.vsg-modal__video-section:fullscreen .vsg-modal__video,
.vsg-modal__video-section:-webkit-full-screen .vsg-modal__video {
  width: 100%;
  height: 100%;
}

/* Bootstrap fallback ----------------------------------------------------- */
body.vsg-modal-open {
  overflow: hidden;
}

.vsg-modal--fallback-open {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.72);
}

.vsg-modal--fallback-open .modal-dialog {
  display: flex;
  min-height: calc(100% - 24px);
  align-items: center;
  margin: 0 auto;
}

@keyframes vsg-spin {
  to { transform: rotate(360deg); }
}

@keyframes vsg-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .vsg-modal__layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

@media (max-width: 991.98px) {
  .vsg-gallery {
    grid-template-columns: repeat(var(--vsg-tablet-columns, 3), minmax(0, 1fr));
  }

  .vsg-modal .modal-dialog {
    width: min(980px, calc(100vw - 18px));
  }

  .vsg-modal__content {
    height: 96vh;
    max-height: none;
  }

  .vsg-modal__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 58%) minmax(0, 42%);
  }

  .vsg-modal__sidebar {
    border-top: 1px solid var(--vsg-border);
    border-right: 0;
  }

  .vsg-modal button.vsg-modal__close {
    color: #3f444d !important;
  }
}

@media (max-width: 767.98px) {
  .vsg-gallery {
    grid-template-columns: repeat(var(--vsg-mobile-columns, 2), minmax(0, 1fr));
    gap: 12px;
  }

  .vsg-video-card {
    border-radius: 11px !important;
  }

  .vsg-video-card__footer {
    padding: 9px 10px;
    gap: 6px;
  }

  .vsg-video-card__title {
    font-size: 12px;
  }

  .vsg-video-card__stats {
    gap: 6px;
  }

  .vsg-video-card__stat {
    font-size: 10px;
  }

  .vsg-video-card__stat svg {
    width: 15px;
    height: 15px;
  }

  .vsg-modal .modal-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .vsg-modal__content {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .vsg-modal__layout {
    grid-template-rows: 44dvh minmax(0, 56dvh);
  }

  .vsg-modal button.vsg-modal__close {
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  .vsg-modal__header {
    min-height: 64px;
    padding: 13px 14px;
  }

  .vsg-modal__title {
    font-size: 16px;
  }

  .vsg-modal__actions {
    gap: 11px;
  }

  .vsg-player-controls {
    min-height: 56px;
    padding: 14px 9px 8px;
    gap: 5px;
  }

  .vsg-modal button.vsg-player-button {
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
    min-height: 31px !important;
    flex-basis: 31px !important;
  }

  .vsg-player-time {
    min-width: 70px;
    font-size: 9px;
  }

  .vsg-player-volume {
    display: none;
  }

  .vsg-comment {
    padding: 13px 12px;
  }

  .vsg-comment-form-wrap {
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 460px) {
  .vsg-video-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .vsg-video-card__stats {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vsg-video-card,
  .vsg-video-card__image,
  .vsg-video-card__play,
  .vsg-loader,
  .vsg-comment__pending-icon,
  .vsg-comment-submit__spinner {
    transition: none !important;
    animation: none !important;
  }
}

/* Version 0.7.0: threaded replies, collapsible comments and mobile layout --- */
body.vsg-page-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.vsg-modal__layout {
  position: relative;
  direction: rtl;
  grid-template-columns: minmax(0, 1fr) 38px minmax(350px, 410px);
  transition: grid-template-columns 220ms ease;
}

.vsg-modal__layout.vsg-comments-collapsed {
  grid-template-columns: minmax(0, 1fr) 38px 0;
}

.vsg-modal__layout.vsg-comments-collapsed .vsg-modal__sidebar {
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.vsg-modal__sidebar {
  transition: opacity 170ms ease, visibility 170ms ease;
}

.vsg-comments-rail-toggle {
  position: relative;
  z-index: 12;
  display: flex !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  border: 0 !important;
  border-right: 1px solid var(--vsg-border) !important;
  border-left: 1px solid var(--vsg-border) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #666c76 !important;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.vsg-comments-rail-toggle:hover,
.vsg-comments-rail-toggle:focus-visible {
  background: #fffaf2 !important;
  color: var(--vsg-brand-dark) !important;
  outline: none !important;
}

.vsg-comments-rail-toggle__text {
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.vsg-comments-rail-toggle__icon {
  display: grid;
  place-items: center;
  transition: transform 180ms ease;
}

.vsg-comments-collapsed .vsg-comments-rail-toggle__icon {
  transform: rotate(180deg);
}

.vsg-mobile-comments-toggle,
.vsg-panel-close {
  display: none !important;
}

.vsg-comment-item {
  position: relative;
  margin-inline-start: calc(var(--vsg-comment-depth, 0) * 6px);
}

.vsg-comment__actions {
  display: inline-flex;
  margin-inline-start: auto;
  align-items: center;
}

.vsg-modal button.vsg-comment__reply-action {
  display: inline-flex !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 2px 3px !important;
  align-items: center;
  gap: 3px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #8b9099 !important;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: none !important;
  cursor: pointer;
}

.vsg-modal button.vsg-comment__reply-action:hover,
.vsg-modal button.vsg-comment__reply-action:focus-visible {
  color: var(--vsg-brand-dark) !important;
  background: transparent !important;
  outline: none !important;
}

.vsg-comment__replies {
  margin-top: 10px;
  gap: 8px;
}

.vsg-reply {
  margin-inline-start: 0;
  border-right-width: 2px;
  background: #fafafa;
}

.vsg-comment--admin {
  border-right-color: var(--vsg-brand);
}

.vsg-reply-target[hidden] {
  display: none !important;
}

.vsg-reply-target {
  display: flex;
  min-height: 32px;
  margin: 0 2px 8px;
  padding: 6px 9px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-right: 2px solid var(--vsg-brand);
  border-radius: 7px;
  background: rgba(245, 166, 34, 0.07);
  color: #686d76;
  font-size: 10px;
  line-height: 1.6;
}

.vsg-reply-target strong {
  color: var(--vsg-brand-dark);
}

.vsg-modal .vsg-reply-target button {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 2px 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: #777c85 !important;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  box-shadow: none !important;
  cursor: pointer;
}

.vsg-modal .vsg-reply-target button:hover,
.vsg-modal .vsg-reply-target button:focus-visible {
  color: var(--vsg-brand-dark) !important;
  outline: none !important;
}

.vsg-comment-context-menu[hidden] {
  display: none !important;
}

.vsg-comment-context-menu {
  position: absolute;
  z-index: 80;
  min-width: 122px;
  padding: 5px;
  border: 1px solid var(--vsg-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 28, 34, 0.12);
}

.vsg-modal .vsg-comment-context-menu button {
  display: flex !important;
  width: 100% !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 7px 9px !important;
  align-items: center;
  gap: 7px;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #4e535c !important;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none !important;
  cursor: pointer;
}

.vsg-modal .vsg-comment-context-menu button:hover,
.vsg-modal .vsg-comment-context-menu button:focus-visible {
  background: rgba(245, 166, 34, 0.1) !important;
  color: var(--vsg-brand-dark) !important;
  outline: none !important;
}

.vsg-comment__avatar,
.vsg-reply__avatar {
  flex-shrink: 0 !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  object-position: 50% 50% !important;
}

@media (max-width: 1199.98px) and (min-width: 768px) {
  .vsg-modal__layout {
    grid-template-columns: minmax(0, 1fr) 36px minmax(320px, 370px) !important;
    grid-template-rows: 1fr !important;
  }

  .vsg-modal__layout.vsg-comments-collapsed {
    grid-template-columns: minmax(0, 1fr) 36px 0 !important;
  }

  .vsg-modal__sidebar {
    border-top: 0 !important;
    border-right: 1px solid var(--vsg-border) !important;
  }
}

@media (max-width: 767.98px) {
  .vsg-gallery {
    grid-template-columns: repeat(var(--vsg-mobile-columns, 2), minmax(0, 1fr)) !important;
    gap: 14px;
  }

  .vsg-video-card__media {
    aspect-ratio: 16 / 9;
  }

  .vsg-video-card__footer {
    align-items: center !important;
    flex-direction: row !important;
    padding: 11px 12px;
  }

  .vsg-video-card__stats {
    width: auto !important;
    justify-content: flex-end !important;
  }

  .vsg-modal {
    padding: 0 !important;
  }

  .vsg-modal__content {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .vsg-modal__layout,
  .vsg-modal__layout.vsg-comments-collapsed {
    position: relative;
    display: block !important;
    width: 100%;
    height: 100%;
  }

  .vsg-modal__video-section {
    width: 100%;
    height: 100%;
  }

  .vsg-comments-rail-toggle {
    display: none !important;
  }

  .vsg-mobile-comments-toggle {
    position: absolute;
    right: 14px;
    bottom: 72px;
    z-index: 15;
    display: inline-flex !important;
    width: auto !important;
    min-width: 52px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--vsg-brand) !important;
    color: #fff !important;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none !important;
    cursor: pointer;
  }

  .vsg-mobile-comments-toggle:hover,
  .vsg-mobile-comments-toggle:focus-visible {
    background: var(--vsg-brand-dark) !important;
    color: #fff !important;
    outline: none !important;
  }

  .vsg-modal__sidebar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 24;
    width: 100%;
    height: min(74dvh, 680px);
    min-height: 360px;
    border-top: 1px solid var(--vsg-border) !important;
    border-right: 0 !important;
    border-radius: 18px 18px 0 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: transform 230ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  .vsg-modal__layout.vsg-comments-collapsed .vsg-modal__sidebar {
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(102%);
  }

  .vsg-panel-close {
    display: grid !important;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f4f5f6 !important;
    color: #555b65 !important;
    box-shadow: none !important;
    cursor: pointer;
  }

  .vsg-panel-close:hover,
  .vsg-panel-close:focus-visible {
    background: var(--vsg-brand) !important;
    color: #fff !important;
    outline: none !important;
  }

  .vsg-modal__header {
    min-height: 62px;
    padding: 12px 13px !important;
    align-items: center;
  }

  .vsg-modal__actions {
    gap: 10px;
  }

  .vsg-comment__reply-action span {
    display: none;
  }

  .vsg-comment,
  .vsg-reply {
    padding: 12px 11px;
  }

  .vsg-comment-item {
    margin-inline-start: calc(var(--vsg-comment-depth, 0) * 3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vsg-modal__layout,
  .vsg-modal__sidebar,
  .vsg-comments-rail-toggle__icon {
    transition: none !important;
  }
}


/* Version 0.8.0: full video fit, icon-only rail, mobile comment dock and flat threads */
.vsg-modal__video-section {
  padding: 0 !important;
}

.vsg-modal__video {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  transform: none !important;
  scale: 1 !important;
}

.vsg-modal__layout {
  grid-template-columns: minmax(0, 1fr) 42px minmax(350px, 410px);
}

.vsg-modal__layout.vsg-comments-collapsed {
  grid-template-columns: minmax(0, 1fr) 42px 0;
}

.vsg-comments-rail-toggle {
  width: 42px !important;
  min-width: 42px !important;
  gap: 0 !important;
}

.vsg-comments-rail-toggle__icon {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(245, 166, 34, 0.28);
  border-radius: 50%;
  background: rgba(245, 166, 34, 0.08);
  color: var(--vsg-brand-dark);
}

.vsg-comments-rail-toggle__text {
  display: none !important;
}

.vsg-mobile-comments-dock {
  display: none;
}

.vsg-comment-item {
  margin-inline-start: 0 !important;
}

.vsg-comment__replies {
  display: flex;
  width: 100%;
  margin-top: 13px;
  padding: 11px 11px 0 0;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(245, 166, 34, 0.34);
}

.vsg-reply {
  width: 100%;
  margin: 0 !important;
  padding: 10px 11px;
  border: 1px solid #eceef1;
  border-right: 2px solid rgba(245, 166, 34, 0.72);
  border-radius: 9px;
  background: #fafafa;
}

.vsg-reply[data-depth="2"],
.vsg-reply[data-depth="3"],
.vsg-reply[data-depth="4"] {
  margin-inline-start: 0 !important;
}

.vsg-reply__to {
  display: block;
  margin-top: 3px;
  color: #8a8f98;
  font-size: 9px;
  line-height: 1.6;
}

@media (max-width: 1199.98px) and (min-width: 768px) {
  .vsg-modal__layout {
    grid-template-columns: minmax(0, 1fr) 40px minmax(320px, 370px) !important;
  }

  .vsg-modal__layout.vsg-comments-collapsed {
    grid-template-columns: minmax(0, 1fr) 40px 0 !important;
  }

  .vsg-comments-rail-toggle {
    width: 40px !important;
    min-width: 40px !important;
  }
}

@media (max-width: 767.98px) {
  .vsg-modal__video-section {
    padding-bottom: 0 !important;
  }

  .vsg-modal__video {
    object-fit: contain !important;
  }

  .vsg-mobile-comments-dock {
    position: absolute;
    right: 12px;
    bottom: 64px;
    left: 12px;
    z-index: 15;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--vsg-text);
    backdrop-filter: blur(10px);
  }

  .vsg-mobile-comments-dock__stats {
    display: flex;
    min-height: 38px;
    padding: 7px 12px 5px;
    align-items: center;
    justify-content: flex-start;
    gap: 17px;
    border-bottom: 1px solid rgba(36, 39, 48, 0.07);
  }

  .vsg-mobile-stat,
  .vsg-modal button.vsg-mobile-stat {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center;
    gap: 5px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #555b65 !important;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none !important;
  }

  .vsg-modal button.vsg-mobile-stat {
    cursor: pointer;
  }

  .vsg-modal button.vsg-mobile-stat:hover,
  .vsg-modal button.vsg-mobile-stat:focus-visible,
  .vsg-modal button.vsg-mobile-stat.is-liked {
    color: var(--vsg-brand-dark) !important;
    outline: none !important;
  }

  .vsg-modal button.vsg-mobile-stat.is-liked svg {
    fill: var(--vsg-brand);
    stroke: var(--vsg-brand);
  }

  .vsg-mobile-stat__icon {
    display: inline-flex;
  }

  .vsg-mobile-comments-toggle {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #31353d !important;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none !important;
  }

  .vsg-mobile-comments-toggle:hover,
  .vsg-mobile-comments-toggle:focus-visible {
    background: rgba(245, 166, 34, 0.06) !important;
    color: var(--vsg-brand-dark) !important;
    outline: none !important;
  }

  .vsg-mobile-comments-toggle__label {
    order: 1;
    text-align: right;
  }

  .vsg-mobile-comments-toggle__arrow {
    order: 2;
    display: grid;
    place-items: center;
    color: var(--vsg-brand-dark);
    transition: transform 180ms ease;
  }

  .vsg-mobile-comments-toggle.is-open .vsg-mobile-comments-toggle__arrow {
    transform: rotate(180deg);
  }

  .vsg-comment__replies {
    padding-right: 8px;
    gap: 7px;
  }

  .vsg-reply {
    padding: 9px 9px;
  }
}

/* Version 0.9.0: adaptive video sizing, corrected panel arrows and performance */
.vsg-video-card {
  content-visibility: auto;
  contain-intrinsic-size: 320px 230px;
  contain: layout paint;
}

.vsg-modal__video-section {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.vsg-modal__video {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  transform: none !important;
}

/* پنل نظرها سمت چپ است: در حالت باز فلش به چپ و در حالت بسته به راست اشاره می‌کند. */
.vsg-comments-rail-toggle__icon {
  transform: rotate(180deg);
}

.vsg-comments-collapsed .vsg-comments-rail-toggle__icon {
  transform: rotate(0deg);
}

@media (min-width: 768px) {
  .vsg-modal__video {
    width: auto !important;
    height: auto !important;
    margin: auto;
    object-position: center center !important;
  }
}

@media (max-width: 767.98px) {
  .vsg-modal__layout,
  .vsg-modal__layout.vsg-comments-collapsed {
    height: 100dvh !important;
    overflow: hidden;
    background: #050506;
  }

  .vsg-modal__video-section {
    width: 100%;
    height: var(--vsg-mobile-stage-height, min(68dvh, 560px)) !important;
    min-height: 340px;
    max-height: 100dvh;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow: hidden;
  }

  .vsg-modal__video {
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    object-position: center top !important;
  }

  .vsg-mobile-comments-dock {
    bottom: 62px;
  }
}

/* Version 0.9.1: mobile comments dock below the player */
@media screen and (max-width: 767.98px) {
  .vsg-modal__layout,
  .vsg-modal__layout.vsg-comments-collapsed {
    position: relative;
    display: flex !important;
    width: 100%;
    height: 100dvh !important;
    min-height: 0 !important;
    flex-direction: column;
    overflow: hidden !important;
    background: #050506;
  }

  .vsg-modal__video-section {
    position: relative !important;
    display: flex !important;
    width: 100% !important;
    height: var(--vsg-mobile-stage-height, auto) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 82px) !important;
    flex: 0 0 var(--vsg-mobile-stage-height, auto) !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #050506 !important;
  }

  .vsg-modal__video {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
  }

  .vsg-mobile-comments-dock {
    position: relative !important;
    inset: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 16;
    display: flex !important;
    width: 100% !important;
    min-height: 82px;
    margin: 0 !important;
    flex: 0 0 auto;
    flex-direction: column;
    overflow: hidden;
    border: 0 !important;
    border-top: 1px solid rgba(36, 39, 48, 0.08) !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: var(--vsg-text);
    box-shadow: none !important;
    backdrop-filter: none !important;
    transform: none !important;
  }

  .vsg-mobile-comments-dock__stats {
    min-height: 38px;
    flex: 0 0 38px;
  }

  .vsg-mobile-comments-toggle {
    min-height: 44px !important;
    flex: 0 0 44px;
  }
}

/* مدیریت دیدگاه از فرانت برای مدیر */
.vsg-modal .vsg-comment-context-menu .vsg-context-reject {
  color: #b42318 !important;
}

.vsg-modal .vsg-comment-context-menu .vsg-context-reject:hover,
.vsg-modal .vsg-comment-context-menu .vsg-context-reject:focus-visible {
  background: rgba(180, 35, 24, 0.08) !important;
  color: #8f1c13 !important;
}

.vsg-comment-item--moderating {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 160ms ease;
}

/* Version 0.10.2: manual comments refresh */
.vsg-action-button--refresh .vsg-action-button__icon,
.vsg-mobile-stat--refresh .vsg-mobile-stat__icon {
  transform-origin: center;
}

.vsg-modal button.vsg-action-button--refresh.is-refreshing,
.vsg-modal button.vsg-mobile-stat--refresh.is-refreshing {
  color: var(--vsg-brand-dark) !important;
}

.vsg-action-button--refresh.is-refreshing .vsg-action-button__icon,
.vsg-mobile-stat--refresh.is-refreshing .vsg-mobile-stat__icon {
  animation: vsg-spin 0.75s linear infinite;
}

.vsg-modal button.vsg-action-button--refresh:disabled,
.vsg-modal button.vsg-mobile-stat--refresh:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* Aparat embedded player. */
.vsg-modal__embed {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #050506;
}

.vsg-modal__embed[hidden] {
  display: none !important;
}



/* v0.11.5: In fixed-size mode, keep the modal and comments unchanged while
 * vertically centering the native 16:9 Aparat iframe inside the video area. */
.vsg-modal--size-fixed.vsg-modal--source-aparat .vsg-modal__embed {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  align-self: center;
  justify-self: center;
}

/* Optional Aparat player sizing mode. This changes only the iframe itself. */
.vsg-modal--size-player.vsg-modal--source-aparat .vsg-modal__embed {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
}

/* v0.11.3: In player-sized Aparat mode, shrink the modal height to the
 * rendered 16:9 player. The comments layout is not restyled; it simply
 * shares the resulting modal row height. */
@media (min-width: 768px) {
  .vsg-modal--size-player.vsg-modal--source-aparat .vsg-modal__content {
    height: auto;
    max-height: min(94vh, 940px);
  }

  .vsg-modal--size-player.vsg-modal--source-aparat .vsg-modal__layout {
    height: auto;
    min-height: 0;
    grid-auto-rows: auto;
  }

  .vsg-modal--size-player.vsg-modal--source-aparat .vsg-modal__video-section {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .vsg-modal--size-player.vsg-modal--source-aparat .vsg-modal__embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
  }
}


/* v0.11.6: Responsive gallery columns and 16:9 video covers. */
@media (max-width: 479.98px) {
  .vsg-gallery {
    grid-template-columns: 1fr !important;
  }
}
